本文整理汇总了C++中QPRINTF函数的典型用法代码示例。如果您正苦于以下问题:C++ QPRINTF函数的具体用法?C++ QPRINTF怎么用?C++ QPRINTF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QPRINTF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: app_push
void app_push(struct ke_msg *msg)
{
// Push the message into the list of messages pending for transmission
co_list_push_back(&com_env.queue_rx, &msg->hdr);
QPRINTF("\r\[email protected]@@app_push:");
for (uint8_t i = 0; i<msg->param_len; i++)
QPRINTF("%c",((uint8_t *)&msg->param)[i]);
QPRINTF("\r\n");
//only send in the first push.
uint8_t *p_data = (uint8_t *)msg->param;
uint8_t pack_nb = msg->param_len/QPP_DATA_MAX_LEN + 1;
uint8_t pack_divide_len = msg->param_len%QPP_DATA_MAX_LEN;
for (uint8_t char_idx = 0,i = 0;((app_qpps_env->char_status & (~(QPPS_VALUE_NTF_CFG << (char_idx - 1) ))) && (char_idx < QPPS_VAL_CHAR_NUM ));char_idx++)
{
if (i < (pack_nb - 1))
{
app_qpps_env->char_status &= ~(QPPS_VALUE_NTF_CFG << char_idx);
app_qpps_data_send(app_qpps_env->conhdl,char_idx,QPP_DATA_MAX_LEN,(uint8_t *)p_data);
p_data += QPP_DATA_MAX_LEN;
}
else
{
if ((pack_divide_len != 0) && (i == (pack_nb - 1)))
{
app_qpps_env->char_status &= ~(QPPS_VALUE_NTF_CFG << char_idx);
app_qpps_data_send(app_qpps_env->conhdl,char_idx,pack_divide_len,(uint8_t *)p_data);
p_data += pack_divide_len;
}
}
i++;
}
}
示例2: app_hogpbh_boot_report_ind_handler
/*
****************************************************************************************
* @brief Handles the generic message Boot Report value send to APP. (after Read Request or Notification) *//**
*
* @param[in] msgid HOGPBH_BOOT_REPORT_IND
* @param[in] param Pointer to the struct hogpbh_boot_report_ind
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_HOGPBH
*
* @return If the message was consumed or not.
* @description
*
* This API is used to inform the application about the read Boot Keyboard Input Report
* Characteristic value.
*
****************************************************************************************
*/
int app_hogpbh_boot_report_ind_handler(ke_msg_id_t const msgid,
struct hogpbh_boot_report_ind *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
uint8_t idx = KE_IDX_GET(src_id);
switch (param->ind_type)
{
case HOGPBH_IND_RD_RSP:
break;
case HOGPBH_IND_NTF:
if (param->char_code == HOGPBH_CHAR_BOOT_KB_IN_REPORT) {
QPRINTF("HOGPBH Keyboard in report notification(%d):\r\n", param->hids_nb);
QTRACE(param->report, param->report_length, 0, 2);
QPRINTF("\r\n");
if (app_hogpbh_env[idx].cur_code == 2) {
// Start Mouse Notify here
app_hogpbh_cfg_ntf_req(HOGPBH_DESC_BOOT_MOUSE_IN_REPORT_CFG, PRF_CLI_START_NTF,
app_hogpbh_env[idx].hids_mouse, param->conhdl);
app_hogpbh_env[idx].cur_code = 0;
}
}
else if (param->char_code == HOGPBH_CHAR_BOOT_MOUSE_IN_REPORT) {
QPRINTF("HOGPBH Mouse in report notification(%d):\r\n", param->hids_nb);
QTRACE(param->report, param->report_length, 0, 2);
QPRINTF("\r\n");
}
break;
default:
break;
}
return (KE_MSG_CONSUMED);
}
示例3: app_tipc_ct_ind_handler
/*
****************************************************************************************
* @brief Received Current Time value sent to APP (Read Response or Notification). *//**
*
* @param[in] msgid TIPC_CT_IND
* @param[in] param Pointer to struct tipc_ct_ind
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_TIPC
* @return If the message was consumed or not.
* @description
*
* This API is used by the Client role to inform the Application of a received current time
* value. The ind_type parameter informs the application if the value has been notified by the
* Time Client or if it has been received as a read response.
*
****************************************************************************************
*/
int app_tipc_ct_ind_handler(ke_msg_id_t const msgid,
struct tipc_ct_ind *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
QPRINTF("TIPC Current Time indication(%d): Adjust Reason: %d, Fraction: %d, Day/Week: %d.\r\n",
param->ind_type,
param->ct_val.adjust_reason,
param->ct_val.exact_time_256.fraction_256, ///n * (1/256th) of a second
param->ct_val.exact_time_256.day_date_time.day_of_week
);
#if QN_DBG_TRACE_MORE
QPRINTF("Date: %04d:%02d:%02d Time: %02d:%02d:%02d\r\n",
param->ct_val.exact_time_256.day_date_time.date_time.year,
param->ct_val.exact_time_256.day_date_time.date_time.month,
param->ct_val.exact_time_256.day_date_time.date_time.day,
param->ct_val.exact_time_256.day_date_time.date_time.hour,
param->ct_val.exact_time_256.day_date_time.date_time.min,
param->ct_val.exact_time_256.day_date_time.date_time.sec
);
#endif
app_task_msg_hdl(msgid, param);
return (KE_MSG_CONSUMED);
}
示例4: app_hogprh_report_ind_handler
/*
****************************************************************************************
* @brief Handles the generic message Boot Mouse Input Report value send to APP
* (after Read Request or Notification) . *//**
*
* @param[in] msgid HOGPRH_REPORT_IND
* @param[in] param Pointer to the struct hogprh_report_ind
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_HOGPRH
*
* @return If the message was consumed or not.
* @description
*
* This API is used to inform the application about the read Client Characteristic Configuration
* Descriptor value.
*
* The following table present all the possible values for the ind_type parameter:
* - HOGPRH_IND_NTF (0x00): The Report Characteristic value has been received has a
* notification and the value is complete.
* - HOGPRH_IND_RD_RSP (0x01): The Report Characteristic value has been received has a read
* response.
* - HOGPRH_IND_INCOMPLETE_NTF (0x02): The Report Characteristic value has been received has a
* notification and the value is not complete. See the note below.
*
* @note
*
* Here is an extract of the BLE HIDS specification,
* "Notification of characteristic values can contain at most [ATT_MTU-3] bytes of data by definition. Data beyond
* [ATT_MTU-3] bytes long is not included in a notification, and must instead be read using the GATT Read Long
* Characteristic Value sub-procedure. The possibility that data to be notified in a Report characteristic value could
* change before the HID Host completed an outstanding Read Long Characteristic Value sub-procedure, and therefore be
* lost, exists. For this reason it is strongly recommended that HID Devices support an ATT_MTU large enough to transfer
* their largest possible Report characteristic value in a single transaction."
*
* Thus when an indication in received with an indication type set to HOGPRH_IND_INCOMPLETE_NTF, the application
* can begin to parse this incomplete Report value. Then it must wait for another indication whose the indication type
* will be set to HOGPRH_IND_RD_RSP and which will contain the whole Report Characteristic value (the first indication
* can be discarded if needed).
*
****************************************************************************************
*/
int app_hogprh_report_ind_handler(ke_msg_id_t const msgid,
struct hogprh_report_ind *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
uint8_t idx = KE_IDX_GET(src_id);
switch (param->ind_type)
{
case HOGPRH_IND_RD_RSP:
QPRINTF("HOGPRH Read HIDS Report(%d).\r\n", param->hids_nb);
QTRACE(param->report, param->report_length, 0, 2);
QPRINTF("\r\n");
break;
case HOGPRH_IND_NTF:
QPRINTF("HOGPRH Notification(%d).\r\n", param->hids_nb);
QTRACE(param->report, param->report_length, 0, 2);
QPRINTF("\r\n");
if ((!app_hogprh_env[idx].cur_code) && (param->hids_nb+1 < app_hogprh_env[idx].hids_nb)) {
// start notification
app_hogprh_cfg_ntf_req(0, PRF_CLI_START_NTF, param->hids_nb+1, param->conhdl); /* 0 is our demo input report */
app_hogprh_env[idx].cur_code = 1;
}
break;
default:
break;
}
return (KE_MSG_CONSUMED);
}
示例5: app_rscpc_cmp_evt_handler
/*
****************************************************************************************
* @brief Handles the complete event from TASK_RSCPC. *//**
*
* @param[in] msgid RSCPC_CMP_EVT
* @param[in] param Pointer to struct rscpc_cmp_evt
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_RSCPC
* @return If the message was consumed or not.
* @description
*
* This handler is used to inform the sender of a command that the procedure is over and
* contains the status of the procedure.
*
****************************************************************************************
*/
int app_rscpc_cmp_evt_handler(ke_msg_id_t const msgid,
struct rscpc_cmp_evt *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
switch (param->operation)
{
case RSCPC_ENABLE_OP_CODE:
if (param->status == PRF_ERR_OK)
{
QPRINTF("Enable complete\r\n");
}
else
{
QPRINTF("Enable failed %d\r\n", param->status);
}
break;
case RSCPC_READ_OP_CODE:
QPRINTF("Read procedure complete, result is %d\r\n", param->status);
break;
case RSCPC_CFG_NTF_IND_OP_CODE:
QPRINTF("Configure procedure complete, result is %d\r\n", param->status);
break;
case RSCPC_CTNL_PT_CFG_WR_OP_CODE:
QPRINTF("Ctrl procedure complete, result is %d\r\n", param->status);
break;
default:
break;
}
app_task_msg_hdl(msgid, param);
return (KE_MSG_CONSUMED);
}
示例6: free_notic_info_timer
void free_notic_info_timer(unsigned short const msgid)
{
unsigned int start_time=0,end_time=0;
unsigned int current_time=0;
QPRINTF("==free notice count\r\n");
if((++free_notic_info.count_time) >= free_notic_info.time)
{
/*1.clear count time */
free_notic_info.count_time = 0;
/*2.motor open */
if(free_notic_info.free_enable)
{
s_tm ltime = {0};
system_time_get(<ime);
current_time = 60*ltime.hour + ltime.minute;
start_time = free_notic_info.start_time_hour*60 +
free_notic_info.start_time_minute;
end_time = free_notic_info.end_time_hour*60 +
free_notic_info.end_time_minute;
if((start_time <= current_time) && (current_time < end_time))
{
QPRINTF(" free notic : motor turn on \r\n");
}
}
}
ke_timer_set(USR_FREE_NOTICE_INFO_TIMER, 60*100);
}
示例7: app_paspc_val_ind_handler
/*
****************************************************************************************
* @brief Handles Indicate that an attribute value has been received either upon notification
* or read response. *//**
*
* @param[in] msgid PASPC_VALUE_IND
* @param[in] param Pointer to struct paspc_value_ind
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_PASPC
* @return If the message was consumed or not.
* @description
*
* This handler is sent to the application once an attribute value has been received from
* the peer device upon a notification or a read response message. The content of the value
* parameter depends of the attribute code value which defines the attribute that has been
* updated
*
****************************************************************************************
*/
int app_paspc_val_ind_handler(ke_msg_id_t const msgid,
struct paspc_value_ind *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
uint8_t att_code = param->att_code;
switch (att_code)
{
case PASPC_RD_ALERT_STATUS:
QPRINTF("Alert Status characteristic value: %d%.\r\n",
param->value.alert_status);
break;
case PASPC_RD_RINGER_SETTING:
QPRINTF("PAS Ringer Setting: %d%.\r\n",
param->value.ringer_setting);
break;
case PASPC_RD_WR_ALERT_STATUS_CFG:
QPRINTF("PAS Alert Status Client Characteristic Configuration Descriptor: %d%.\r\n",
param->value.alert_status_ntf_cfg);
break;
case PASPC_RD_WR_RINGER_SETTING_CFG:
QPRINTF("PAS Ringer Setting Client Characteristic Configuration Descriptor: %d%.\r\n",
param->value.ringer_setting_ntf_cfg);
break;
default:
break;
}
app_task_msg_hdl(msgid, param);
return (KE_MSG_CONSUMED);
}
示例8: app_htpc_rd_char_rsp_handler
/*
****************************************************************************************
* @brief Handles the generic message for read responses for APP. *//**
*
* @param[in] msgid HTPC_RD_CHAR_RSP
* @param[in] param Pointer to struct htpc_rd_char_rsp
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_HTPC
* @return If the message was consumed or not.
* @description
*
* This API is used by the Collector role to inform the Application of a
* received read response. The status and the data from the read response are passed directly to
* Application, which must interpret them based on the request it made.
*
****************************************************************************************
*/
int app_htpc_rd_char_rsp_handler(ke_msg_id_t const msgid,
struct htpc_rd_char_rsp *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
QPRINTF("HTPC read char response status: 0x%x code: 0x%X.\r\n",
param->status,
param->att_code);
if (param->att_code == HTPC_CHAR_HTS_MEAS_INTV)
{
QPRINTF("MEAS INTV: ");
if (param->data.len == 0)
{
QPRINTF("NULL");
}
else
{
for (uint8_t i = 0; i < param->data.len; i++)
QPRINTF("%x", param->data.data[param->data.len-i-1]);
}
QPRINTF("s\r\n");
}
app_task_msg_hdl(msgid, param);
return (KE_MSG_CONSUMED);
}
示例9: dev_send_to_app
void dev_send_to_app(struct app_uart_data_ind *param)
{
uint8_t *buf_20;
int16_t len = param->len;
int16_t send_len = 0;
uint8_t packet_len = get_bit_num(app_qpps_env->char_status)*20;
#ifdef CATCH_LOG
QPRINTF("\r\[email protected]@@len %d\r\[email protected]@@data\r\n",len);
for(uint8_t j = 0; j<len; j++)
QPRINTF("%c",param->data[j]);
QPRINTF("\r\n");
#endif
if(app_qpps_env->char_status)
{
for(uint8_t i =0; send_len < len; i++)
{
if (len > packet_len) //Split data into package when len longger than 20
{
if (len - send_len > packet_len)
{
buf_20 = (uint8_t*)ke_msg_alloc(0, 0, 0, packet_len);
if(buf_20 != NULL)
{
memcpy(buf_20,param->data+send_len,packet_len);
send_len+=packet_len;
}
}
else
{
buf_20 = (uint8_t *)ke_msg_alloc(0,0,0,len-send_len);
if (buf_20 != NULL)
{
memcpy(buf_20,param->data+send_len,len-send_len);
send_len = len;
}
}
}
else //not longger ther 20 send data directely
{
buf_20 = (uint8_t *)ke_msg_alloc(0,0,0,len);
if (buf_20 != NULL)
{
memcpy(buf_20,param->data,len);
send_len = len;
}
//app_qpps_data_send(app_qpps_env->conhdl,0,len,param->data);
}
//push the package to kernel queue.
app_push(ke_param2msg(buf_20));
}
}
}
示例10: app_blpc_rd_char_rsp_handler
/*
****************************************************************************************
* @brief Handles the generic message for read responses for APP. *//**
*
* @param[in] msgid BLPC_RD_CHAR_RSP
* @param[in] param Pointer to struct blpc_rd_char_rsp
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_BLPC
* @return If the message was consumed or not.
* @description
*
* This API is used by the Collector role to inform the Application of a received read response. The
* status and the data from the read response are passed directly to Application, which must interpret them based on
* the request it made.
****************************************************************************************
*/
int app_blpc_rd_char_rsp_handler(ke_msg_id_t const msgid,
struct blpc_rd_char_rsp *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
QPRINTF("BLPC read char response status: 0x%x.\r\n", param->status);
QTRACE(param->data.data, param->data.len, 1, 2);
QPRINTF("\r\n");
app_task_msg_hdl(msgid, param);
return (KE_MSG_CONSUMED);
}
示例11: app_ancsc_data_source_ind_handler
/*
****************************************************************************************
* @brief Accept and process of the Data Source notification. *//**
*
* @param[in] msgid ANCSC_DATA_SOURCE_IND
* @param[in] param Pointer to struct ancsc_data_source_ind
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_ANCSC
* @return If the message was consumed or not.
* @description
*
* This handler is called once a Data Source value has been received from the peer device
* upon a notification operation. If the value is larger than the 20 bytes, it is split into
* multiple fragments by the NP. The NC must recompose the value by splicing each fragment.
* The value is complete when the complete tuples for each requested attribute has been received.
*
****************************************************************************************
*/
int app_ancsc_data_source_ind_handler(ke_msg_id_t const msgid,
struct ancsc_data_source_ind *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
QPRINTF("Data Size: %d\r\n", param->data_size);
for (uint8_t i = 0; i < param->data_size; i++)
QPRINTF("%02x", param->data_source[i]);
QPRINTF("\r\n");
return (KE_MSG_CONSUMED);
}
示例12: show_com_mode
void show_com_mode(uint8_t com_mode)
{
QPRINTF("\r\n/*******************************");
QPRINTF("\r\n * *");
switch(com_mode)
{
case COM_MODE_IDLE :
{
QPRINTF("\r\n * COM_MODE_IDLE *");
break;
}
case COM_MODE_TRAN :
{
QPRINTF("\r\n * COM_MODE_TRAN *");
break;
}
case COM_MODE_AT :
{
QPRINTF("\r\n * COM_MODE_AT *");
break;
}
default :
QPRINTF("\r\n * COM_MODE_UNKNOWN *");
break;
}
QPRINTF("\r\n * *");
QPRINTF("\r\n********************************/\r\n");
}
示例13: wstsc_dma_xfer_out
int
wstsc_dma_xfer_out(struct sci_softc *dev, int len, register u_char *buf,
int phase)
{
int wait = sci_data_wait;
volatile register u_char *sci_dma = dev->sci_data;
volatile register u_char *sci_csr = dev->sci_csr;
QPRINTF(("supradma_out %d, csr=%02x\n", len, *dev->sci_bus_csr));
QPRINTF(("supradma_out {%d} %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
len, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
buf[6], buf[7], buf[8], buf[9]));
*dev->sci_tcmd = phase;
*dev->sci_mode = SCI_MODE_DMA;
*dev->sci_icmd = SCI_ICMD_DATA;
*dev->sci_dma_send = 0;
while (len > 0) {
wait = sci_data_wait;
while ((*sci_csr & (SCI_CSR_DREQ|SCI_CSR_PHASE_MATCH)) !=
(SCI_CSR_DREQ|SCI_CSR_PHASE_MATCH)) {
if (!(*sci_csr & SCI_CSR_PHASE_MATCH)
|| !(*dev->sci_bus_csr & SCI_BUS_BSY)
|| --wait < 0) {
#ifdef DEBUG
if (sci_debug)
printf("supradma_out fail: l%d i%x w%d\n",
len, *dev->sci_bus_csr, wait);
#endif
*dev->sci_mode = 0;
return 0;
}
}
*sci_dma = *buf++;
len--;
}
wait = sci_data_wait;
while ((*sci_csr & (SCI_CSR_DREQ|SCI_CSR_PHASE_MATCH)) ==
SCI_CSR_PHASE_MATCH && --wait);
*dev->sci_mode = 0;
*dev->sci_icmd = 0;
return 0;
}
示例14: app_is_interm_temp_stable
/**
****************************************************************************************
* @brief whether intermediate temperature is stable.
* User may overwrite this function to ensure the temperature is stable.
****************************************************************************************
*/
bool app_is_interm_temp_stable(int32_t itemp_x10)
{
int32_t diff;
if(itemp_x10 > usr_env.imeas.max)
{
usr_env.imeas.max = itemp_x10;
}
else if(itemp_x10 < usr_env.imeas.min)
{
usr_env.imeas.min = itemp_x10;
}
diff = usr_env.imeas.max - usr_env.imeas.min;
if(diff > 0 && diff < HTPT_INTERM_MEAS_STABLE_TOLERABLE_LIMIT)
{
++usr_env.imeas.stable_counter;
}
else
{
usr_env.imeas.stable_counter = 0;
}
if(usr_env.imeas.stable_counter > HTPT_INTERM_MEAS_STABLE_COUNTER_MAX)
{
QPRINTF("intermediate temperature is stable\r\n");
return true;
}
else
return false;
}
示例15: app_ancsc_ntf_source_ind_handler
/*
****************************************************************************************
* @brief Accept and process of the Notification Source notification. *//**
*
* @param[in] msgid ANCSC_NTF_SOURCE_IND
* @param[in] param Pointer to struct ancsc_ntf_source_ind
* @param[in] dest_id TASK_APP
* @param[in] src_id TASK_ANCSC
* @return If the message was consumed or not.
* @description
*
* This handler is called once a Notification Source value has been received from the peer device
* upon a notification operation.
*
****************************************************************************************
*/
int app_ancsc_ntf_source_ind_handler(ke_msg_id_t const msgid,
struct ancsc_ntf_source_ind *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
//uint8_t idx = KE_IDX_GET(src_id);
QPRINTF("EventID: %d, EventFlags: %d, CategoryID: %d, count: %d, NotificationUID: %d\r\n",
param->ntf_source.event_id,
param->ntf_source.event_flags,
param->ntf_source.category_id,
param->ntf_source.category_count,
param->ntf_source.ntf_uid);
if (param->ntf_source.event_id == NOTIFICATION_ADDED)
{
app_ancsc_env->ntf_uid = param->ntf_source.ntf_uid;
uint8_t cmd[] = {0x00/* AttributeIDAppIdentifier */,
0x01/* AttributeIDTitle */, 0x20, 0x00,
0x03/* AttributeIDMessage */, 0x20, 0x00};
app_ancsc_get_ntf_attribute_req(param->ntf_source.ntf_uid, sizeof(cmd), cmd, param->conhdl);
}
return (KE_MSG_CONSUMED);
}