This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

On read authorize event, how to determine characteristic being read?

FormerMember
FormerMember

Recently I needed to add some functionality, so the software could monitor when there was a ble gatt read characteristic event.

In the addCharacteristic code I simply set the read authorization setting.

attr_md.rd_auth = 1;

On a ble event, on detecting the BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event, the code did what it needed to do and then called the sd_ble_gatts_rw_authorize_reply function.

All good so so far.

In the ble_evt data structure, I was able to determine the request type, READ/WRITE etc...

p_ble_evt->evt.gatts_evt.params.authorize_request.type

The next step, is I'd like to determine which characteristic is being read. I'm sure this is just a case of pulling a value out of a data structure, within the ble_evt structure or substructure and comparing it to the characteristic handle or name.

Related