This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2650STK: Peripheral_Observer: characteristic value not expected.

Part Number: CC2650STK
Other Parts Discussed in Thread: CC2650

Hi everyone.

I don't know if it is the right place to post this issue, but I haven't find other better place to post it.

However, I make run Simple_Peripheral_Observer_CC2650_lp on my cc2650STK, and I modify it, like this, to storage beacon's MAC address :

The code works fine, but the characteristc value isn't  what is expected.

The address printed on serial data, is different from the one sent to the smartphone:

The Mac on putty:

The mac on smartphone:

The data looks cut, but i can't understand how i can resolve it.

Thanks a lot to everyone.

  • Hi Walter,

    It is possible that the BT cache on your phone stale. You may want to force clear it. Here is a relevant entry in the FAQ thread:

    Q: When switching sample applications on my board or LaunchPad, my iOS or Android device is not able to "see" new Characteristics or Services

    A: This condition occurs since the smart device caches GATT attribute handles in order to speed up the re-connection process. For example, when reprogramming the device with Project Zero after it was previously running SimplePeripheral will show the "old" Simple GATT Profile characteristics in a BLE app such as Light Blue or BLE Scanner. To force the phone to re-discover the attributes the phone's BT GATT cache must be cleared.  If the device was previously paired/bonded, tap the device name in the Bluetooth settings menu and select Forget this Device or Unpair depending on your phone OS version. Next, complete the following procedure based on iOS or Android:
    In iOS 10 and earlier, toggle Aeroplane mode ON then OFF in the Settings or Control Center menu (this also switches the Bluetooth radio off then on). For iOS 11 and later, you must toggle Bluetooth OFF then ON from the Settings > Bluetooth menu due to changes on how the Bluetooth radio is manged in these iOS versions
    On Android, the procedure can vary by make and model, but most recent versions can choose Settings > Apps > Scroll over to All > Choose Bluetooth Share and tap on Clear Cache. Just as with iOS, un-pair the device if it was previously bonded.

    -Sy Su

  • Hi Sy Su, many thanks for your reply.

    I follow your suggest, I cleaned caches, but the problem has not been resolved.

    I've tried to use an other android phone, but BLE scanner show me the same characteristic as previus immage I've posted in last post.

    So, I've tried to use an other beacon, the resoult is the same:

    I've Modified the code, to show me the Mac address that I insert in the Characteristic (I've only added this string, the code is the same as i posted in the image on the other post)

    and this shows me:

    So, The Mac that I pass in the characterist by Set_Parameter function, is correct, but the error must be in the code, but i cant's see where!

    Can you help me, please? Thanks!

  • Hi Walter,

    Apologies, I misread your issue.

    What is your MYSERVICE_MAC_LEN set to? You will want this to be 6 (bytes) to accommodate for the size of the mac address.

    -Sy Su

  • Hi Sy su, many thanks for your reply.

    MYSERVICE_MAC_LEN is set to 6 byte, I've used the tool found in Ble Custom Services to give source code.

    However those are parts on my code when I used this profile.

    myService.h:

    myService.c

    and the application:

    I've changed the code from the last post, I move the SetParameter function, but the problem is the same.

    On putty the Mac passed in the characteristic value (MACVal) is correct, on my phone, instead, not.

    Many thanks to everyone!

  • Hi Sy Su. Thanks for your help.
    Finally I managed to resolve the issue.
    The problem was Util_converAddr2Str function. Many thanks for your help!