This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

several uart device send data to one android phone simultaneously

Sorry,my English is poor. I Now,I have four uart BLE device. Every device sends data in frequency 20Hz. And I also have a android phone. I hope that the phone could receive the data from the four devices simultaneously. I read this question link text . And I add 3 BluetoothGatt objects and callbacks , so every device has a BluetoothGatt object and a callback. I modify the nrfUARTv2.apk to achieve it. But I failed. Phone only reveived data from one device that I connected recently. And am I doing this right? Please give me some suggestions. I'm looking forward to your help. Thank you!

Parents
  • Hi, I don't think there is anything 'tricky' to be done. It should work as you described. You scan for devices, connect to the first one and provide a callback object, then connect to another one and give a different callback object (it may be a second object of the same class, I don't know if it can be the same object), and repeat it for all your devices. Enable notifications for all devices, remember to keep all BluetoothGatt instances, as you have to send 0x0100 to a descriptor on each of them. Maybe you passed the same callback object in connectGatt method and that's why it's not working? It's hard to say without a code.

  • Thank you very much. "Other error" means basic android rules, not bluetooth. I copy the code of enableTXNotification() and put the copy in enableTXNotification(), and I change names "RxService2, mBluetoothGatt2, TxChar2, descriptor2".But I use the same action string. I didn't receive anything. I'll try out more. Thanks for your suggestions.-.-

Reply
  • Thank you very much. "Other error" means basic android rules, not bluetooth. I copy the code of enableTXNotification() and put the copy in enableTXNotification(), and I change names "RxService2, mBluetoothGatt2, TxChar2, descriptor2".But I use the same action string. I didn't receive anything. I'll try out more. Thanks for your suggestions.-.-

Children
No Data
Related