Service changed Characteristic

Hi,

I am currently using the nRf52832 for ble development in our project. Currently we are facing issues with the service changed characteristic in between firmware upgrades. While the service changed behaves exactly as mentioned in the bluetooth specification when tested with an Ios device, We are having issues in doing the same on android devices. 

I found the below error/warning message when going through the wireshark logs. Could you tell me what could be causing the error message?

Thanks,

Asmaitha

Parents Reply Children
  • Hi Hieu,

    I will try to get the full log from our internal app team. 

    Upon receiving the service changed characteristic indication. When the service discovery is done, we do not get the newly exposed services from the server.  

  • Hi Asmaitha,

    Given the nature of Android, have you made this observation with multiple devices? Or only one specific model or models from a specific manufacturer?

  • Hi Hieu,

    Our product is aiming for the medical market, hece before we do a full fledge release, we will be doing multiple enclosed field trials and for these field trials, we have decided to go ahead with samsung phones Hence the app in question works only with samsung phones.

    Could you suggest what the "Invalid usage of this characteristic with this opcode" warning be a side effect of?

  • Hi Asmaitha,

    My initial thought when you said it works on iOS but not on Android is that it is more likely to be the Android device that is having trouble.
    Your confirmation that all the tests are done with one brand of phone further makes it more likely that the phone is doing something wrong.

    As we can see in the log, the opcode in question is regarding a read operation.

    If we check the Bluetooth Core Specification, we can then see that the Service Changed Characteristic is not meant to be read by the Client. It is only meant to indicate to the Client.

    From Bluetooth Core Specification 5.3, Vol 3, Part G, Section 7.1:

    This Characteristic Value shall be configured to be indicated using the Client Characteristic Configuration descriptor by a client. Indications caused by changes to the Service Changed Characteristic Value shall be considered lost if the client has erroneously not enabled indications in the Client Characteristic Configuration descriptor (see [Vol 3] Part F, Section 3.3.3).

    This makes sense, because only the Server knows when changes in the Server happen. If we leave it to the Client to poll the Server, then it might miss when a change happened, which could result in malfunctions, such as trying to read a characteristic that has been removed.

    This also checks out with my thought above, that the Client (the phones in your case) is doing something wrong.

    Is your Android application actively reading the Service Changed Characteristic?

    If not, could you please share the model of the devices, the software version on the device, and the sniffer trace?

  • Hi Hieu,

    That's it! It looks pretty obvious now that you mention it! I think you might have solved the problem. I have scheduled for a call with the app team to clarify about the "polling on read scenario". Will give my inputs after the call but I think this is the main issue. Thank you so much! This was very helpful!! Just give me a  day's time and I shall verify your reply as the answer. Once again thank you very much :D

Related