Wifi - AsyncStream

suciwulans

Active Member
Licensed User
Longtime User
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.
 

marksmanaz

Member
Licensed User
Longtime User
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

marksmanaz

Member
Licensed User
Longtime User
Ok I found a partial answer:


B4X:
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:

Invalid_Double.PNG


Any help would be great.

Thanks
 
Upvote 0
Top