/**@brief Function for setting up GATTC notifications from the Notification Provider. * * @details This function is called when a successful connection has been established. */ static void apple_notification_setup(void) { uint32_t err_code; nrf_delay_ms(100); // Delay because we cannot add a CCCD to close to starting encryption. iOS specific. err_code = ble_ancs_c_notif_source_notif_enable(&m_ancs_c); APP_ERROR_CHECK(err_code); err_code = ble_ancs_c_data_source_notif_enable(&m_ancs_c); APP_ERROR_CHECK(err_code); LOG("Notifications Enabled.\n\r"); }
/**@brief Function for setting up GATTC notifications from the Notification Provider. * * @details This function is called when a successful connection has been established. */ static void apple_notification_setup(void) { uint32_t err_code; nrf_delay_ms(100); err_code = ble_ancs_c_notif_source_notif_enable(&m_ancs_c); APP_ERROR_CHECK(err_code); err_code = ble_ancs_c_data_source_notif_enable(&m_ancs_c); APP_ERROR_CHECK(err_code); NRF_LOG("Notifications Enabled.\r\n"); }
static QState Ble_ancs_enabled(Ble* const me) { uint32_t err_code; switch(Q_SIG(me)) { case Q_ENTRY_SIG: err_code = ble_ancs_c_notif_source_notif_enable(&m_ancs_c); Q_ALLEGE(err_code == NRF_SUCCESS); #if 0 err_code = ble_ancs_c_data_source_notif_enable(&m_ancs_c); Q_ALLEGE(err_code == NRF_SUCCESS); #endif return Q_HANDLED(); default: return Q_SUPER(&QHsm_top); } }