Reding GATT Characterictic value.

Hi All,

I am using the samples/bluetooth/central_hr and samples/bluetooth/peripheral_hr examples form the zephyr tree for evaluating the GATT characteristic value reading. I am getting output like:

 

initialized
Scanning successfully started
[DEVICE]: HeartRateSensor, AD evt type 1, AD data len 11, RSSI -70
[AD]: 1 data_len 11
[UNSUBSCRIBED]
[SUBSCRIBED]
Connected: HeartRateSensor
[ATTRIBUTE] handle 15
[ATTRIBUTE] handle 16
[ATTRIBUTE] handle 18
Discover complete
[NOTIFICATION] data 0x20007df length 2
[NOTIFICATION] data 0x20007df length 2

I know this is the dummy heart rate values from the peripheral_hr.

I want to know if the [NOTIFICATION] data 0x20007fd length 2 is GATT characteristic value or not.

If now how do I print the characteristic value?

Thanks,

Gotak

  • Hi I actually use the central heart rate monitor example before posting this ticket,

    I am able to hear the GATT data from the peripheral hr example by giving the HRS UUID  to read the GATT characteristic value for the heart rate monitor.

    I wanted to use this example to read by customised gatt UUID characteristics, so I modified the GATT UUID as required and I am able to read some gatt value which is as told in the above reply

    3 bytes + Characteristic UUID

    And as you told they these prefixed 3 bytes are the characteristic value but when I verified it in the nRF mobile app the same characteristic value is like : (0x) 01 which is not equal to the 3 bytes I got in my nRF gatt reading code output...

  • I am not sure of all the code on the central (here) and peripheral (GATT server) so there may be something I am not aware of regardign what this data represetn, but in any case, the read callback holds the data. It might be easier to test with something like the NUS central and peripheral samples, where you clearly have just a data "channel".

Related