1. Please use [code]code here...[/code] tags when posting code.
2. You should post logs as text instead of screenshots.
Yes. It will read the services and characteristics whenever you click on the Read Data button.
You should read this tutorial:
https://www.b4x.com/android/forum/threads/ble-bluetooth-low-energy-library.46099/#content
It is about the B4i library however it behaves exactly like the B4A library.
Hi Erel
I tried to modify the two functions in the "
BLE_Example".
Have read the
MA3_623(module) message
I still don't understand it very much. I need your guidance. Please.
Log:
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Found: , F0:18:98:80:55:ED, RSSI = -90, (MyMap) {1=[B@91fc32c, -1=[B@5b1f5, 0=[B@7239b8a}
Found: , 77:AE:43:C4:C3:6F, RSSI = -89, (MyMap) {1=[B@a4975fb, -1=[B@e5be618, 0=[B@bcc7871}
Found: , 70:66:63:15:94:99, RSSI = -51, (MyMap) {-1=[B@b27e656, 0=[B@4af76d7}
Found: , 61:54:F6:40:4E:3F, RSSI = -95, (MyMap) {1=[B@6354bc4, -1=[B@f5f2aad, 0=[B@95411e2}
Found: , 40:00:B7:ED:63:78, RSSI = -77, (MyMap) {-1=[B@d0aa973, 0=[B@f1d6030}
Found: Mi Band 3, FA:60:BB:CB:52:CD, RSSI = -91, (MyMap) {1=[B@7f0c4a9, -1=[B@1256a2e, 9=[B@dc69cf, 2=[B@b304f5c, 0=[B@8e80265}
Found: MA3_623, 37:38:36:31:30:32, RSSI = -42, (MyMap) {1=[B@aa1fb3a, -1=[B@a5fd3eb, 9=[B@210548, 0=[B@b5b5fe1}
Connect MA3_623
Discovering services.
Connected
0000180f-0000-1000-8000-00805f9b34fb
0000fff0-0000-1000-8000-00805f9b34fb
anywheresoftware.b4a.objects.collections.Map$1@6b947b6
0000fff2-0000-1000-8000-00805f9b34fb:
0000fff1-0000-1000-8000-00805f9b34fb:
anywheresoftware.b4a.objects.collections.Map$1@f71dd53
00002a19-0000-1000-8000-00805f9b34fb: 63
Public Sub ReadData
For Each s As String In ConnectedServices
manager.ReadData(s)
Log(s)
Next
End Sub
=======
Sub Manager_DataAvailable (ServiceId As String, Characteristics As Map)
Dim bc As ByteConverter
Log(Characteristics.Keys)
For Each key As String In Characteristics.Keys
Dim b() As Byte = Characteristics.Get(key)
Log((key) & ": " & (bc.HexFromBytes(b)))
Next
CallSub3(Main, "DataAvailable", ServiceId, Characteristics)
End Sub