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

Can an event contain an invalid handle?

When checking if a read (or write) is authorized can the event contain an invalid handle (Does the handle need to be checked)?

case BLE_GATTS_AUTHORIZE_TYPE_READ:
{
    
ble_gatts_evt_read_t * p_evt_read = &p_ble_evt>evt.gatts_evt.params.authorize_request.request.read;


   
// is p_evt_read->handle always a valid handle?

if( authorized() )
{
reply.params.read.gatt_status = BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED;
}
else
{
reply.params.read.gatt_status = BLE_GATT_STATUS_SUCCESS;
}
}
Related