Closed
Description
Description
- Type: Enhancement
- Priority: Minor
Enhancement
#4119 introduce the new ATCmdParser
, which is very useful indeed. However it's lacking some stuff to make it properly usable. These stuffs are:
- A method that simply allows URCs to run. Often all the application has to do is wait for the modem to spit out a URC saying it's got something, which will be trapped by a
oob()
. Howeveroob()
s are only processed when arecv()
call is in progress. My workaround, at the moment is to dorecv("\x01")
, since I know the modem will never send "\x01", but that is a somewhat peculiar hack and looks very strange in terms of the debug prints (smiley faces and timeouts appear). It would be better to have a specific method for this, maybe with its own personal timeout. Something likewait(int timeout)
. - A method to remove an
oob()
. Currently they can only be added, and many may be taking up RAM unnecessarily. - The
read()
method reads an exact number of characters from the serial stream, or -1 if there is a timeout. The problem with this is that it might have read, say, 99 out of 100 characters from the serial stream and then timed out. When -1 is returned the application has no idea that there really have been some characters received, so those are effectively lost. It would be much better ifread()
simply returned the number of characters read, 0 representing the timeout case. - This is an optional one: since there can be many
oob()
s, they can take up a lot of processing time during therecv()
call. If there is a lot of data coming in, this could result in data loss if there is no flow control on the incoming stream. So it would be nice to have an option to not allowoob()
s to run onrecv()
calls where timing is critical. This could be done as an additional bool parameter torecv()
, which defaults to allowingoob()
s to run.