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

C++ ASSERT_ERR函数代码示例

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

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



在下文中一共展示了ASSERT_ERR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gattc_read_ind_handler

/**
 ****************************************************************************************
 * @brief Handles reception of the @ref GATTC_READ_IND message.
 * Generic event received after every simple read command sent to peer server.
 * @param[in] msgid Id of the message received (probably unused).
 * @param[in] param Pointer to the parameters of the message.
 * @param[in] dest_id ID of the receiving task instance (probably unused).
 * @param[in] src_id ID of the sending task instance.
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
static int gattc_read_ind_handler(ke_msg_id_t const msgid,
                                    struct gattc_read_ind const *param,
                                    ke_task_id_t const dest_id,
                                    ke_task_id_t const src_id)
{
    // Get the address of the environment
    struct anpc_env_tag *anpc_env = PRF_CLIENT_GET_ENV(dest_id, anpc);

    if (anpc_env != NULL)
    {
        ASSERT_ERR(anpc_env->operation != NULL);

        // Prepare the indication to send to the application
        struct anpc_value_ind *ind = KE_MSG_ALLOC(ANPC_VALUE_IND,
                                                  anpc_env->con_info.appid,
                                                  anpc_env->con_info.prf_id,
                                                  anpc_value_ind);

        ind->conhdl   = gapc_get_conhdl(anpc_env->con_info.conidx);

        switch (((struct anpc_cmd *)anpc_env->operation)->operation)
        {
            // Read Supported New Alert Category Characteristic value
            case (ANPC_ENABLE_RD_NEW_ALERT_OP_CODE):
            {
                ind->att_code = ANPC_RD_SUP_NEW_ALERT_CAT;
                ind->value.supp_cat.cat_id_mask_0 = param->value[0];
                // If cat_id_mask_1 not present, shall be considered as 0
                ind->value.supp_cat.cat_id_mask_1 = (param->length > 1)
                                                    ? param->value[1] : 0x00;
            } break;

            case (ANPC_ENABLE_RD_UNREAD_ALERT_OP_CODE):
            {
                ind->att_code = ANPC_RD_SUP_UNREAD_ALERT_CAT;
                ind->value.supp_cat.cat_id_mask_0 = param->value[0];
                // If cat_id_mask_1 not present, shall be considered as 0
                ind->value.supp_cat.cat_id_mask_1 = (param->length > 1)
                                                    ? param->value[1] : 0;
            } break;

            case (ANPC_READ_OP_CODE):
            {
                ind->att_code      = ((struct anpc_read_cmd *)anpc_env->operation)->read_code;
                ind->value.ntf_cfg = co_read16(&param->value[0]);
            } break;

            default:
            {
                ASSERT_ERR(0);
            } break;
        }

        // Send the indication
        ke_msg_send(ind);
    }
    // else ignore the message

    return (KE_MSG_CONSUMED);
}
开发者ID:FuangCao,项目名称:jwaoo-toy,代码行数:71,代码来源:anpc_task.c


示例2: gattc_disc_svc_ind_handler

/**
 ****************************************************************************************
 * @brief Handles reception of the @ref GATTC_DISC_SVC_IND message.
 * The handler stores the found service details for service discovery.
 * @param[in] msgid Id of the message received (probably unused).
 * @param[in] param Pointer to the parameters of the message.
 * @param[in] dest_id ID of the receiving task instance (probably unused).
 * @param[in] src_id ID of the sending task instance.
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
static int gattc_disc_svc_ind_handler(ke_msg_id_t const msgid,
                                      struct gattc_disc_svc_ind const *param,
                                      ke_task_id_t const dest_id,
                                      ke_task_id_t const src_id)
{
    // Get the address of the environment
    struct anpc_env_tag *anpc_env = PRF_CLIENT_GET_ENV(dest_id, anpc);

    if (anpc_env != NULL)
    {
        ASSERT_ERR(anpc_env->operation != NULL);
        ASSERT_ERR(((struct anpc_cmd *)anpc_env->operation)->operation == ANPC_ENABLE_OP_CODE);

        // Keep only one instance of the service
        if (anpc_env->nb_svc == 0)
        {
            // Keep the start handle and the end handle of the service
            anpc_env->ans.svc.shdl = param->start_hdl;
            anpc_env->ans.svc.ehdl = param->end_hdl;
            anpc_env->nb_svc++;
        }
    }

    return (KE_MSG_CONSUMED);
}
开发者ID:FuangCao,项目名称:jwaoo-toy,代码行数:36,代码来源:anpc_task.c


示例3: app_module_init_cmp_evt_handler

/**
 ****************************************************************************************
 * @brief Handles reception of the APP_MODULE_INIT_CMP_EVT messgage
 * @param[in] msgid     Id of the message received.
 * @param[in] param     Pointer to the parameters of the message.
 * @param[in] dest_id   ID of the receiving task instance
 * @param[in] src_id    ID of the sending task instance.
 *
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
int app_module_init_cmp_evt_handler(ke_msg_id_t const msgid,
                                           const struct app_module_init_cmp_evt *param,
                                           ke_task_id_t const dest_id,
                                           ke_task_id_t const src_id)
{
    if (ke_state_get(dest_id) == APP_DB_INIT)
    {
        if (param->status == CO_ERROR_NO_ERROR)
        {
            // Add next required service in the database
            if (app_db_init())
            {
                // No more service to add in the database, start application
                app_db_init_complete_func();
            }
        }
        else
        {
            // An error has occurred during database creation
            ASSERT_ERR(0);
        }
    }
    else
    {
        // APP_DB_INIT state is used to wait the APP_MODULE_INIT_CMP_EVT message
        ASSERT_ERR(0);
    }
    
    return (KE_MSG_CONSUMED);
}
开发者ID:rav0,项目名称:DA14580_HeartMonitor,代码行数:41,代码来源:app_task.c


示例4: uart_write_ext_wkup_func

void uart_write_ext_wkup_func(uint8_t *bufptr, uint32_t size, void (*callback) (uint8_t))
{
    // Sanity check
    ASSERT_ERR(bufptr != NULL);
    ASSERT_ERR(size != 0);
    ASSERT_ERR(uart_env.tx.bufptr == NULL);
	
		GPIO_SetActive (EXT_WAKEUP_PORT, EXT_WAKEUP_PIN);
			
    // Prepare TX parameters
    uart_env.tx.size = size;
    uart_env.tx.bufptr = bufptr;
		uart_env.tx.callback = callback;

    /* start data transaction
     * first isr execution is done without interrupt generation to reduce
     * interrupt load
     */
    uart_thr_empty_isr();
    if (uart_env.tx.bufptr != NULL)
    {
			uart_thr_empty_setf(1);
    }
		GPIO_SetInactive (EXT_WAKEUP_PORT, EXT_WAKEUP_PIN);
}
开发者ID:spectrum70,项目名称:pan1740-firmware,代码行数:25,代码来源:uart_ext_wkup.c


