Hello Rob,

Thank you very much.
This will help alot.
Cheers.

FS

On Friday, December 2, 2022 at 7:21:46 PM UTC [email protected] wrote:

> Hi Filipe,
>
> One correction. if you get a timeout then there is no string (or only a 
> partial string) so you have to check if the timer has reached the timeout 
> after the repeat.
>
> Kind regards,
>
> Rob
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens Rob CJ <
> [email protected]>
> *Verzonden:* vrijdag 2 december 2022 20:20
> *Aan:* [email protected] <[email protected]>
>
> *Onderwerp:* Re: [jallib] Re: Variable Table Append
> Hi Filipe,
>
> Some sample code. I did not test it (or compiled it) but I assume you get 
> the idea.
>
> const word MAX_TIMEOUT = 20_000 
> const byte MAX_BUFFER = 20
> const byte CR = 0x0D
> const byte LF = 0x0A
>
> var word timer = 0
> var byte my_buffer[MAX_BUFFER]
> var byte index = 0
> var byte character = 0
>
> -- Read a string.
> repeat
>     if serial_hw_data_available() then
>        character = serial_hw_data
>        my_buffer[index] = character
>        index = index + 1
>    end if 
>     timer = timer + 1
>     _usec_delay(100)
> until (index == MAX_BUFFER) | (character == CR) | (character == LF) | 
> (timer == MAX_TIMEOUT)
>
> The string is then in my_buffer (including a CR or LF). 
>
> Kind regards,
>
> Rob
>
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens flyway38 <
> [email protected]>
> *Verzonden:* vrijdag 2 december 2022 19:23
> *Aan:* jallib <[email protected]>
> *Onderwerp:* Re: [jallib] Re: Variable Table Append 
>  
> Hi Rob,
>
> Thanks for your input.
> Could you post some sample code please?
> I think am missing some important details...
> How can I define a variable buffer?
> Because this seems not work: var byte received[]=""...
>
> Am also struggling to read my modems relies to AT commands...
> It seems my code is working correctly and after sending the AT command, 
> the readings from serial port seems to point to characters from the sent 
> command...
> Getting crazy here while in battle with the code... :D
> Thank you very much.
>
> Best regards,
> Filipe Santos
>
> On Friday, December 2, 2022 at 6:06:56 PM UTC [email protected] wrote:
>
> Hi Filipe,
>
> You just read the data from a serial port, add that to your local variable 
> buffer, increment an index pointer with each received character and read 
> until you receive either a Carriage Return or a Line Feed (one of the will 
> do). I normally also add a timeout to the read function so that it does not 
> hang when nothing is received.
>
> Kind regards,
>
> rob
>
>
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens flyway38 <
> [email protected]>
> *Verzonden:* vrijdag 2 december 2022 12:38
> *Aan:* jallib <[email protected]>
> *Onderwerp:* [jallib] Re: Variable Table Append 
>  
> Am trying to mimic a "Read_String" from serial port.
> Any ideas?
>
> Thank you.
>
> Regards,
> FS
>
> On Friday, December 2, 2022 at 9:42:34 AM UTC flyway38 wrote:
>
> Hello all,
>
> Have searched for it but haven't found anything useful.
> Need to know a good way of appending a variable table.
> Starting from a MyVar[] = "", then just append data to it...
> Also what happen to website: https://justanotherlanguage.org/ ?
> Cannot connect to that website.
> Thank you very much.
>
> Kind regards,
> Filipe Santos.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/2251b524-7658-42f7-970b-a6817d6709e1n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/2251b524-7658-42f7-970b-a6817d6709e1n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/37733abd-20ed-4130-8aa2-03381fb3ac1an%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/37733abd-20ed-4130-8aa2-03381fb3ac1an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/GVXP195MB16374C5EDB5CFD44C5580F26E6179%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM
>  
> <https://groups.google.com/d/msgid/jallib/GVXP195MB16374C5EDB5CFD44C5580F26E6179%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/1af55b5d-54bb-4ea7-a2d6-21574ba3ea7an%40googlegroups.com.

Reply via email to