How is data packed in (CYBLE_GATTC_READ_BY_TYPE_RSP_PARAM_T) attrData.attrValue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I start discovering my characteristics with CyBle_GattcDiscoverAllCharacteristics()  and get to the CYBLE_EVT_GATTC_READ_BY_TYPE_RSP event.

charReport = (CYBLE_GATTC_READ_BY_TYPE_RSP_PARAM_T *) EventParam;

charHandle =  charReport->attrData.attrValue[3] | (charReport->attrData.attrValue[4] << 8);

from code examples I can deduce the handle is in:

charReport->attrData.attrValue[3] | (charReport->attrData.attrValue[4]

and the UUID follows in charReport->attrData.attrValue[5] onwards, but is there any documentation on how the data is packed?

0 Likes
1 Solution
Anonymous
Not applicable

Hi Shane,

In the BLE_eventHandler.c  generated file for PSoC4 BLE, you can see there is a function(CyBle_ReadByTypeEventHandler) to decode the CYBLE_EVT_GATTC_READ_BY_TYPE_RSP event.

You can refer to this function implementation to get details on decoding the packet.

The packet received includes the CharHandle(2 bytes), properties(1 byte), Valuehandle(2bytes) and UUID(128 bit or 16 bit).

Thanks,

Ranjith

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

Hi Shane,

In the BLE_eventHandler.c  generated file for PSoC4 BLE, you can see there is a function(CyBle_ReadByTypeEventHandler) to decode the CYBLE_EVT_GATTC_READ_BY_TYPE_RSP event.

You can refer to this function implementation to get details on decoding the packet.

The packet received includes the CharHandle(2 bytes), properties(1 byte), Valuehandle(2bytes) and UUID(128 bit or 16 bit).

Thanks,

Ranjith

0 Likes