B4R Question ESP32 how to use BT with astream

luki_c

Member
I'm writing an application where I receive/send data to esp32 I'm using esp idf for this and I ran into a problem.
When I send data to esp32 with the command
B4X:
Public Sub SendMessage (msg As String)

    AStream.Write(msg.GetBytes("UTF8"))

End Sub

On the other side I couldn't read the data, so I checked character by character what was arriving and printed on the console screen
B4X:
I (667593) Bluetooth: ESP_SPP_DATA_IND_EVT len=13 handle=129
     0
(0) 1
(0) 2
(0) 3
T 4
E 5
S 6
T 7
  8
1 9
2 10
3 11
4 12

I (667593) Bluetooth: ESP_SPP_WRITE_EVT

Why does the astream write function send bytes with a value of 0 in the first place? Can I use another function that will send an array without a header with a value of 0?
 
Top