I am a little slow, but gradually gaining an understanding of what needs to be done. Just not sure how to do it.
I am looking to display a list of already paired devices not devices that are broadcasting.
When one is selected then I need to start listening for data from that device.
The device has 3 modes.
1. It continuously broadcasts data.
2. Broadcast data when values change.
3. Broadcast data when you push the button on the device. or request the data from the device.
I am really interested in 3 and. for now, only when the button is pushed on the device.
The problem I am currently experiencing is (using BLE.b4a) I can connect OK and read data, but as soon as I have read the data I am disconnected from the device. How do I stay connected and continue listening for new data to be broadcast?
Ok, i have done more experimenting. I can get the paired BT devices using Serial (why it is called serial is beyond me) this gives me the MAC Address (called DeviceID in .Connect?).
But I cannot connect to the device unless I scan for it first. I get error:
java.lang.RuntimeException: MacAddress not found. Make sure to call Scan before trying to connect.
BUT it won't find the device using scan if it is not broadcasting. So how do I connect to an already paired device without putting the device in broadcast mode?
And then listen for it to send information.
Thanks for your help.