Beispiel #1
0
void advertising_start(void)
{
    uint32_t err_code;

    err_code = ble_advertising_start(BLE_ADV_MODE_SLOW);
    APP_ERROR_CHECK(err_code);
}
Beispiel #2
0
/**@brief Function for handling the Application's BLE Stack events.
 *
 * @param[in]   p_ble_evt   Bluetooth stack event.
 */
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t err_code;

    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
						
						debug_printf("Connected :)\r\n");
            m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
            app_beacon_stop();
            app_timer_start(m_temperature_timer_id, TEMPERATURE_MEAS_INTERVAL, NULL);
						app_timer_start(m_door_timer_id, DOOR_MEAS_INTERVAL, NULL);
            break;

        case BLE_GAP_EVT_DISCONNECTED:

						app_beacon_start();
            // when not using the timeslot implementation, it is necessary to initialize the advertizing data again.
            advertising_init();
            err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
            APP_ERROR_CHECK(err_code);
						app_timer_stop(m_temperature_timer_id);
						app_timer_stop(m_door_timer_id);
						debug_printf("Disconnected, Advertising peripheral again \r\n");            
            
            break;

        default:
            // No implementation needed.
            break;
    }
}
uint32_t ble_advertising_restart_without_whitelist(void)
{
    uint32_t err_code;

    if(     m_adv_modes_config.ble_adv_whitelist_enabled == BLE_ADV_WHITELIST_ENABLED
        && !m_whitelist_temporarily_disabled)
    {
        if (m_adv_mode_current != BLE_ADV_MODE_IDLE)
        {
            err_code = sd_ble_gap_adv_stop();
            if(err_code != NRF_SUCCESS)
            {
                return err_code;
            }
        }
        m_whitelist_temporarily_disabled = true;

        err_code = ble_advertising_start(m_adv_mode_current);
        if ((err_code != NRF_SUCCESS) && (m_error_handler != NULL))
        {
            m_error_handler(err_code);
        }
    }
    return NRF_SUCCESS;
}
Beispiel #4
0
/**@brief Application main function.
 */
int main(void)
{	
    uint32_t err_code;
    bool erase_bonds;
    uint8_t  start_string[] = START_STRING;
	
    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
    uart_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    gap_params_init();
    services_init();
    advertising_init();
    conn_params_init();
    
    printf("%s",start_string);
	
    UnityMain(0, NULL, RunAllTests);

    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
}
Beispiel #5
0
int main(void){

	softdevice_init();
	gap_params_init();

    _led.set_led_value = led_set_cb;
    ble_led_init(&_led);
    led_init();
    
	advertising_init();
	// start fast advertisement
	ble_advertising_start(BLE_ADV_MODE_FAST);


	
	do{
		// set to 1 led gpio (bit 12 corresponding to pin 12)
	//	NRF_GPIO->OUTSET = (1UL << GREEN_LED_PIN);
		// wait 300ms
		nrf_delay_ms(300);
		// set to 0 led gpio (bit 12 corresponding to pin 12)
	//	NRF_GPIO->OUTCLR = (1UL << GREEN_LED_PIN);
		// wait 300ms
		nrf_delay_ms(300);
	}while(1); //infinite loop

    return 0;
}
Beispiel #6
0
int main(void){

	softdevice_init();
	gap_params_init();
	advertising_init();
	// start fast advertisement
	ble_advertising_start(BLE_ADV_MODE_FAST);

	// setup led gpio in output mode
	NRF_GPIO->PIN_CNF[GREEN_LED_PIN] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
                                            | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
                                            | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
                                            | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
                                            | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);

	do{
		// set to 1 led gpio (bit 12 corresponding to pin 12)
		NRF_GPIO->OUTSET = (1UL << GREEN_LED_PIN);
		// wait 300ms
		nrf_delay_ms(300);
		// set to 0 led gpio (bit 12 corresponding to pin 12)
		NRF_GPIO->OUTCLR = (1UL << GREEN_LED_PIN);
		// wait 300ms
		nrf_delay_ms(300);
	}while(1); //infinite loop

    return 0;
}
Beispiel #7
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;

#ifdef ENABLE_DEBUG_LOG_SUPPORT
    app_trace_init();