示例5: ASSERT_ERR

//##ModelId=48DC5D4603A0
bool TiLib_OSD_Driver::Init()
{
// Init a big GraphicsDisplaySurface to draw.
    if (gfxMap.uwWidth != 0) {
    	return false;
    }
	//enable argb4444 surface to both Component & Composite out
	ASSERT_ERR( (GI_NO_ERROR == GraphicsSurfaceCreate( HAL_GRAPHICS_MODE_ARGB8888, SCREEN_WIDTH, SCREEN_HEIGHT, &gfxMap)));

    ASSERT_ERR( (GI_NO_ERROR == GraphicsDisplayDestRectSet( HAL_GRAPHICS_DISPLAY0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)));
    ASSERT_ERR( (GI_NO_ERROR == GraphicsDisplayDestRectSet( HAL_GRAPHICS_DISPLAY1, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)));

    ASSERT_ERR( (GI_NO_ERROR == GraphicsDisplaySurfaceSet( HAL_GRAPHICS_DISPLAY_ALL, &gfxMap, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)));

    GraphicsDisplaySurfaceEnableSet(HAL_GRAPHICS_DISPLAY0, TRUE);
    GraphicsDisplaySurfaceEnableSet(HAL_GRAPHICS_DISPLAY1, TRUE); 

    getSetOnScreenHandle(DO_SET, (PSURFACE) &gfxMap);    //set CURRENT_ONSCREEN to newSurf_FrontSurf
    //init a pattern in the buffer:
    
    ClearScreen();
	
    return true;
    
ERR_EXIT: 
    return false;
}
开发者ID:Jonathan2251,项目名称:ow,代码行数:28,代码来源:TiLib_OSD_Driver.cpp


