I haven't been able to find an example of how to scan and populate a tableview of available BLE devices from which I can select one to connect to.
My attempt to do this is cobbled together from bits of code from the BLE Central and Tableview examples.
The log shows that a device is found but it doesn't appear in the tableview. The "TableView1.AddSingleLine(Name)" command works when it's in the "Private Sub Application_Start (Nav As NavigationController)" subroutine, but not in the "DeviceFound" subroutine.
If the manager.Connect(DeviceId) line is unmarked, the device which is found connects.
My attempt to do this is cobbled together from bits of code from the BLE Central and Tableview examples.
The log shows that a device is found but it doesn't appear in the tableview. The "TableView1.AddSingleLine(Name)" command works when it's in the "Private Sub Application_Start (Nav As NavigationController)" subroutine, but not in the "DeviceFound" subroutine.
If the manager.Connect(DeviceId) line is unmarked, the device which is found connects.
B4X:
Private Sub Manager_DeviceFound (Name As String, DeviceId As String, AdvertisingData As Map, RSSI As Double)
Log($"DeviceFound: ${Name}"$)
TableView1.AddSingleLine(Name)
' manager.Connect(DeviceId)
End Sub