[PATCH] Fix problem parsing space in CRSM response

Oskar Enoksson enok at lysator.liu.se
Wed Oct 29 15:59:38 PDT 2014


Yes, regex is better. Adding a test seems like a good thing.

On 10/29/2014 10:14 PM, Aleksander Morgado wrote:
> 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.
> 


More information about the ModemManager-devel mailing list