0

I want to connect and stream the multiple Bluetooth low energy sensors by matching their gatt profiles. All the sensors devices are of the same type but different mac address. So I want to connect those sensors to my mobile application and stream those data to our other application through the serial port. I know the Bluetooth can connect to 7 devices at a time.

But for connectivity with Android devices, it is not stated properly and still in a dilemma. Or else is it possible to connect external Bluetooth module to the android box to connect it to multiple devices? If yes then to do this what are the changes I need to perform on my system? How many devices can be used to communicate with the Android device at the same time? Can the android box act as a master that collects all the data from the peripherals and stream via the serial port. We have completed our process for a single sensor. Or is there any other possibility to stream multiple ble sensor data to another device through serial port write. please guide me through this process.

MarGin
  • 2,078
  • 1
  • 17
  • 28
  • Maybe have a look here [link](https://stackoverflow.com/questions/21237093/android-4-3-how-to-connect-to-multiple-bluetooth-low-energy-devices?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa) – Ron Nabuurs Apr 05 '18 at 12:00
  • Please narrow down your question so it matches Stack Overflow's format and rules. Android can definitely connect to at least seven BLE devices concurrently. A few Bluetooth chips however have a lower limit of maximum number of connections, but the manufacturers never tell this number. – Emil Apr 05 '18 at 14:30

1 Answers1

0

Execute connectGatt one time for every device, which will then give you one BluetoothGatt object per device. The callback object can be the same, or a separate instance per device, it depends on the use-case but most probably the devices serve different purposes so you'll have separate specific instances per device.

As long as you have a BluetoothDevice object, you can make a GATT connection to it. You can get it either using Bluetooth device address (which can sometimes be problematic since the API misses the random / public address type bit) or by a scan. You can have one outstanding GATT operation at a time, per BluetoothGatt object, so yes you can read / write characteristics to both devices simultaneously.

Feel free to post some source code for more analysis.

Csaba Toth
  • 10,021
  • 5
  • 75
  • 121