Hello!
I'm trying to write an application that can read information from 1+ devices at the same time.
The logic is simple:
- Application goes to SCAN_STATE_SCANNING
- if the Application finds a device, it pairs it.
It works for the very first device, but not for a second.
Ble.pairDevice() works well and returns an object for the second. But when I try to activate notifications for the second device, the call device.getService(profile.SERVICE); always returns null.
This code
var services = device.getServices();
for(var it = services.next(); null != it; it = services.next()) {
System.println("Get service " + it.toString());
}
shows nothing, so the iterator returned is empty, I suppose.
As I read here before, it should be possible to connect several devices. But in this case what is the correct logic for this operation should be?
PS: I have the only profile registered, as the devices are all the same.
Thanks.