#endif

    APPL_LOG("START\r\n");

    // Initialize.
    timers_init();
    buttons_leds_init(&erase_bonds);
    adc_config();
    ble_stack_init();
    device_manager_init(erase_bonds);
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();

    // Start execution.
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    APPL_LOG("start advertising : %u\n", err_code);

    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
}
Beispiel #8
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    bool     erase_bonds;

    // Initialize
    timers_init();
    nrf_log_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    device_manager_init(erase_bonds);
    db_discovery_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();

    // Start execution
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    NRF_LOG("\r\nCTS Start!\r\n");
    
    // Enter main loop
    for (;;)
    {
        app_sched_execute();
        power_manage();
    }
}
Beispiel #9
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;

    // Initialize.
    timers_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    device_manager_init(erase_bonds);
    gap_params_init();
    advertising_init();
    services_init();
    sensor_simulator_init();
    conn_params_init();

    ble_evt_pool      = osPoolCreate(osPool(ble_evt_pool));
    ble_stack_msg_box = osMessageCreate(osMessageQ(ble_stack_msg_box), NULL);

    // Start execution.
    ble_stack_thread_id = osThreadCreate(osThread(ble_stack_thread), NULL);
    UNUSED_VARIABLE(ble_stack_thread_id);
    application_timers_start();
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    // Enter main loop.
    for (;; )
    {
        UNUSED_VARIABLE(osDelay(1000));
    }
}
Beispiel #10
0
/**@brief Application main function.
 */
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;

    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
    uart_init();
    
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    gap_params_init();
    services_init();
    advertising_init();
    conn_params_init();

    printf("\r\nUART Start!\r\n");
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    
    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
}
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;

    app_trace_init();
    // Initialize.
    timers_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    device_manager_init(erase_bonds);
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();

    // Start execution.
    application_timers_start();
    APPL_LOG("Start Advertising \r\n");
    printf("Dhavaltest\r\n");
    SEGGER_RTT_WriteString(0, "SEGGER Real-Time-Terminal Sample\r\n");
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
}
Beispiel #12
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    
    // Initialize
    timers_init();
    ble_stack_init();
    bsp_module_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();
    sec_params_init();

    // Start execution
    timers_start();
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    // Enter main loop
    for (;;)
    {
        app_sched_execute();
        power_manage();
    }
}
void ble_advertising_on_sys_evt(uint32_t sys_evt)
{
    uint32_t err_code = NRF_SUCCESS;
    switch (sys_evt)
    {

        case NRF_EVT_FLASH_OPERATION_SUCCESS:
        // Fall through.

        //When a flash operation finishes, advertising no longer needs to be pending.
        case NRF_EVT_FLASH_OPERATION_ERROR:
            if (m_advertising_start_pending)
            {
                m_advertising_start_pending = false;
                err_code = ble_advertising_start(m_adv_mode_current);
                if ((err_code != NRF_SUCCESS) && (m_error_handler != NULL))
                {
                    m_error_handler(err_code);
                }
            }
            break;

        default:
            // No implementation needed.
            break;
    }
}
Beispiel #14
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;

    // Initialize.
    app_trace_init();
    timers_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    device_manager_init(erase_bonds);
    gap_params_init();
    advertising_init();
    services_init();
    sensor_simulator_init();
    conn_params_init();

    // Start execution.
    application_timers_start();
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    // Enter main loop.
    for (;; )
    {
        power_manage();
    }
}
Beispiel #15
0
/**@brief Function for handling the Application's BLE Stack events.
 *
 * @param[in]   p_ble_evt   Bluetooth stack event.
 */
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t err_code;

    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);

            m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
            app_beacon_start();
            
            break;

        case BLE_GAP_EVT_DISCONNECTED:
            err_code = bsp_indication_set(BSP_INDICATE_IDLE);
            APP_ERROR_CHECK(err_code);

            app_beacon_stop();
        
            // when not using the timeslot implementation, it is necessary to initialize the advertizing data again.
            advertising_init();
            err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
            APP_ERROR_CHECK(err_code);
        
            break;

        default:
            // No implementation needed.
            break;
    }
}
/*JSON{
    "type" : "staticmethod",
    "class" : "Bluetooth",
    "name" : "init", 
    "generate" : "jswrap_nrf_bluetooth_init"
}*/
void jswrap_nrf_bluetooth_init(void)
{
    uint32_t err_code;
    bool erase_bonds;
    
    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    gap_params_init();
    services_init();
    advertising_init();
    conn_params_init();
    
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    
    ble_com = false;

    // Enter main loop.
    //for (;;)
    //{
        //power_manage();
    //}
}
Beispiel #17
0
/**@brief Function for application main entry.
 */
int main(void)
{
    bool     erase_bonds;
    uint32_t err_code;

    // Initialize.
    app_trace_init();
    timers_init();
    uart_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);
    printf("BLE ANCS\n");
    device_manager_init(erase_bonds);
    db_discovery_init();
    scheduler_init();
    gap_params_init();
    service_init();
    advertising_init();
    conn_params_init();

    // Start execution.
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    // Enter main loop.
    for (;;)
    {
        app_sched_execute();
        power_manage();
    }

}
Beispiel #18
0
/**@brief Function for application main entry.
 */
