you would just maybe issue a wait or a SetTimeout for the AT+BAR command to ensure all of the AT+FOO response lines have been either handled or flushed?
I'd handle all 3 lines - adding a timeout would work, but it's pretty nasty and might bite you later on. It's not hard - at the most basic level:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'd handle all 3 lines - adding a timeout would work, but it's pretty nasty and might bite you later on. It's not hard - at the most basic level:
Or you could actually count the lines - but in a lot of cases there's an
OK
message or something to signify the end of the response that you can use:Exactly - it's really the responsibility of the
at.cmd
's callback to keep track of the response that it is expecting.Is the existing one not working for you? It sounded a lot like after the wiring issues, it was working ok?