Hello
I am trying to connect to a device based on its UUID.
BLE2 library 1.38
Android 8.1.0
When i do manager.scan(Null) the device is discovered and able to connect
When i use manager.Scan2(ScanFilter, True) the device found is never raised.
I retrieved the UUID from another app on the same android device.
I have tried several examples .
The manufacturar suggests this:
How to achieve this in B4A?
Searched thru all the examples and problems with BLE(a lot of problems) on the forum.
I am trying to connect to a device based on its UUID.
BLE2 library 1.38
Android 8.1.0
When i do manager.scan(Null) the device is discovered and able to connect
When i use manager.Scan2(ScanFilter, True) the device found is never raised.
I retrieved the UUID from another app on the same android device.
B4X:
Public Sub StartScan
If manager.State <> manager.STATE_POWERED_ON Then
Log("Not powered on.")
Else If rp.Check(rp.PERMISSION_ACCESS_COARSE_LOCATION) = False Then
Log("No location permission.")
Else
'00001801-0000-1000-8000-00805f9b34fb
Dim ScanFilter As List
ScanFilter.Initialize
ScanFilter.Add(UUID2("89a8591d-bb19-485B-9f59-58492bc33e24"))
ScanFilter.Add("2320ae58-8394-4652-95f7-0a872ac0958f")
ScanFilter.Add("41df72e4-9721-41bd-b27f-f507a94d9634")
ScanFilter.Add(HEART_RATE_SERVICE)
Log(ScanFilter)
manager.Scan2(ScanFilter, True)
'manager.Scan(Null)
End If
End Sub
I have tried several examples .
The manufacturar suggests this:
To access the button status from your app, please perform the following in Android:
Scan for Blu-PTT in the list of “bonded devices” rather than just under a BTLE scan
Implement one notify event on button press
Implement one notify event on button release.
How to achieve this in B4A?
Searched thru all the examples and problems with BLE(a lot of problems) on the forum.