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

Custom service Characteristic write wrong handle on Samsung

Hi

We have problems with Samsung tablets and phones at the moment.

We have an application with two custom services, Secure DFU Service and some standard SIG services, i.e. Battery Service and Device information Service. We are using nRF52832 with SDK14.

The problem is with custom services. We are not able to write values to a custom service characteristics. When I debug, the write event seems to reach the event handler for the custom service, but the event seems to contain the wrong handle (evt.gatts_evt.params.write.handle). The handle seems to be for the CCCD in another characteristics in the same service, instead of the value handle. Data (characteristic value) and everything else seems to be correct.

There is no problem with the SIG services, i.e. we can upload new firmware with Secure DFU.

This is only a problem with some Samsung tablets and -phones we have tested. With Apple ipad, there is no problem.

We are using nRF Connect for testing.

Is this a known problem, and if so, is there a way around?

Regards, Jan

Parents
  • Hi Jan,

    It's a very important information you provided: you remove and add Secure DFU service into the att table when you switch between debug and release version. It maybe not a very good idea for testing. Changing attribute table requires the application to send service changed indication. This can cause funny behaviour as you observed. You can see the Samsung phone (which do bonding) try to write to a handle 20 which is 7 from handle 13, most likely because of the missing "secure DFU service".

    My suggestion is to test with nRFConnect app on the phone, because we do a att table clear everytime you disconnect. Please try not to change the attribute table. Make sure you clear bonding on both the phone and the device before testing.

    If the application requires att table to be changed often, you may consider sending sd_ble_gatts_service_changed() to request the peer to re-do service discovery .

Reply
  • Hi Jan,

    It's a very important information you provided: you remove and add Secure DFU service into the att table when you switch between debug and release version. It maybe not a very good idea for testing. Changing attribute table requires the application to send service changed indication. This can cause funny behaviour as you observed. You can see the Samsung phone (which do bonding) try to write to a handle 20 which is 7 from handle 13, most likely because of the missing "secure DFU service".

    My suggestion is to test with nRFConnect app on the phone, because we do a att table clear everytime you disconnect. Please try not to change the attribute table. Make sure you clear bonding on both the phone and the device before testing.

    If the application requires att table to be changed often, you may consider sending sd_ble_gatts_service_changed() to request the peer to re-do service discovery .

Children
No Data
Related