If I configure the remote BLE device to Notify and SetNotify to true Data arrives in DataAvilable and I can successfully read it. If however I set the remote device to Read, remove the SetNotify and use either ReadData or ReadData2 nothing arrives in DataAvialable.
Using nRF Connect I can read the data as expected. Do I have to set or initialise something to enable ReadData ?
Presumably ReadData is as simple as :-
And DataAvilable should work equally well for Notify and Read without any changes
Using nRF Connect I can read the data as expected. Do I have to set or initialise something to enable ReadData ?
Presumably ReadData is as simple as :-
B4X:
Private Sub readvalue
manager.ReadData2(serveuuid,flowuuid)
Log("read flow")
End Sub
And DataAvilable should work equally well for Notify and Read without any changes
B4X:
Sub Manager_DataAvailable (ServiceId As String, Characteristics As Map)
Dim b() As Byte
If Characteristics.ContainsKey(flowuuid)Then 'seek value if flow
b=Characteristics.Get(flowuuid) 'get value from map
rxdata=(bc.HexFromBytes(b)) 'convert to a string and put in rxdata variable
Log ("rxdata "&rxdata)
End If
Log("DATA arrived")
End Sub