Hi
I am trying some modifications using the BLE example, and I need this:
This edittext has a value of 3C:71:BF:0B:0F:3A (example)
I want connect only if "Id" found is equal the "edittext1.text" from Main.
This is the code I want to modify:
' THIS WORKS
'THIS DONT WORK
Thanks
I am trying some modifications using the BLE example, and I need this:
- A sub inside Starter Module needs to read "edittext1.text" from Main module.
This edittext has a value of 3C:71:BF:0B:0F:3A (example)
I want connect only if "Id" found is equal the "edittext1.text" from Main.
This is the code I want to modify:
' THIS WORKS
B4X:
Sub Manager_DeviceFound (Name As String, Id As String, AdvertisingData As Map, RSSI As Double)
If Id == "3C:71:BF:AB:0E:3A" Then
Log("Found: " & Name)
Log("TAK_device: " & Id)
ConnectedName = Name
manager.StopScan
manager.Connect2(Id, False) 'disabling auto connect can make the connection quicker
End If
End Sub
'THIS DONT WORK
B4X:
Sub Manager_DeviceFound (Name As String, Id As String, AdvertisingData As Map, RSSI As Double)
If Id == EditText1.Text Then
Log("Found: " & Name)
Log("TAK_device: " & Id)
ConnectedName = Name
manager.StopScan
manager.Connect2(Id, False) 'disabling auto connect can make the connection quicker
End If
End Sub
Thanks