Patch on unsupported AT command
Marcel Holtmann
marcel at holtmann.org
Mon Nov 23 08:08:27 PST 2009
Hi Denis,
> > This is first of all violating the coding style with the indentation on
> > the second line of the if, but it is also way too complicated.
>
> There is actually a reason for this.
>
> >
> > if (info->len == -1 && !strcmp(line, info->terminator)
> > return TRUE;
>
> This part checks for static terminators, like "OK" or "BUSY" or ERROR. We do
> whole string comparison here.
>
> >
> > if (info->len > 0 && !strncmp(line, info->terminator, ...))
> > return TRUE;
>
> This part checks for variable terminators. E.g. +CMS ERROR: XXX. These are
> well defined by the standard so we only do a prefix comparison for these.
and your point is? I was just going by the pure algorithmic of the if
statement to make it actually readable without getting a headache ;)
Regards
Marcel
More information about the ofono
mailing list