/* Function for handling the Application's BLE Stack events.  */
static void on_ble_evt(ble_evt_t *p_ble_evt)
/* Function for handling the Application's BLE Stack events.  */
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;
            break;
        case BLE_GAP_EVT_DISCONNECTED:
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            break;
        default:
            break;
    }
}