In a multithreaded environment like at-unix.c a data pipe will pull data from a UART and push it into the parser. If a response is detected it's returned to the caller as an unguarded char *.
One problem we're facing with ESP32-AT is that when you read data from a socket it returns a response+raw data, OK then immediately sends a URC. Since parser_handle_line resets the parser when it has detected a complete response, any data received after that will start overwriting the response.
In this particular case we can setup a command scanner that handles the URC as the final OK but there's always a risk of other spurious URCs overwriting the buffer.
In a multithreaded environment like
at-unix.ca data pipe will pull data from a UART and push it into the parser. If a response is detected it's returned to the caller as an unguardedchar *.One problem we're facing with ESP32-AT is that when you read data from a socket it returns a response+raw data,
OKthen immediately sends a URC. Sinceparser_handle_lineresets the parser when it has detected a complete response, any data received after that will start overwriting the response.In this particular case we can setup a command scanner that handles the URC as the final OK but there's always a risk of other spurious URCs overwriting the buffer.