Hi,
I'm using "BLE_Example" to receive data from a module BLE. The data that interest me is a uint8 byte.
I modified "BLE_Example" with the code of the tread:
https://www.b4x.com/android/forum/t...acteristic-uuid-using-the-ble2-library.97797/
The snipped code is:
But I receive always "00" although the values sended (I'm sure) are others.
Any help?
Thanks!
I'm using "BLE_Example" to receive data from a module BLE. The data that interest me is a uint8 byte.
I modified "BLE_Example" with the code of the tread:
https://www.b4x.com/android/forum/t...acteristic-uuid-using-the-ble2-library.97797/
The snipped code is:
B4X:
Sub DataAvailable (Service As String, Characteristics As Map)
pbReadData.Visible = False
clv.Add(CreateServiceItem(Service), "")
For Each id As String In Characteristics.Keys
Dim dataContent() As Byte = Characteristics.Get(id)
If id="0000a1b2-0000-1000-8000-00805f9b34fb" Then '<--fill with correct values
' If the values are string-formatted, convert the bytes to string
' Log( "Characteristic:"& id &": "&BytesToString(dataContent, 0, dataContent.Length, "UTF8") )
' Or, if we know that each byte has a meaning, just show the bytes
Dim bc As ByteConverter '<---- will need the ByteConverter library
Log( "Characteristic:"& id &": "& bc.HexFromBytes(dataContent) )
End If
Next
End Sub
Any help?
Thanks!
Last edited by a moderator: