mirror of git://git.sysmocom.de/ofono
atmodem: Parse optional PLMN parameter of AT+COPS=? result
The Infineon modem adds an optional <plmn_list> parameter after the access technology parameter <AcT>. It is not always present, but when present it makes the operator listing fail. +COPS: (2,"T-Mobile D","TMO D","26201",0,0),(3,"E-Plus","E-Plus","26203",0,),(3,"Vodafone.de","Vodafone.de","26202",0,),(3,"o2 - de","o2 - de","26207",0,) Not all networks have this parameter and maybe only the home network has it anyway. And so far this feature seems to be Infineon specific, but just in case, parse the parameter if present to make sure the operator listing is available.
This commit is contained in:
parent
27311fc4a8
commit
cf2ba64872
|
@ -418,7 +418,7 @@ static void cops_list_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
g_at_result_iter_init(&iter, result);
|
g_at_result_iter_init(&iter, result);
|
||||||
|
|
||||||
while (g_at_result_iter_next(&iter, "+COPS:")) {
|
while (g_at_result_iter_next(&iter, "+COPS:")) {
|
||||||
int status, tech;
|
int status, tech, plmn;
|
||||||
const char *l, *s, *n;
|
const char *l, *s, *n;
|
||||||
gboolean have_long = FALSE;
|
gboolean have_long = FALSE;
|
||||||
|
|
||||||
|
@ -459,6 +459,9 @@ static void cops_list_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
|
|
||||||
list[num].tech = tech;
|
list[num].tech = tech;
|
||||||
|
|
||||||
|
if (!g_at_result_iter_next_number(&iter, &plmn))
|
||||||
|
plmn = 0;
|
||||||
|
|
||||||
if (!g_at_result_iter_close_list(&iter))
|
if (!g_at_result_iter_close_list(&iter))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue