cdma: make ERI parsing generic
This commit is contained in:
@@ -1431,11 +1431,13 @@ reg_query_speri_done (MMAtSerialPort *port,
|
||||
{
|
||||
MMCallbackInfo *info = user_data;
|
||||
gboolean roam = FALSE;
|
||||
const char *p;
|
||||
|
||||
if (error)
|
||||
goto done;
|
||||
|
||||
if (!mm_cdma_parse_speri_response (response->str, &roam, NULL))
|
||||
p = mm_strip_tag (response->str, "$SPERI:");
|
||||
if (!p || !mm_cdma_parse_eri (p, &roam, NULL))
|
||||
goto done;
|
||||
|
||||
/* Change the 1x and EVDO registration states to roaming if they were
|
||||
|
@@ -686,11 +686,10 @@ static const EriItem eris[] = {
|
||||
};
|
||||
|
||||
gboolean
|
||||
mm_cdma_parse_speri_response (const char *reply,
|
||||
mm_cdma_parse_eri (const char *reply,
|
||||
gboolean *out_roaming,
|
||||
const char **out_desc)
|
||||
{
|
||||
const char *p;
|
||||
long int ind;
|
||||
const EriItem *iter = &eris[0];
|
||||
gboolean found = FALSE;
|
||||
@@ -698,9 +697,8 @@ mm_cdma_parse_speri_response (const char *reply,
|
||||
g_return_val_if_fail (reply != NULL, FALSE);
|
||||
g_return_val_if_fail (out_roaming != NULL, FALSE);
|
||||
|
||||
p = mm_strip_tag (reply, "$SPERI:");
|
||||
errno = 0;
|
||||
ind = strtol (p, NULL, 10);
|
||||
ind = strtol (reply, NULL, 10);
|
||||
if (errno == 0) {
|
||||
while (iter->num != -1) {
|
||||
if (iter->num == ind) {
|
||||
|
@@ -49,7 +49,7 @@ gboolean mm_cdma_parse_spservice_response (const char *reply,
|
||||
MMModemCdmaRegistrationState *out_cdma_1x_state,
|
||||
MMModemCdmaRegistrationState *out_evdo_state);
|
||||
|
||||
gboolean mm_cdma_parse_speri_response (const char *reply,
|
||||
gboolean mm_cdma_parse_eri (const char *reply,
|
||||
gboolean *out_roaming,
|
||||
const char **out_desc);
|
||||
|
||||
|
Reference in New Issue
Block a user