示例6: gatt_disc_svc_by_uuid_evt_handler

/**
 ****************************************************************************************
 * @brief Handles reception of the @ref GATT_DISC_SVC_BY_UUID_CMP_EVT message.
 * @param[in] msgid Id of the message received.
 * @param[in] param Pointer to the parameters of the message.
 * @param[in] dest_id ID of the receiving task instance.
 * @param[in] src_id ID of the sending task instance.
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
static int gatt_disc_svc_by_uuid_evt_handler(ke_msg_id_t const msgid,
                                             struct gatt_disc_svc_by_uuid_cmp_evt const *param,
                                             ke_task_id_t const dest_id,
                                             ke_task_id_t const src_id)
{
    // Get the address of the environment
    struct cscpc_env_tag *cscpc_env = PRF_CLIENT_GET_ENV(dest_id, cscpc);

    // Check if the environment exists
    if (cscpc_env != NULL)
    {
        ASSERT_ERR(cscpc_env->operation != NULL);
        ASSERT_ERR(((struct cscpc_cmd *)cscpc_env->operation)->operation == CSCPC_ENABLE_OP_CODE);

        // Keep only one instance of the service
        if (cscpc_env->nb_svc == 0)
        {
            // Keep the start handle and the end handle of the service
            cscpc_env->cscs.svc.shdl = param->list[0].start_hdl;
            cscpc_env->cscs.svc.ehdl = param->list[0].end_hdl;
            cscpc_env->nb_svc++;
        }
    }
    // else drop the message

    return (KE_MSG_CONSUMED);
}
开发者ID:GurjeetSPannu,项目名称:WearWare-BTLE,代码行数:37,代码来源:cscpc_task.c


示例7: LoadFile

	bool LoadFile(const char * path, std::vector<byte> * pDataOut, LFK lfk /*= LFK_Binary*/)
	{
		ASSERT_ERR(path);
		ASSERT_ERR(pDataOut);

		FILE * pFile = nullptr;
		if (fopen_s(&pFile, path, (lfk == LFK_Text) ? "rt" : "rb") != 0)
		{
			WARN("Couldn't open file %s", path);
			return false;
		}
		ASSERT_ERR(pFile);

		// Determine file size
		fseek(pFile, 0, SEEK_END);
		size_t size = ftell(pFile);

		// Read the whole file into memory
		pDataOut->resize((lfk == LFK_Text) ? size+1 : size);
		rewind(pFile);
		size_t sizeRead = fread(&(*pDataOut)[0], sizeof(byte), size, pFile);

		// Size can be smaller for text files, due to newline conversion
		ASSERT_ERR(sizeRead == size || ((lfk == LFK_Text) && sizeRead <= size));
		fclose(pFile);

		// Automatically null-terminate text files so string functions can be used
		if (lfk == LFK_Text)
		{
			pDataOut->resize(sizeRead + 1);
			(*pDataOut)[sizeRead] = 0;
		}

		return true;
	}
开发者ID:Reedbeta,项目名称:reed-util,代码行数:35,代码来源:util-basics.cpp


示例8: gapm_cmp_evt_handler

