Hi Guillaume,

> >> +static gboolean parse_ati_result(GAtResult *result)
> >> +{
> >> +  GAtResultIter iter;
> >> +  const char *line;
> >> +  int num = g_at_result_num_response_lines(result);
> >> +  int i;
> >> +
> >> +  g_at_result_iter_init(&iter, result);
> >> +
> >> +  for (i = 0; i<  num; i++) {
> >> +          g_at_result_iter_next(&iter, NULL);
> >> +          line = g_at_result_iter_raw_line(&iter);
> >> +          if (g_str_has_prefix(line, "+GCAP"))
> >> +                  return (g_strrstr(line, "+CGSM") != NULL);
> > This parsing is more complex than it needs to be. It also parses the
> > string too many times. Especially since GAtChat does that all for you
> > already anyway.
> >
> > Instead of posting an example here, I just pushed a patch so you can see
> > how easily this can be done.
> 
> Right, I see this is easier do to how I you submitted it :)
> However, I have a dongle EC1261 that is bugged because:
>          - when I send ATI, the capabilities line is returned with 
> "+GCAP +GCAP:" prefix
>          - when I send AT+GCAP, the prefix is "+GCAP:"
> 
> Unless the manufacturer fixes this issue, we won't be able to support 
> this dongle...

that is because that modem firmware is like super buggy. I bet they also
prefixed the other ATI responses with their counterparts. Whoever owns
that modem should upgrade the firmware to a proper version.

And precisely because of this, I want this to fail if the modem firmware
is acting up again.

Regards

Marcel


_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to