[PATCH] Fix problem parsing space in CRSM response

Aleksander Morgado aleksander at aleksander.es
Wed Oct 29 14:14:41 PDT 2014


Hey Oskar,

On Wed, Oct 29, 2014 at 9:56 PM, Oskar Enoksson <enok at lysator.liu.se> wrote:
> My modem (Samsung GI-B3740) had whitespace in CRSM responses e.g.
> +CRSM: 144, 0, "98641001415070613508" Parsing the response in mm-base-sim.c
> failed. With this patch it works. Just skip whitespace after ',' using
> conversion specifier "%*[ ]"

Maybe we should instead update this response parser to use a GRegex
and match it with a regular expression? We could have a helper method
to parse the string, which would return the sw1, sw2 and the string.
What do you think? Having the helper method would also allow us to
setup unit tests in the tests/ directory with your exact +CRSM
response string.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list