suciwulans Active Member Licensed User Longtime User Apr 16, 2013 #1 Erel. I am trying tutorial example from flyingbag to receive data using wifi. It's working but data i'm receiving contains strange characters. i want to received ASCII characters. whats encoding must i use to fix this problem? thank you.
Erel. I am trying tutorial example from flyingbag to receive data using wifi. It's working but data i'm receiving contains strange characters. i want to received ASCII characters. whats encoding must i use to fix this problem? thank you.
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2013 #2 Are you using prefix mode? You can only use it if both sides of the connection are using the "prefix" protocol. You can use AsyncStreamsText class for text based streams (you can also use AsyncStreams in regular mode). Upvote 0
Are you using prefix mode? You can only use it if both sides of the connection are using the "prefix" protocol. You can use AsyncStreamsText class for text based streams (you can also use AsyncStreams in regular mode).
M marksmanaz Member Licensed User Longtime User Aug 25, 2013 #3 Hello Erel, I too am playing with the example from flyingbag to send Hex data over TCP to a device that then passes it along to a serial port. I can send plain Ascii text successfully. Looking around I have found other using a byte array to send hex over serial and so on. I am not sure I understand how I can do that using what user enters into the textbox no matter the length of hex in the textbox. If a user enters "00 08 EF D4 01" or "02 7B 00 C8 00 03 EA" I would like it to be passed on as Hex no matter the number of bytes. If you could point me in the right direction I would appreciate it. Thank Upvote 0
Hello Erel, I too am playing with the example from flyingbag to send Hex data over TCP to a device that then passes it along to a serial port. I can send plain Ascii text successfully. Looking around I have found other using a byte array to send hex over serial and so on. I am not sure I understand how I can do that using what user enters into the textbox no matter the length of hex in the textbox. If a user enters "00 08 EF D4 01" or "02 7B 00 C8 00 03 EA" I would like it to be passed on as Hex no matter the number of bytes. If you could point me in the right direction I would appreciate it. Thank
M marksmanaz Member Licensed User Longtime User Aug 25, 2013 #4 Ok I found a partial answer: Code: Copy Sub txt_out_EnterPressed If Astreams.IsInitialized = False Then Return If txt_out.Text.Length > 0 Then Astreams.Write(Array As Byte(txt_out.Text)) ToastMessageShow("Sending:" & txt_out.Text,False) End If End Sub This will work if am using bytes consisting of only digits such as "00 08 02" but I am using Hex that uses letters A-F and if I use any of those I get this error: Any help would be great. Thanks Upvote 0
Ok I found a partial answer: Code: Copy Sub txt_out_EnterPressed If Astreams.IsInitialized = False Then Return If txt_out.Text.Length > 0 Then Astreams.Write(Array As Byte(txt_out.Text)) ToastMessageShow("Sending:" & txt_out.Text,False) End If End Sub This will work if am using bytes consisting of only digits such as "00 08 02" but I am using Hex that uses letters A-F and if I use any of those I get this error: Any help would be great. Thanks
M marksmanaz Member Licensed User Longtime User Aug 26, 2013 #5 I got it to work with the ByteConverter library Thanks Upvote 0