Fix: Make next_hexstring handle optional quotes

Ericsson MBM devices send CRSM information as hex strings, yet enclose
them in quotes which is not according to the standard.
This commit is contained in:
Denis Kenzior 2009-10-02 18:22:44 -05:00
parent dcf4ac50b3
commit 7e82686e70
1 changed files with 6 additions and 0 deletions

View File

@ -228,6 +228,9 @@ gboolean g_at_result_iter_next_hexstring(GAtResultIter *iter,
goto out;
}
if (line[pos] == '"')
pos += 1;
end = pos;
while (end < len && g_ascii_isxdigit(line[end]))
@ -241,6 +244,9 @@ gboolean g_at_result_iter_next_hexstring(GAtResultIter *iter,
for (; pos < end; pos += 2)
sscanf(line + pos, "%02hhx", bufpos++);
if (line[end] == '"')
end += 1;
out:
iter->line_pos = skip_to_next_field(line, end, len);