• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ QPRINTF函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中QPRINTF函数的典型用法代码示例。如果您正苦于以下问题:C++ QPRINTF函数的具体用法?C++ QPRINTF怎么用?C++ QPRINTF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了QPRINTF函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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++;
		}
}
开发者ID:haby77,项目名称:fireble_passthrough,代码行数:33,代码来源:app_com.c


示例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);
}
开发者ID:haby77,项目名称:Bruntest_FireBLE,代码行数:51,代码来源:app_hogpbh_task.c


示例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);
}
开发者ID:charliexp,项目名称:FireBLE,代码行数:43,代码来源:app_tipc_task.c


示例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);
}
开发者ID:haby77,项目名称:Bruntest_FireBLE,代码行数:70,代码来源:app_hogprh_task.c


示例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);
}
开发者ID:haby77,项目名称:BLE-passthrough,代码行数:49,代码来源:app_rscpc_task.c


示例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(&ltime);
			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);

}
开发者ID:liuyuanbin,项目名称:ET-smart-band,代码行数:30,代码来源:free_notic.c


示例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);
}
开发者ID:haby77,项目名称:BLE-passthrough,代码行数:54,代码来源:app_paspc_task.c


示例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);
}
开发者ID:GurjeetSPannu,项目名称:WearWare-BTLE,代码行数:44,代码来源:app_htpc_task.c


示例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));
				}
    }
}
开发者ID:haby77,项目名称:fireble_passthrough,代码行数:54,代码来源:app_com.c


示例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);
}
开发者ID:charliexp,项目名称:FireBLE,代码行数:28,代码来源:app_blpc_task.c


示例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);
}
开发者ID:nephen,项目名称:BluetoothLamp,代码行数:31,代码来源:app_ancsc_task.c


示例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");
}
开发者ID:haby77,项目名称:fireble_passthrough,代码行数:28,代码来源:app_com.c


示例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;
}
开发者ID:lacombar,项目名称:netbsd-alc,代码行数:48,代码来源:wstsc.c


示例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;
}
开发者ID:hiccchen,项目名称:d-gitku,代码行数:38,代码来源:usr_design.c


示例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);
}
开发者ID:nephen,项目名称:BluetoothLamp,代码行数:42,代码来源:app_ancsc_task.c


示例16: app_htpt_idle_connection_timeout_timer_handler

/**
 ****************************************************************************************
 * @brief idle connection timeout timer event.
 *
 * @param[in] msgid     APP_HTPT_IDLE_CONNECTION_TIMEOUT_TIMER
 * @param[in] param     None
 * @param[in] dest_id   TASK_APP
 * @param[in] src_id    TASK_APP
 *
 * @return If the message was consumed or not.
 * @description
 ****************************************************************************************
 */
int app_htpt_idle_connection_timeout_timer_handler(ke_msg_id_t const msgid, void const *param, ke_task_id_t
                                                   const dest_id, ke_task_id_t const src_id)
{
    // there are two place to disconnect, one is idle connection timeout,
    // the other is temperature measure send complete
    usr_env.is_idle_connection_overtime = true;

    QPRINTF("idle connection timeout\r\n");

    if(!usr_env.is_meas_send_busy && !usr_env.is_imeas_send_busy)
    {
        QPRINTF("Force disconnect\r\n");
        app_gap_discon_req(app_htpt_env->conhdl);
    }
    return (KE_MSG_CONSUMED);
}
开发者ID:hiccchen,项目名称:d-gitku,代码行数:29,代码来源:usr_design.c


示例17: app_send_stored_meas

/**
 ****************************************************************************************
 * @brief Send stored measure value, if no data to send, will disconnect
 ****************************************************************************************
 */
void app_send_stored_meas(void)
{
    if(usr_env.is_temp_meas_config)
    {
        struct htp_temp_meas temp_meas;

        // if not empty, send the indication
        if(app_store_meas_fifo_out(&temp_meas))
        {
            usr_env.is_meas_send_busy = true;
            app_htpt_temp_send(app_htpt_env->conhdl, &temp_meas, TEMPERATURE_MEASUREMENT);
        }
        else
        {
            // there are two place to disconnect, one is idle connection timeout,
            // the other is temperature measure send complete
            usr_env.is_meas_send_busy = false; // set measure send complete
            if(usr_env.is_idle_connection_overtime && !usr_env.is_imeas_send_busy) // idle connection timeout
            {
                QPRINTF("Force disconnect\r\n");
                app_gap_discon_req(app_htpt_env->conhdl);
            }
        }
    }
}
开发者ID:hiccchen,项目名称:d-gitku,代码行数:30,代码来源:usr_design.c


