M Mostez Well-Known Member Licensed User Longtime User Nov 11, 2016 #1 Hello, how can I send ascii (2) and (4) characters to async stream, not "2" and "4" (ascii 50 and 52) Thanks
Hello, how can I send ascii (2) and (4) characters to async stream, not "2" and "4" (ascii 50 and 52) Thanks
Erel B4X founder Staff member Licensed User Longtime User Nov 13, 2016 #2 Code: Copy AStream.Write(Array As Byte(2, 4)) Tip: Use B4RSerializator. It will be simpler to send complex messages. Upvote 0
Code: Copy AStream.Write(Array As Byte(2, 4)) Tip: Use B4RSerializator. It will be simpler to send complex messages.
MichalK73 Well-Known Member Licensed User Longtime User Nov 17, 2016 #4 How to send the end of the line? Code: Copy If Buffer ="setup" Then ser.Write("__________") ser.Write("pu - pokaz ustawienia") ser.Write("cxx - czas czujki") End If I have result in serial terminal "__________pu - pokaz ustawieniacxx - czas czujki" I wish that it was so __________ pu - pokaz ustawienia cxx - czas czujki How to do it? Upvote 0
How to send the end of the line? Code: Copy If Buffer ="setup" Then ser.Write("__________") ser.Write("pu - pokaz ustawienia") ser.Write("cxx - czas czujki") End If I have result in serial terminal "__________pu - pokaz ustawieniacxx - czas czujki" I wish that it was so __________ pu - pokaz ustawienia cxx - czas czujki How to do it?
I inakigarm Well-Known Member Licensed User Longtime User Nov 17, 2016 #5 Test with Code: Copy astream.Write(ArrayAs Byte(10)) Upvote 0
MichalK73 Well-Known Member Licensed User Longtime User Nov 17, 2016 #6 Ok I find https://www.b4x.com/android/forum/threads/downloading-a-web-page-with-esp8266.70570/ And write Code: Copy If Buffer ="setup" Then Dim eol() As Byte = Array As Byte(13, 10) ser.Write("__________".GetBytes) ser.Write(eol) ser.Write("pu - pokaz ustawienia".GetBytes) ser.Write(eol) ser.Write("cxx - czas czujki".GetBytes) ser.Write(eol) End If Working fine Code: Copy __________ pu - pokaz ustawienia cxx - czas czujki Upvote 0
Ok I find https://www.b4x.com/android/forum/threads/downloading-a-web-page-with-esp8266.70570/ And write Code: Copy If Buffer ="setup" Then Dim eol() As Byte = Array As Byte(13, 10) ser.Write("__________".GetBytes) ser.Write(eol) ser.Write("pu - pokaz ustawienia".GetBytes) ser.Write(eol) ser.Write("cxx - czas czujki".GetBytes) ser.Write(eol) End If Working fine Code: Copy __________ pu - pokaz ustawienia cxx - czas czujki
I inakigarm Well-Known Member Licensed User Longtime User Nov 17, 2016 #7 MichalK73 said: example ?? Click to expand... Well, I've attached the code before Code: Copy astream.Write(Array As Byte(10)) --> ascii 10 = LF (LineFeed) Not Tested.. Code: Copy If Buffer ="setup" Then ser.Write("__________") ser.Write("pu - pokaz ustawienia") ser.Write(Array As Byte(10)) ser.Write("cxx - czas czujki") End If Upvote 0
MichalK73 said: example ?? Click to expand... Well, I've attached the code before Code: Copy astream.Write(Array As Byte(10)) --> ascii 10 = LF (LineFeed) Not Tested.. Code: Copy If Buffer ="setup" Then ser.Write("__________") ser.Write("pu - pokaz ustawienia") ser.Write(Array As Byte(10)) ser.Write("cxx - czas czujki") End If
sasetcolombia Member Licensed User Longtime User Sep 7, 2020 #8 how could i define this string in a variable(I need to include the character chr (34)) AT+SAPBR=3,1,"Contype","GPRS" this definition marks an error in "\" Private SAPBR As String= "AT+SAPBR=3,1,\"Contype\",\"GPRS\"" Upvote 0
how could i define this string in a variable(I need to include the character chr (34)) AT+SAPBR=3,1,"Contype","GPRS" this definition marks an error in "\" Private SAPBR As String= "AT+SAPBR=3,1,\"Contype\",\"GPRS\""
M Michael1968 Active Member Licensed User Longtime User Sep 7, 2020 #9 sasetcolombia said: how could i define this string in a variable(I need to include the character chr (34)) AT+SAPBR=3,1,"Contype","GPRS" this definition marks an error in "\" Private SAPBR As String= "AT+SAPBR=3,1,\"Contype\",\"GPRS\"" Click to expand... Hi sasetcolombia, this is an old thread pls start an new thread this can help you: https://www.b4x.com/android/forum/t...k-in-astream-write-solved.103811/#post-650840 https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/page-3#post-691084 https://www.b4x.com/android/forum/t...arks-in-a-string-variable.102045/#post-640514 best regards Michael Upvote 0
sasetcolombia said: how could i define this string in a variable(I need to include the character chr (34)) AT+SAPBR=3,1,"Contype","GPRS" this definition marks an error in "\" Private SAPBR As String= "AT+SAPBR=3,1,\"Contype\",\"GPRS\"" Click to expand... Hi sasetcolombia, this is an old thread pls start an new thread this can help you: https://www.b4x.com/android/forum/t...k-in-astream-write-solved.103811/#post-650840 https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/page-3#post-691084 https://www.b4x.com/android/forum/t...arks-in-a-string-variable.102045/#post-640514 best regards Michael