I have several services on a nRF51 peripheral, and would like to have different initialization based on which service is being connected to. The related code is below:
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_CONNECTED:
......
break;
case BLE_GAP_EVT_DISCONNECTED:
......
break;
case ...
......
default:
break;
}
}
However, I don't know how to associate the BLE event with a specific active service. Please advise. Thanks.