Hi Tonny, > In your proposed patch, it bypass the unsolicited response only if the > 2nd number after +CGREG: is not single digit, however if the lac is > single digit, we will still get the wrong state number.
The lac is given as a 2 byte number and should always be printed as four hexadecimal letters. If this is not the case, then you should have a serious talk with your vendor. > > So I still believe we should check whether we are at the end of the > return string before parsing the unquoted lac and ci. If we are at the > end of the string, then this is a unsolicited code and we should ignore > it. How do you think? > I'm against this, if you really want to guard against this, then use the approach similar to comprehension_tlv_iter_copy in src/simutil.[ch]. You can use that to 'peek' ahead and figure out whether the response contains 3 or 4 elements. But again, you would not be having this issue in the first place if your vendor followed standards ;) Regards, -Denis _______________________________________________ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono