Serial Library (1.21) - how to specify baud rate?

Vader

Well-Known Member
Licensed User
Longtime User
Hi,

I need to talk over the bluetooth serial at 9600 baud. How do I set the speed? I am assuming the port is configured as 8N1.

I can initialize and connect, though the device doesn't reply. I am thinking that the speed is wrong.

Dave
 

Vader

Well-Known Member
Licensed User
Longtime User
Ok, so I can't answer my own question, but I can say that I can now talk to my external device over serial, so the speed was not the issue.

For the next person that wants to talk over serial, it would be helpful to know that UTF-8 is NOT the encoding set you need.
Latin1, otherwise known as ISO8859-1 is what you require.

Receiving:
B4X:
Private NewData As String = BytesToString(Buffer, 0, Buffer.Length, "ISO8859_1")

Sending:
B4X:
Stream.Write(DataToSend.GetBytes("ISO8859_1"))
 
Upvote 0
Top