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

Device information service issue

Why does the value of characteristic Firmware Revision, Model Number and Serial Number all have the same value?

Did update value for characteristic <CBCharacteristic: 0x282b1f9c0, UUID = Model Number String, properties = 0x2, value = {length = 19, bytes = 0xffffffffffffffffffffffff48a51234cfa3c8}, notifying = YES>, new value: 19 bytes, error: nil

Did update value for characteristic <CBCharacteristic: 0x282b1fa20, UUID = Serial Number String, properties = 0x2, value = {length = 11, bytes = 0xffffffff48a51234cfa3c8}, notifying = YES>, new value: 11 bytes, error: nil

Did update value for characteristic <CBCharacteristic: 0x282b1fa80, UUID = Firmware Revision String, properties = 0x2, value = {length = 15, bytes = 0xffffffffffffffff48a51234cfa3c8}, notifying = YES>, new value: 15 bytes, error: nil

What am I doing wrong?

And decoding the UTF-8 string does not give me the same string as I get in nRFConnect? In nRFConnect I do get the right ASCII string values.

 

  • Hi,

    As previously stated we do not share code for the nRF Connect apps.

    What we can do, however, is have a look at the relevant parts of your code, and provide ways to resolve the issues.

    If you do not want to share any code in this public ticket then we can make it private before we continue, or you can create a new, private, ticket.

    Regards,
    Terje

  • Hi,

    Our iOS developers had a look at the code that you provided privately, and they suggest that maybe you are using a call to readValue(for:) slightly wrong. It will not read the value immediately, as it is an asynchronous call. Rather, you have to wait for the callback of peripheral(_:didUpdateValueFor:error:). So if after the readValue(for:) call you try to read out values immediately, the values that you read out would be expected to be garbage.

    It is difficult for us to say if this is indeed the case, though, as it depends on how your code snippets are used, and whether or not there are other relevant pieces of code that we have not received.

    Regards,
    Terje

Related