/**
 ****************************************************************************************
 * @brief Handles GAP manager command complete events.
 *
 * @param[in] msgid     Id of the message received.
 * @param[in] param     Pointer to the parameters of the message.
 * @param[in] dest_id   ID of the receiving task instance (TASK_GAP).
 * @param[in] src_id    ID of the sending task instance.
 *
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
int gapm_cmp_evt_handler(ke_msg_id_t const msgid,
                                struct gapm_cmp_evt const *param,
                                ke_task_id_t const dest_id,
                                ke_task_id_t const src_id)
{
    switch(param->operation) {
    // reset completed
    case GAPM_RESET:
        if(param->status != GAP_ERR_NO_ERROR) {
            ASSERT_ERR(0); // unexpected error
        }
        else {
            // set device configuration
            struct gapm_set_dev_config_cmd* cmd = KE_MSG_ALLOC(GAPM_SET_DEV_CONFIG_CMD,
                    TASK_GAPM, TASK_APP, gapm_set_dev_config_cmd);

            app_configuration_func(dest_id, cmd);

            ke_msg_send(cmd);
        }
        break;
    // device configuration updated
    case GAPM_SET_DEV_CONFIG:
        if(param->status != GAP_ERR_NO_ERROR) {
            ASSERT_ERR(0); // unexpected error
        }
        else {
            app_set_dev_config_complete_func();
        }
        break;
    // Advertising finished
    case GAPM_ADV_UNDIRECT:
        app_adv_undirect_complete(param->status);
        break;
    // Directed advertising finished
    case GAPM_ADV_DIRECT:
        app_adv_direct_complete(param->status);  
        break;
    case GAPM_RESOLV_ADDR:
    case GAPM_ADD_DEV_IN_WLIST:
    case GAPM_RMV_DEV_FRM_WLIST:
#if (USE_CONNECTION_FSM)
        app_con_fsm_handle_cmp_evt(param);
#endif
        break;
    case GAPM_CANCEL:
        if(param->status != GAP_ERR_NO_ERROR) {
            ASSERT_ERR(0); // unexpected error
        }
        break;
    default:
        ASSERT_ERR(0); // unexpected error
        break;
    }

    return (KE_MSG_CONSUMED);
}
开发者ID:GumpYangchh,项目名称:DA14582-Remote-Audio,代码行数:69,代码来源:app_task.c


示例9: gatt_write_char_rsp_handler

/**
 ****************************************************************************************
 * @brief Handles reception of the @ref GATT_WRITE_CHAR_RESP message.
 * @param[in] msgid Id of the message received.
 * @param[in] param Pointer to the parameters of the message.
 * @param[in] dest_id ID of the receiving task instance.
 * @param[in] src_id ID of the sending task instance.
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
static int gatt_write_char_rsp_handler(ke_msg_id_t const msgid,
                                       struct gatt_write_char_resp const *param,
                                       ke_task_id_t const dest_id,
                                       ke_task_id_t const src_id)
{
    // Get the address of the environment
    struct cscpc_env_tag *cscpc_env = PRF_CLIENT_GET_ENV(dest_id, cscpc);

    if (cscpc_env != NULL)
    {
        ASSERT_ERR(cscpc_env->operation != NULL);

        // Retrieve the operation currently performed
        uint8_t operation = ((struct cscpc_cmd *)cscpc_env->operation)->operation;

        switch (operation)
        {
            case (CSCPC_CFG_NTF_IND_OP_CODE):
            {
                // Send the complete event status
                cscpc_send_cmp_evt(cscpc_env, operation, param->status);
            } break;

            case (CSCPC_CTNL_PT_CFG_WR_OP_CODE):
            {
                if (param->status == PRF_ERR_OK)
                {
                    // Start Timeout Procedure
                    ke_timer_set(CSCPC_TIMEOUT_TIMER_IND, dest_id, CSCPC_PROC_TIMEOUT_TIMER_VAL);

                    // Wait for the response indication
                    ((struct cscpc_cmd *)cscpc_env->operation)->operation = CSCPC_CTNL_PT_CFG_IND_OP_CODE;
                }
                else
                {
                    // Send the complete event status
                    cscpc_send_cmp_evt(cscpc_env, operation, param->status);
                }

            } break;

            default:
            {
                ASSERT_ERR(0);
            } break;
        }
    }
    // else ignore the message

    return (KE_MSG_CONSUMED);
}
开发者ID:GurjeetSPannu,项目名称:WearWare-BTLE,代码行数:61,代码来源:cscpc_task.c


示例10: usr_init

/**
 ****************************************************************************************
 * @brief   User initialize
 ****************************************************************************************
 */
