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

Read value by UUID fails: sd_ble_gattc_char_value_by_uuid_read() does not work

I created a service with several characteristic values. I can read the values without any problem with the Master Control Panel on my Android tablet, but reading from the Central with API call sd_ble_gattc_char_value_by_uuid_read() does not work.

My configuration:

  • 2x nRF51-DK (running Peripheral and Central application)
  • S110 SoftDevice v7.1.0
  • S120 SoftDevice v1.0.1

I used a CC2540 USB dongle from TI to do some sniffing on the Bluetooth communication:

image description

The forum seems to resize the screenshot, please check the following attachment for a larger version: BT_READ_BY_UUID_ERROR_SNIFFING_LOG.png

This log shows that the read request is sent with the correct UUID (the first Byte on the UUID packet is the rightmost byte in common UUID representation - I also used the same #define when registering the base UUID with the SoftDevice.

As you can see, the reply is an error code INVALID_HANDLE(0x01) from the Peripheral.

A characteristic value with this UUID definitely exists in the Peripheral, as you can see in the following screenshot from Master Control Panel (on the Peripheral, exactly the same software is used):

image description

Does anybody know what went wrong? How is the Read by UUID function used correctly?

Parents
  • Ooookay, this is really a very stupid bug:

    I specified a handle range from 0x0000 tu 0xffff.

    If I set the handle range from 0x0001 to 0xffff, everything seems to work fine.

    Now I have a new problem: This function cannot read values larger than 19 bytes (which seems to be related to the GATT_MTU size). Well, it appears I'll have to use other functions no matter what...

  • Hi puz,

    I have a question for y ou where can you change that values?

    I have a similar issue the Central is asking to the Peripheral for a handle outside the my GATT server table. Last handle available for my GATT server is 0x10, the Central is asking for 0x11(it does not exist) The TI sniffer show the same error INVALID_HANDLE(0x01)

Reply Children
No Data
Related