@@ -289,15 +289,18 @@ ModemClass::ParseResult ModemClass::buf_read(const string &prompt, string &data_
289
289
* in case multiple parameters separated by ',' are sent, they will be present in data_res
290
290
* - if we encounter <CR> we need to wait for <LF>
291
291
* - if we encounter <LF> we need to parse the response status
292
- * - if we encounter '|', the next token will contain binary sized data, the current value in
292
+ * - if we encounter '|', the next token will contain binary sized data, the current value
293
293
* in data_res contains the length of the next token
294
294
*/
295
295
296
296
if (c == ' |' ) { // sized read, the previous parameter is the length
297
- state = at_parse_state_t ::Sized;
298
-
299
297
sized_read_size = atoi (data_res.c_str ());
300
298
data_res.clear ();
299
+ if (sized_read_size != 0 ) {
300
+ state = at_parse_state_t ::Sized;
301
+ } else {
302
+ state = at_parse_state_t ::Res;
303
+ }
301
304
} else if (c == ' \r ' ) {
302
305
state = at_parse_state_t ::ResWaitLF;
303
306
} else if (c == ' \n ' ) {
0 commit comments