at parser: improvements#27
Conversation
| } | ||
|
|
||
| if (at_expect_bytes(dev, "\r\n", 2, timeout)) { | ||
| if (at_expect_bytes(dev, AT_END_OF_LINE "\r\n", sizeof(AT_END_OF_LINE) + 1, timeout)) { |
There was a problem hiding this comment.
When you send AT<CR>, the modem answer AT<CR> (echo) then <CR><LF>OK. I guess this work like that for every modem...maybe this could be configurable as well, not sure if needed though.
|
|
||
| #ifndef AT_END_OF_LINE | ||
| /** End of line character to send after the AT command */ | ||
| #define AT_END_OF_LINE "\r" |
There was a problem hiding this comment.
does sizeof(<string-constant>) return its length?
|
Thanks for tackling this! |
|
BTW, if you're using this to control a modem, maybe take a look at https://github.com/kaspar030/RIOT/tree/add_gsm_driver. I'm using that branch for a customer. It's sim8xx support hasn't been tested in a while, but MC60 works quite well. |
|
Looks interesting! We use a u-blox, but this could be adapted. Do you plan to merge that upstream? |
yes! I'll be back from holidays in august, will PR then. |
Hi @kaspar030
I worked a bit with your at command parser and I have some improvements to propose.
The EOL character can be configured with a macro.
I've also added a function to send a command and wait for a prompt and another to send raw bytes.