modem-helpers: ERI parser is generic enough, not just for !SPERI

This commit is contained in:
Aleksander Morgado
2012-08-23 11:42:50 +02:00
parent 86e7b0e8c6
commit 5764d39689
4 changed files with 11 additions and 11 deletions

View File

@@ -616,7 +616,7 @@ parse_modem_snapshot (DetailedRegistrationStateContext *ctx,
gboolean roaming = FALSE; gboolean roaming = FALSE;
str = g_strdup_printf ("%u", eri); str = g_strdup_printf ("%u", eri);
if (mm_cdma_parse_speri_read_response (str, &roaming, NULL, NULL)) { if (mm_cdma_parse_eri (str, &roaming, NULL, NULL)) {
new_state = roaming ? MM_MODEM_CDMA_REGISTRATION_STATE_HOME : MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING; new_state = roaming ? MM_MODEM_CDMA_REGISTRATION_STATE_HOME : MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING;
if (ctx->state.detailed_cdma1x_state != MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN) if (ctx->state.detailed_cdma1x_state != MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN)
ctx->state.detailed_cdma1x_state = new_state; ctx->state.detailed_cdma1x_state = new_state;

View File

@@ -5640,7 +5640,7 @@ speri_ready (MMIfaceModemCdma *self,
/* Try to parse the results */ /* Try to parse the results */
response = mm_strip_tag (response, "$SPERI:"); response = mm_strip_tag (response, "$SPERI:");
if (!response || if (!response ||
!mm_cdma_parse_speri_read_response (response, &roaming, NULL, NULL)) { !mm_cdma_parse_eri (response, &roaming, NULL, NULL)) {
mm_warn ("Couldn't parse SPERI response '%s'", response); mm_warn ("Couldn't parse SPERI response '%s'", response);
detailed_registration_state_context_complete_and_free (ctx); detailed_registration_state_context_complete_and_free (ctx);
return; return;

View File

@@ -1701,7 +1701,7 @@ static const EriItem eris[] = {
}; };
gboolean gboolean
mm_cdma_parse_speri_read_response (const gchar *reply, mm_cdma_parse_eri (const gchar *reply,
gboolean *out_roaming, gboolean *out_roaming,
guint *out_ind, guint *out_ind,
const gchar **out_desc) const gchar **out_desc)

View File

@@ -164,8 +164,8 @@ gboolean mm_cdma_parse_spservice_read_response (const gchar *reply,
MMModemCdmaRegistrationState *out_cdma_1x_state, MMModemCdmaRegistrationState *out_cdma_1x_state,
MMModemCdmaRegistrationState *out_evdo_state); MMModemCdmaRegistrationState *out_evdo_state);
/* AT$SPERI? response parser */ /* Generic ERI response parser */
gboolean mm_cdma_parse_speri_read_response (const gchar *reply, gboolean mm_cdma_parse_eri (const gchar *reply,
gboolean *out_roaming, gboolean *out_roaming,
guint32 *out_ind, guint32 *out_ind,
const gchar **out_desc); const gchar **out_desc);