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 Hung

    I did in fact made an update that added a custom service with one characteristics.

    I verified the handle problem by first placing a breakpoint in the "onWrite" event handler (BLE_GATTS_EVT_WRITE) after the check of the handle ( if (p_evt_write->handle == p_nbs->commandHandle.value_handle) ) The code never hits the breakpoint when the error is present. The breakpoint is hit when using other devices than Samsung.

    If I move the breakpoint before this, the breakpoint is hit, but then the handler is wrong. It could of course be that the write to the CCCD handler is intended, but the value handler should be written anyway?

    The attribute table appears correct in nRF Connect.

    I have, as you recommended, tested with ble_app_uart, and this application behaves correct on Samsung.

    Anyway it is strange that I only see the problem with Samsung. Now I also have tested with an old Lenovo tablet, and also an old HANNspree tablet (both running Android). Both are working.

    It is maybe worth mentioning that both the Samsung tablets was connectd to the application before the service was added. I now suspect that there is some cached data in the two Samsungs that I can't get rid of (I have tried unbounding). Could this be true?

    Regards, Jan

Reply
  • Hi Hung

    I did in fact made an update that added a custom service with one characteristics.

    I verified the handle problem by first placing a breakpoint in the "onWrite" event handler (BLE_GATTS_EVT_WRITE) after the check of the handle ( if (p_evt_write->handle == p_nbs->commandHandle.value_handle) ) The code never hits the breakpoint when the error is present. The breakpoint is hit when using other devices than Samsung.

    If I move the breakpoint before this, the breakpoint is hit, but then the handler is wrong. It could of course be that the write to the CCCD handler is intended, but the value handler should be written anyway?

    The attribute table appears correct in nRF Connect.

    I have, as you recommended, tested with ble_app_uart, and this application behaves correct on Samsung.

    Anyway it is strange that I only see the problem with Samsung. Now I also have tested with an old Lenovo tablet, and also an old HANNspree tablet (both running Android). Both are working.

    It is maybe worth mentioning that both the Samsung tablets was connectd to the application before the service was added. I now suspect that there is some cached data in the two Samsungs that I can't get rid of (I have tried unbounding). Could this be true?

    Regards, Jan

Children
No Data
Related