/**@brief Function for handling events from the BSP module. * * @param[in] event Event generated by button press. */ static void bsp_event_handler(bsp_event_t event) { uint32_t err_code; switch (event) { case BSP_EVENT_SLEEP: sleep_mode_enter(); break; case BSP_EVENT_DISCONNECT: err_code = sd_ble_gap_disconnect(m_ancs_c.conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); if (err_code != NRF_ERROR_INVALID_STATE) { APP_ERROR_CHECK(err_code); } break; case BSP_EVENT_WHITELIST_OFF: err_code = ble_advertising_restart_without_whitelist(); if (err_code != NRF_ERROR_INVALID_STATE) { APP_ERROR_CHECK(err_code); } break; case BSP_EVENT_KEY_1: err_code = ble_ancs_c_request_attrs(&m_ancs_c, &m_notification_latest); APP_ERROR_CHECK(err_code); break; default: break; } }
/**@brief Function for handling events from the BSP module. * * @param[in] event Event generated by button press. */ static void bsp_event_handler(bsp_event_t event) { switch (event) { case BSP_EVENT_SLEEP: // sleep_mode break; case BSP_EVENT_DISCONNECT: break; case BSP_EVENT_WHITELIST_OFF: break; case BSP_EVENT_KEY_1: ble_ancs_c_request_attrs(&m_notification_latest); break; default: break; } }
// on fait un ping sur iOS pour eviter la deconnexion static void sec_ping(void * p_context) { uint32_t err_code; err_code = ble_ancs_c_request_attrs(p_context); APP_ERROR_CHECK(err_code); }