示例#1
0
文件: main.c 项目: mcanos/nRF51
/**@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");
}
示例#2
0
文件: ble.c 项目: henrychoi/realtime
/**@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");
}
示例#3
0
文件: ble.c 项目: henrychoi/realtime
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);
	}
}