示例18: app_com_at_command_handler

void app_com_at_command_handler(void)
{
#ifdef CATCH_LOG
		QPRINTF("\r\n at_process_command:\r\n");

		for(uint8_t i = 0;i < com_env.com_at_len+1;i++)
			QPRINTF("0x%02x ",com_env.com_at_buf[i]);
#endif
	
    //AT Comand length is more than 3
    if(com_env.com_at_len >= 3)
    {
        // if it's start with "AT"
        if(com_env.com_at_buf[0] == 'A' && com_env.com_at_buf[1] == 'T')
        {
            //Test if Enter the AT mode
            if(com_env.com_at_len == 3)
            {
                com_pdu_send(sprintf((char *)at_command_return,"OK\r\n"),at_command_return);
            }
            else
            {
                //if it's a AT Command ,send it to at_process_command process.
                if(com_env.com_at_buf[2] == '+')
                {
                    com_env.com_at_buf[com_env.com_at_len-1] = '\0';
                    com_pdu_send(at_process_command(com_env.com_at_buf + 2,at_command_return),at_command_return);
                }
                else
                {
                    com_pdu_send(sprintf((char *)at_command_return,"AT ERR\r\n"),at_command_return);
                }
            }
        }
        else
        {
            com_pdu_send(sprintf((char *)at_command_return,"AT ERR\r\n"),at_command_return);
        }
    }
    else
    {
        com_pdu_send(sprintf((char *)at_command_return,"AT ERR\r\n"),at_command_return);
    }
    //receive continue
    com_uart_at_rx_start();
    ke_evt_clear(1UL << EVENT_AT_COMMAND_PROC_ID);
}
开发者ID:haby77,项目名称:fireble_passthrough,代码行数:47,代码来源:app_com.c


示例19: app_htpt_error_ind_handler

/*
 ****************************************************************************************
 * @brief Handles the error indication from the HTPT.       *//**
 *
 * @param[in] msgid     HTPT_ERROR_IND
 * @param[in] param     Pointer to the struct prf_server_error_ind
 * @param[in] dest_id   TASK_APP
 * @param[in] src_id    TASK_HTPT
 *
 * @return If the message was consumed or not.
 * @description
 * This handler is to inform the Application of an occurred error.
 ****************************************************************************************
 */
int app_htpt_error_ind_handler(ke_msg_id_t const msgid,
                               struct prf_server_error_ind *param,
                               ke_task_id_t const dest_id,
                               ke_task_id_t const src_id)
{
    QPRINTF("HTPT error indication.\r\n");
    return (KE_MSG_CONSUMED);
}
开发者ID:nephen,项目名称:BluetoothLamp,代码行数:22,代码来源:app_htpt_task.c


示例20: app_hogpd_ctnl_pt_ind_handler

/*
 ****************************************************************************************
 * @brief Handles the control point indication message      *//**
 *
 * @param[in] msgid     HOGPD_CTNL_PT_IND
 * @param[in] param     Pointer to the struct hogpd_ctnl_pt_ind
 * @param[in] dest_id   TASK_APP
 * @param[in] src_id    TASK_HOGPD
 *
 * @return If the message was consumed or not.
 * @description
 * This handler will be called each time the host enables or disables sending of notifications 
 * for characteristic.
 ****************************************************************************************
 */
int app_hogpd_ctnl_pt_ind_handler(ke_msg_id_t const msgid,
                                  struct hogpd_ctnl_pt_ind *param,
                                  ke_task_id_t const dest_id,
                                  ke_task_id_t const src_id)
{
    QPRINTF("HOGPD receive instance(%d) control point %d.\r\n", param->hids_nb, param->hid_ctnl_pt);
    return (KE_MSG_CONSUMED);
}
开发者ID:haby77,项目名称:BLE-passthrough,代码行数:23,代码来源:app_hogpd_task.c



注:本文中的QPRINTF函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ QPainterPath函数代码示例发布时间:2022-05-30
下一篇:
C++ QPID_LOG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap