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

Does nrf toolbox (android) work on nrf52 related SD, e.g. S140?

Hello everybody!

Feel free to read this question for more background information:

devzone.nordicsemi.com/.../

I'll give everyone reading this a quick bulletin run down as to what happened to save time:

  • Migrating from nrf51 S110 to nrf52 S120
  • ble_hvx() function on my nrf52840 returns "0x00000008" "INVALID STATE" error.
  • Most likely the cccd handle wasn't set by my android app
  • But it worked flawlessly back in nrf51 S110
  • User Endnode here told me that it's very likely that the old android API function (not to be mistaken with the nrf51 MCU function I mentioned above, the successful establishment of the communication between android device and MCU requires many functions on both sides) setcharacteristicnotification, which use "WRITE" method on the GATT instead of "REQUEST" method, fails to trigger the proper set cccd handle operation, and is likely ignored altogether by the latest S140 SD.

So, I went on trying to find the relevant function, but couldn't. I'm here thinking, shouldn't nrf toolbox be working with S140 on Nrf52 series? If that's the case, I'll just use whatever function they are using from the android API, and mission accomplished?

I'm trying to git the APP source code to local, but at this point, I don't know if the tool box work at all, if it does, then it'll just be monkey see monkey do kind of deal, if not, I'm not going to spend my time on it.

Also, if you are familiar with this, feel free to tell me what function the toolbox use to set the cccd handle.

Cheers.

Parents
  • FormerMember
    0 FormerMember

    First, I would recommend you to read this thread regarding the problem you describe.

    The android part: Which phone/android version do you use?

    When I test here, nRF Toolbox (Huawei P10/ android 7.0)<--> nRF52840, S140 v.5.0.0-2.alpha, example ble_app_hrs works fine, it is not any problem to enable notifications.

    In nRF Toolbox: perhaps the function newWriteRequest()--> getWriteType() can be of any use when enabling notifications? Or, run nRF Toolbox in debug mode, set a breakpoint in newEnableNotificationsRequest()and check which write type the app will use for enabling notifications.

  • No, it's about step 2 only. Step one just adds your BluetoothGatt object to notification listeners in the system. Had the notifications were enabled before you connected in your app to this device it's enough to call only step 1. It's an information for the system that you want to receive whatever comes to this characteristic.

    Step 2 enables notification on the remote device by sending some data (0x0001). This write to the ccc descriptor should be done with Write Request type, but incorrectly may be written without response. Older SDa were accepting this out-of-spec method, the new one isn't.

Reply
  • No, it's about step 2 only. Step one just adds your BluetoothGatt object to notification listeners in the system. Had the notifications were enabled before you connected in your app to this device it's enough to call only step 1. It's an information for the system that you want to receive whatever comes to this characteristic.

    Step 2 enables notification on the remote device by sending some data (0x0001). This write to the ccc descriptor should be done with Write Request type, but incorrectly may be written without response. Older SDa were accepting this out-of-spec method, the new one isn't.

Children
No Data
Related