void ble_sc_ctrlpt_on_ble_evt(ble_sc_ctrlpt_t * p_sc_ctrlpt, ble_evt_t const * p_ble_evt) { if (p_sc_ctrlpt == NULL || p_ble_evt == NULL) { return; } switch (p_ble_evt->header.evt_id) { case BLE_GAP_EVT_CONNECTED: on_connect(p_sc_ctrlpt, p_ble_evt); break; case BLE_GAP_EVT_DISCONNECTED: on_disconnect(p_sc_ctrlpt, p_ble_evt); break; case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: on_rw_authorize_request(p_sc_ctrlpt, &p_ble_evt->evt.gatts_evt); break; case BLE_GATTS_EVT_HVC: on_sc_hvc_confirm(p_sc_ctrlpt, p_ble_evt); break; case BLE_GATTS_EVT_HVN_TX_COMPLETE: on_tx_complete(p_sc_ctrlpt); break; default: break; } }
void nrf_ble_cgms_on_ble_evt(nrf_ble_cgms_t * p_cgms, ble_evt_t * p_ble_evt) { switch (p_ble_evt->header.evt_id) { case BLE_GAP_EVT_CONNECTED: p_cgms->conn_handle = p_ble_evt->evt.gap_evt.conn_handle; p_cgms->cgms_com_state = STATE_NO_COMM; break; case BLE_GAP_EVT_DISCONNECTED: p_cgms->conn_handle = BLE_CONN_HANDLE_INVALID; break; case BLE_GATTS_EVT_WRITE: on_write(p_cgms, p_ble_evt); break; case BLE_EVT_TX_COMPLETE: on_tx_complete(p_cgms, p_ble_evt); break; case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: on_rw_authorize_request(p_cgms, &p_ble_evt->evt.gatts_evt); break; case BLE_GATTS_EVT_HVC: on_hvc(p_cgms, p_ble_evt); break; default: // No implementation needed. break; } }