void usr_init(void)
{
    if(KE_EVENT_OK != ke_evt_callback_set(EVENT_BUTTON1_PRESS_ID, 
                                            app_event_button1_press_handler))
    {
        ASSERT_ERR(0);
    }
		
		//register event callback for accelerometer interrupt
		if(KE_EVENT_OK != ke_evt_callback_set(EVENT_ACCEL_INT_ID, 
                                            app_event_accel_handler))
    {
        ASSERT_ERR(0);
    }
		
		//PROTOCOL
		//testing protocol
		char *data; 
		data = malloc(sizeof(char)*14);
		data[0] = 0x00;//PROTOCOL_COMMAND_ENABLE;
		data[1] = 0x00;//PROTOCOL_BATT;
		
		data[2] = 0x00;//PROTOCOL_COMMAND_ENABLE;
		data[3] = 0x00;//PROTOCOL_TEMP;
		
		data[4] = 0x00;//PROTOCOL_COMMAND_ENABLE;
		data[5] = 0x00;//PROTOCOL_PED;
		
		//data[4] = PROTOCOL_COMMAND_ENABLE;
		//data[5] = PROTOCOL_PED;
		
		//data[6] = 0x00;//PROTOCOL_COMMAND_ENABLE;
		//data[7] = 0x00;//PROTOCOL_DISTANCE;
		
		//for testing streaming ADC output set:
		data[6] = PROTOCOL_COMMAND_ENABLE;
		data[7] = PROTOCOL_ADC_SAMPLE;
		//data[6] = 0x00;//PROTOCOL_COMMAND_ENABLE;
		//data[7] = 0x00;//PROTOCOL_ADC_SAMPLE;
		
		data[8] = PROTOCOL_COMMAND_RATE;
		data[9] = 100;
		data[10] = 0x00;   //4 int
		data[11] = 0x00;
		data[12] = 0x04;
		
		data[13] = '\0';
		receive_packet(13, data);
		//print_list();
}
开发者ID:GurjeetSPannu,项目名称:WearWare-BTLE,代码行数:55,代码来源:usr_design.c


示例11: usr_init

/**
 ****************************************************************************************
 * @brief   User initialize
 ****************************************************************************************
 */
void usr_init(void)
{
    if(KE_EVENT_OK != ke_evt_callback_set(EVENT_BUTTON1_PRESS_ID, 
                                            app_event_button1_press_handler))
    {
        ASSERT_ERR(0);
    }
#if		(FB_JOYSTICKS)
		 if(KE_EVENT_OK != ke_evt_callback_set(EVENT_ADC_KEY_SAMPLE_CMP_ID,
                                           app_event_adc_key_sample_cmp_handler))
		{
				ASSERT_ERR(0);
		}
#endif
}
开发者ID:Wangwenxue,项目名称:Firefly-BLE,代码行数:20,代码来源:usr_design.c


示例12: app_db_init_func

/**
 ****************************************************************************************
 * @brief Initialise the database.
 *
 * @return If database initialization completed.
 ****************************************************************************************
 */
bool app_db_init_func(void)
{  
    // Indicate if more services need to be added in the database
    bool end_db_create = false;

    // Check if another should be added in the database
    if (app_env.next_prf_init < APP_PRF_LIST_STOP)
    {
        switch (app_env.next_prf_init)
        {
            default:
            {
                ASSERT_ERR(0);
            } break;
        }

        // Select following service to add
        app_env.next_prf_init++;
    }
    else
    {
        end_db_create = true;
    }

    return end_db_create;
}
开发者ID:Samwuzhitao,项目名称:My_DA14580_SPS,代码行数:33,代码来源:app_sps_host_project.c


示例13: uart_rec_error_isr

static void uart_rec_error_isr(void)
{
    void (*callback) (uint8_t) = NULL;
    // Reset RX parameters
    uart_env.rx.size = 0;
    uart_env.rx.bufptr = NULL;

    // Disable RX interrupt
    SetBits16(UART_IER_DLH_REG, ERBFI_dlh0, 0); // uart_rec_data_avail_setf(0);

    // Reset RX FIFO
    // uart_rxfifo_res_setf(1); @WIK commented

    // Retrieve callback pointer
    callback = uart_env.rx.callback;

    if(callback != NULL)
    {
        // Clear callback pointer
        uart_env.rx.callback = NULL;

        // Call handler
        callback(UART_STATUS_ERROR);
    }
    else
    {
        ASSERT_ERR(0);
    }
}
开发者ID:xiaomaozi121,项目名称:Portable_PM2.5_Software,代码行数:29,代码来源:uart.c


示例14: gapc_cmp_evt_handler

/**
 ****************************************************************************************
 * @brief Handles GAP controller command complete events.
 *
 * @param[in] msgid     Id of the message received.
 * @param[in] param     Pointer to the parameters of the message.
 * @param[in] dest_id   ID of the receiving task instance (TASK_GAP).
 * @param[in] src_id    ID of the sending task instance.
 *
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
int gapc_cmp_evt_handler(ke_msg_id_t const msgid,
                                struct gapc_cmp_evt const *param,
                                ke_task_id_t const dest_id,
                                ke_task_id_t const src_id)
{
    switch(param->operation) {
    // reset completed
    case GAPC_UPDATE_PARAMS:
        if (ke_state_get(dest_id) == APP_PARAM_UPD) {
            if ((param->status != CO_ERROR_NO_ERROR)) {
                // it's application specific what to do when the Param Upd request is rejected
                app_update_params_rejected_func(param->status);
            }
            else {
                // Go to Connected State
                ke_state_set(dest_id, APP_CONNECTED);

                // if state is APP_CONNECTED then the request was accepted
                app_update_params_complete_func();
            }
        }
        break;
    default:
        if(param->status != GAP_ERR_NO_ERROR) {
            ASSERT_ERR(0); // unexpected error
        }
        break;
    }

    return (KE_MSG_CONSUMED);
}
开发者ID:GumpYangchh,项目名称:DA14582-Remote-Audio,代码行数:43,代码来源:app_task.c


示例15: app_entry_point_handler

int app_entry_point_handler (ke_msg_id_t const msgid,
                                         void const *param,
                                         ke_task_id_t const dest_id,
                                         ke_task_id_t const src_id)
{
    int i=0;
    enum ke_msg_status_tag process_msg_handling_result;
    
    while (i<sizeof(app_process_handlers)/sizeof(process_event_func_t))
    {
        ASSERT_ERR(app_process_handlers[i]);
         if (app_process_handlers[i](msgid,param,dest_id,src_id, &process_msg_handling_result)==PR_EVENT_HANDLED)
               return (process_msg_handling_result);
         i++;
    }

    //user cannot do anything else than consume the message
    if (app_process_catch_rest_cb!=NULL)
    {
        app_process_catch_rest_cb(msgid,param,dest_id,src_id);
    }
    
    return (KE_MSG_CONSUMED);
    
};
开发者ID:FuangCao,项目名称:jwaoo-toy,代码行数:25,代码来源:app_entry_point.c


示例16: uart_sps_read

void uart_sps_read(uint8_t *bufptr, uint32_t size, uint8_t *state, void (*callback) (uint8_t, uint32_t))
{
    // Sanity check
    ASSERT_ERR(bufptr != NULL);
    ASSERT_ERR(size != 0);
    ASSERT_ERR(uart_sps_env.rx.bufptr == NULL);

    // Prepare RX parameters
    uart_sps_env.rx.size 		= size;
    uart_sps_env.rx.bufptr 		= bufptr;
	  uart_sps_env.rx.state 		= state;
	  uart_sps_env.rx.callback 	= callback; 
	
    // Start data transaction
    uart_rec_data_avail_setf(1); //=SetBits16(UART_IER_DLH_REG, ETBEI_dlh0, 1); 
}
开发者ID:Samwuzhitao,项目名称:My_BLE_Github,代码行数:16,代码来源:uart_sps.c


示例17: rwip_eif_get_func

const struct rwip_eif_api* rwip_eif_get_func(uint8_t type)
{
    const struct rwip_eif_api* ret = NULL;
    switch(type)
    {
        case RWIP_EIF_AHI:
        case RWIP_EIF_HCIC:
        {
#ifdef CFG_HCI_BOTH_EIF
            if (GPIO_GetPinStatus(HCI_EIF_SELECT_PORT,HCI_EIF_SELECT_PIN))
                ret = &uart_api;
            else
                ret = &spi_api;
#else
  #ifdef CFG_HCI_SPI
            ret = &spi_api;     // select spi api
  #else
            ret = &uart_api;    // select uart api
  #endif
#endif
        }
        break;
        default:
        {
            ASSERT_ERR(0);
        }
        break;
    }
    return ret;
}
开发者ID:Zhenw,项目名称:Talki_V1,代码行数:30,代码来源:arch_system.c


示例18: app_disconnect_func

void app_disconnect_func(ke_task_id_t task_id, struct gapc_disconnect_ind const *param)
{
    
    uint8_t state = ke_state_get(task_id);
    
#if BLE_BATT_SERVER
 app_batt_poll_stop();
#endif // BLE_BATT_SERVER
    
    if ((state == APP_SECURITY) || (state == APP_CONNECTED)  || (state == APP_PARAM_UPD))
    {
        
/**************************************************
            Handle disconnection event
***************************************************/    

        // Restart Advertising
			 //app_adv_start();	


    }
    else
    {
        // We are not in a Connected State
        ASSERT_ERR(0);
    }
      
}    
开发者ID:xiaomaozi121,项目名称:Portable_PM2.5_Software,代码行数:28,代码来源:app_xAPP_proj.c


