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

Nordik UART app with Multiple service reception

I need to receive both UART Service data and HRS service data on the app.

Currently I have seen on Nordik Connect app , both the services can be found and can connect and receive data.

I need to do same with my app using nordik UART App code.

I have changed UART profile to HRS profile and code was working, i was receiving Nordik HRS service data.

But i want both services should be used and receives data. so i have prepare separate UARTService_HRS for hrs profile in the same code.also added needed changed.but it gives error null pointer exception on BLEGattService.

Please help

    1. Thanks for explanation regarding characteristics unknown value. but as you recommended i have all the statements to read characterestics (getValue) also some code in readCharacteristics function. I have enableTXNotification function which will enable both service notification. i have seen log for notification enable returning true. but at the end, i am getting only UART chracteristics data in brodcastUpdate. what i am missing to read both services tx chracteristics in an single run.
  • I am facing same like problem in iPhone App, when we try to read both service characteristics value, we can receive data but cannot write tx characteristics at that time. in UART we have 2 charcterictics tx and rx . single service with its 2 characteristis works fine. when we had added second service (hrs), tx characteristics in uart profile stop working. can we have single reference code for both platforms to work on two service profiles at a time?(we are using UART and HRS profile). when i replace single service on another, only single replaced service will be there it works . only UART or HRS. but i need both services, UART services to read and write characteristics and hrs service with read characteristics.

  • Please let me know if you can make it work with just the HRS profile, no UART ? I suggest you to test as follow:

    1 - Make a firmware with just HRS (you can use our hrs example) then make an app with just HRS and make sure it works.

    2 - Make a firmware with HRS and UART then make an app with just HRS and test

    3 - Try to add UART in to the HRS app and test again

    I don't see any reason why only UART work but not HRS.

    You may want to capture a sniffer trace so I can see what happens over the air. Make sure CCCD is enabled for both services.

  • first , we have tested with only hrs. it works. but when i tried to use both services it gives problem. i had also rechecked for both services having CCID enabled and it returns true. I am repeating the same, can you provide sample of UART code where multiple services works parallelly. because i am face this problem in both Android and iPhone App development.

  • I have tested same with Nordik Connect App , there it works for both services , it read both services but i cannot test there transmission for UART because my data is different than what you can transmit.so, i cant check response. i need to transmit byte array for request.

    please go through below link for nrf connect response details

    drive.google.com/.../0Bx0kGChmcM8BZllqcTVUTlJGQ00

Related