Csigabi Gaboca
New Member
The example found in the forum unfortunately does not work for me :-(
It displays the contents and size of the buffer correctly, but the length of the data is already 0, so of course I can't read the bytes one by one either.
Thanks or help....
It displays the contents and size of the buffer correctly, but the length of the data is already 0, so of course I can't read the bytes one by one either.
B4X:
Sub AStream_NewData (buffer() As Byte )
Dim be(10) As Object 'used as a storage buffer. Can be a global variable
Dim data() As Object = ser.ConvertBytesToArray(buffer, be)
Log("NewData: ", buffer)
astream.Write("Echo from ESP32: ")
astream.Write(buffer)
bt.Stream.Flush
a = buffer.Length
Log(a)
Log(data.Length)
Log("-")
Log(data(0))
Log(data(1))
Log(data(2))
Log("---")
End Sub
Thanks or help....