/* Function for handling advertising events. 
This function will be called for advertising events which are passed to the application. */
static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
/* Function for handling advertising events. 
This function will be called for advertising events which are passed to the application. */
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();
            break;
        default:
            break;
    }
}