Hello,
I'd like to extract data from a nRF using iBLE,
using the iBLE example I can connect and read from Bluetooth
Somebody knows how to get the data of:
-Heart rate measurement
-Battery level
Thanks
I'd like to extract data from a nRF using iBLE,
using the iBLE example I can connect and read from Bluetooth
Somebody knows how to get the data of:
-Heart rate measurement
-Battery level
Thanks
B4X:
Sub Manager_DataAvailable (Service As String, Characteristics As Map)
ActivityIndicator2.Visible = False
Dim bc As ByteConverter
For Each id As String In Characteristics.Keys
Log($"** Reading Sens: ${id} **"$) 'list all Sens
If id = "Battery Level" Then
Log("val: "&Characteristics.Values)
Dim ArrayBytes () As Byte = Characteristics.Get(id)
Log("Battery Level: "&ArrayBytes(0) & " %")
' should be between 0 to 100
Dim data1() As Byte = Characteristics.Get(0)
Log(bc.HexFromBytes(data1))
'reading exmple: '(emply string)
End If
If sensor = "2A37" Then 'Heart rate measurement
End If
Next
End Sub
Last edited: