Sub Process_Globals
Dim manager As BleManager
Private cs As List
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim i As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
manager.Initialize("ble")
Log("Supported= " & manager.BleSupported)
End If
End Sub
Sub Activity_Click
Log("Searching for devices")
ToastMessageShow("Searching for Devices..",True)
manager.Scan(100000, Null)
End Sub
Sub ble_DeviceFound (Name As String, MacAddress As String)
Log(Name & ", " & MacAddress)
ToastMessageShow("Device Found=" & Name & ", " & MacAddress,True)
manager.Connect(MacAddress, True)
End Sub
Sub BLE_Connected (Services As Map)
Dim n As Int,s As BleService,cr As String,c As BleCharacteristic
Log ("AanzahlServices size = " & Services.Size)
For n=0 To 3
s = Services.GetValueAt(n)
Log("Service[" & n & "]: " & Services.GetKeyAt(n))
Next
c=s.GetCharacteristics.GetValueAt(0)
Log("read: " & c.Uuid)
manager.ReadCharacteristic(c)
End Sub
Sub BLE_CharacteristicRead (Success As Boolean, Characteristic As BleCharacteristic)
Log("CR: " & Success & ": " & Characteristic.Uuid)
End Sub
Sub ble_Disconnected
Log("Disconnected")
End Sub
Sub ble_DiscoveryFinished
Log("DiscoveryFinished")
End Sub
Sub ble_CharacteristicChanged (Characteristic As BleCharacteristic)
Log("In Changed. UUID=" & Characteristic.Uuid)
End Sub
/Code
This is the log it produces.
[ATTACH=full]34797[/ATTACH]
So I feel as though I'm close, but unfortunately I don't really understand the terminology & I'm not sure what the next step is - I think I want to log data from Service[3).
Any pointers would be much appreciated.