int main(void)
{
    uint32_t err_code;
    
    // Initialize
    timers_init();
    ble_stack_init();
    bsp_module_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();
    sec_params_init();
    
    adc_init();

    // Start execution
    timers_start();
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    // Enter main loop
    
    for (;;)
    {
        if(start_adc_sampling == true)
        {
            nrf_drv_saadc_sample_convert(0, &adc_value);
            ble_android_characteristic_update(&m_android, &adc_value);
            start_adc_sampling = false;
        }
        app_sched_execute();
//        power_manage();
    }
}
Beispiel #19
0
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;
   // uint8_t  start_string[] = START_STRING;
	  //const ble_gap_addr_t  t_addr={0,{0xaa,0x55,0x33,0x44,0x55,0x66}};
//    const char  temp_str[]={0xaa,0x5c,0x00,0x02,0x00,0x00,0xa1,0x55};
    // Initialize.
    //bsp_configuration();
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);    
    buttons_leds_init(&erase_bonds);
#if ENABLE_COS
    simple_uart_init(UART_POWEROFF_BT_DELAY);
#else 
    uart_init_lowPower();
#endif

		etSpim1NorFlashInit();
#if DEBUG_UART_EN    
   //DbgPrintf("\r\n===flash_init===\r\n");
#endif
    ble_stack_init();
    
#ifdef BLE_DFU_APP_SUPPORT 
    device_manager_init(erase_bonds);
#endif
    
    //BT_set_address((UINT8 *)DEVICE_MAC_ADDR);
    BT_set_address();
    gap_params_init();   
    advertising_init();    
    services_init();
    //advertising_init();
    conn_params_init();  
#if ENABLE_COS   
    SetToGetKEYID();
#endif
    dev_init();		
	  
    //err_code = ble_advertising_start(BLE_ADV_MODE_SLOW);
#if DEBUG_UART_EN    
//    DbgPrintf("go to advertising7\r\n");
#endif     
	 err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
   APP_ERROR_CHECK(err_code);
    
    // Enter main loop.
    for (;;)
    {
		  main_loop();		  
		  power_manage();
		  #if TAP_DOUBLE_CLCIK_ENABLE
		  	test_display_step_num(test_click_count);
		  #endif
    }
}
Beispiel #20
0
void BLEstartAdvertising()
{
    if((!isConnected) && (!isAdvertising))  {
        uint32_t err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
        if(err_code == NRF_SUCCESS)  {
            debug_log("ADV: advertising started\r\n");
            isAdvertising = true;
            return;
        }
        BLE_ERROR_CHECK(err_code);
    }
}
/**@brief Function for starting advertising.
 */
static void advertising_start(bool erase_bonds)
{
    if (erase_bonds == true)
    {
        delete_bonds();
        // Advertising is started by PM_EVT_PEERS_DELETED_SUCEEDED event
    }
    else
    {
        ret_code_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);

        APP_ERROR_CHECK(err_code);
    }
}
void ble_peripheral_mode_init(void) { 
    uint32_t err_code;
	
    ble_stack_init();
    device_manager_init();
    gap_params_init();
    services_init();
    advertising_init();
    conn_params_init();

    // Start execution.
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
}
Beispiel #23
0
static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{
	// Catch BLE events here
    switch (p_ble_evt->header.evt_id)
    {            
        case BLE_GAP_EVT_DISCONNECTED:
            // Manually restart advertisement when a disconnection occured
            ble_advertising_start(BLE_ADV_MODE_FAST);
            break;
        default:
            break;
    }

    ble_led_on_ble_evt(&_led, p_ble_evt);
}
Beispiel #24
0
/**@brief Function for starting advertising.
 */
static void advertising_start(void)
{
    uint32_t err_code;

    //err_code = sd_ble_gap_adv_start(&m_adv_params);
		err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
		if (err_code == NRF_SUCCESS)	
			debug_printf("Advertisements started!!\r\n");
		else
		{
			debug_printf("Ooops.. Something went wrong with starting adverts..\r\n");
			APP_ERROR_CHECK(err_code);
		}

}
Beispiel #25
0
int main(void)
{
    ret_code_t err_code;
    bool       erase_bonds;

    err_code = NRF_LOG_INIT();
    APP_ERROR_CHECK(err_code);

    NRF_LOG_PRINTF("Relay Example\r\n");

    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, NULL);
    buttons_leds_init(&erase_bonds);

    if (erase_bonds == true)
    {
        NRF_LOG("Bonds erased!\r\n");
    }

    ble_stack_init();

    peer_manager_init(erase_bonds);

    db_discovery_init();
    hrs_c_init();
    rscs_c_init();

    gap_params_init();
    conn_params_init();
    services_init();
    advertising_init();

    /** Start scanning for peripherals and initiate connection to devices which
     *  advertise Heart Rate or Running speed and cadence UUIDs. */
    scan_start();

    // Turn on the LED to signal scanning.
    LEDS_ON(CENTRAL_SCANNING_LED);

    // Start advertising.
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    for (;;)
    {
        // Wait for BLE events.
        power_manage();
    }
}
Beispiel #26
0
/**@brief Function for handling advertising events.
 *
 * @details This function will be called for advertising events which are passed to the application.
 *
 * @param[in] ble_adv_evt  Advertising event.
 */