示例19: uart_sps_rec_error_isr

static void uart_sps_rec_error_isr(void)
{
    void (*callback) (uint8_t, uint32_t) = NULL;
    // Reset RX parameters
    uart_sps_env.rx.size = 0;
    uart_sps_env.rx.bufptr = NULL;
    
    // Disable RX interrupt
    SetBits16(UART_IER_DLH_REG, ERBFI_dlh0, 0);
    
    // Retrieve callback pointer
    callback = uart_sps_env.rx.callback;

    if(callback != NULL)
    {
        // Clear callback pointer
        uart_sps_env.rx.callback = NULL;

        // Call handler
        callback(UART_STATUS_ERROR, NULL);
    }
    else
    {
        ASSERT_ERR(0);
    }
}
开发者ID:Samwuzhitao,项目名称:My_BLE_Github,代码行数:26,代码来源:uart_sps.c


示例20: gap_discon_cmp_evt_handler

/**
 ****************************************************************************************
 * @brief Disconnection indication to ANPC.
 * @param[in] msgid     Id of the message received.
 * @param[in] param     Pointer to the parameters of the message.
 * @param[in] dest_id   ID of the receiving task instance
 * @param[in] src_id    ID of the sending task instance.
 * @return If the message was consumed or not.
 ****************************************************************************************
 */
static int gap_discon_cmp_evt_handler(ke_msg_id_t const msgid,
                                      struct gap_discon_cmp_evt const *param,
                                      ke_task_id_t const dest_id,
                                      ke_task_id_t const src_id)
{
    // Get the address of the environment
    struct cscpc_env_tag *cscpc_env = PRF_CLIENT_GET_ENV(dest_id, cscpc);

    ASSERT_ERR(cscpc_env != NULL);

    // Free the stored operation if needed
    if (cscpc_env->operation != NULL)
    {
        // Check if we were waiting for a SC Control Point indication
        if (((struct cscpc_cmd *)cscpc_env->operation)->operation == CSCPC_CTNL_PT_CFG_IND_OP_CODE)
        {
            // Stop the procedure timeout timer
            ke_timer_clear(CSCPC_TIMEOUT_TIMER_IND, dest_id);
        }

        ke_msg_free(ke_param2msg(cscpc_env->operation));
        cscpc_env->operation = NULL;
    }

    PRF_CLIENT_DISABLE_IND_SEND(cscpc_envs, dest_id, CSCPC);

    return (KE_MSG_CONSUMED);
}
开发者ID:GurjeetSPannu,项目名称:WearWare-BTLE,代码行数:38,代码来源:cscpc_task.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ASSERT_ERRNO_AND_EXIT函数代码示例发布时间:2022-05-30
下一篇:
C++ ASSERT_EQUALS函数代码示例发布时间: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