This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

'p_context' undeclared compile error

Hi,

I am following the midi service example: https://www.novelbits.io/bluetooth-gatt-services-characteristics/

To add a midi service.

I have added the code and build it, but i am getting: 'p_context' undeclared compile error on this function:

void ble_midi_service_on_ble_evt(ble_midi_service_t* p_midi_service, ble_evt_t const * p_ble_evt)
{
/*ble_midi_service_t* */ p_midi_service = (ble_midi_service_t *) p_context;

NRF_LOG_INFO("BLE event received. Event type = %d\r\n", p_ble_evt->header.evt_id);

if (p_midi_service == NULL || p_ble_evt == NULL)
{
return;
}

switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_CONNECTED:
on_connect(p_midi_service, p_ble_evt);
break;

case BLE_GAP_EVT_DISCONNECTED:
on_disconnect(p_midi_service, p_ble_evt);
break;

case BLE_GATTS_EVT_WRITE:
on_write(p_midi_service, p_ble_evt);
break;

default:
// No implementation needed.
break;
}
}

can you please assist me with this?

Thanks,

Gil

Parents Reply Children
Related