static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
    uint32_t err_code;

    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
            LEDS_ON(PERIPHERAL_ADVERTISING_LED);
            break;
        case BLE_ADV_EVT_IDLE:
            err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
            APP_ERROR_CHECK(err_code);
            break;
        default:
            break;
    }
}
Beispiel #27
0
static void on_advertising_event(ble_adv_evt_t ble_adv_evt)
{
    uint32_t err_code;
    
    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_IDLE:
            // 再度 slow でアドバタイジングを再開する。
            err_code = ble_advertising_start(BLE_ADV_MODE_SLOW);
            APP_ERROR_CHECK(err_code);
            break;
            
        case BLE_ADV_EVT_DIRECTED:
            NRF_LOG_PRINTF_DEBUG("\nBLE_ADV_EVT_DIRECTED.\n");
            break;
            
        case BLE_ADV_EVT_FAST:
            NRF_LOG_PRINTF_DEBUG("\nBLE_ADV_EVT_FAST.\n");
            break;
            
        case BLE_ADV_EVT_SLOW:
            NRF_LOG_PRINTF_DEBUG("\nBLE_ADV_EVT_SLOW.\n");
            break;
            
        case BLE_ADV_EVT_FAST_WHITELIST:
            NRF_LOG_PRINTF_DEBUG("\nBLE_ADV_EVT_FAST_WHITELIST.\n");
            break;
            
        case BLE_ADV_EVT_SLOW_WHITELIST:
            NRF_LOG_PRINTF_DEBUG("\nBLE_ADV_EVT_SLOW_WHITELIST.\n");
            break;
            
        case BLE_ADV_EVT_WHITELIST_REQUEST:
            NRF_LOG_PRINTF_DEBUG("\nBLE_ADV_EVT_WHITELIST_REQUEST.\n");
            break;
            
            // Direct接続を使わないので、これを処理する必要はない。
        case BLE_ADV_EVT_PEER_ADDR_REQUEST:
            NRF_LOG_PRINTF_DEBUG("\nBLE_ADV_EVT_PEER_ADDR_REQUEST.\n");
            break;
            
        default:
            break;
    }
}
Beispiel #28
0
/**@brief Function for handling advertising events.
 *
 * @details This function will be called for advertising events which are passed to the application.
 *
 * @param[in] ble_adv_evt  Advertising event.
 */
static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
//    uint32_t err_code;

    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
						debug_printf("Entering fast adverts... \r\n");
            break;
        case BLE_ADV_EVT_IDLE:
						debug_printf("Entering Idle mode. \r\n");
						ble_advertising_start(BLE_ADV_MODE_FAST);//endless advertising
            //sleep_mode_enter();
            break;
        default:
            break;
    }
}
Beispiel #29
0
/**@brief Function for handling advertising events.
 *
 * @param[in] ble_adv_evt  Advertising event.
 */
static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
            LEDS_ON(PERIPHERAL_ADVERTISING_LED);
            break;

        case BLE_ADV_EVT_IDLE:
        {
            ret_code_t err_code;
            err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
            APP_ERROR_CHECK(err_code);
        } break;

        default:
            // No implementation needed.
            break;
    }
}
Beispiel #30
0
/**@brief Function for handling advertising events.
 *
 * @details This function will be called for advertising events which are passed to the application.
 *
 * @param[in] ble_adv_evt  Advertising event.
 */
static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
    uint32_t err_code;
    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
            //err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
            //APP_ERROR_CHECK(err_code);
            break;
        case BLE_ADV_EVT_IDLE:
         //sleep_mode_enter();//kevin delete
#if DEBUG_UART_EN    
    //DbgPrintf("go to advertising8\r\n");
#endif         
				err_code = ble_advertising_start(BLE_ADV_MODE_SLOW);//KEVIN 
        APP_ERROR_CHECK(err_code);
            break;
        default:
            break;
    }
}