You can send data as a string or as an array of bytes.
What type of data do you have? Can you give us a small example of it.
Where does this data come from?
Sub btnSend_Click
strings() = StrSplit(textBox1.Text," ")
Dim data(ArrayLen(strings())) As byte
For i = 0 To ArrayLen(strings())-1
data(i) = bit.HexToDec(strings(i))
Next
If serial.PortOpen = true Then serial.Output2(data())
End Sub
I've modified the SerialTermial example to parse the data, convert it to a bytes array and send it.
bit is a Bitwise object.
The complete source code is attached.
B4X:Sub btnSend_Click strings() = StrSplit(textBox1.Text," ") Dim data(ArrayLen(strings())) As byte For i = 0 To ArrayLen(strings())-1 data(i) = bit.HexToDec(strings(i)) Next If serial.PortOpen = true Then serial.Output2(data()) End Sub
Erel its great!!!
Its work!
Thank you very very match!!!
Best regards,
Alex.