cdma: make ERI parsing generic

This commit is contained in:
Dan Williams
2010-05-18 12:24:42 -07:00
parent 40a4a1d774
commit 533ffaddc4
3 changed files with 10 additions and 10 deletions

View File

@@ -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

View File

@@ -686,11 +686,10 @@ static const EriItem eris[] = {
};
gboolean
mm_cdma_parse_speri_response (const char *reply,
gboolean *out_roaming,
const char **out_desc)
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) {

View File

@@ -49,9 +49,9 @@ 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 *out_roaming,
const char **out_desc);
gboolean mm_cdma_parse_eri (const char *reply,
gboolean *out_roaming,
const char **out_desc);
gboolean mm_gsm_parse_cscs_support_response (const char *reply,
MMModemCharset *out_charsets);