modem-helpers: ERI parser is generic enough, not just for !SPERI
This commit is contained in:
@@ -616,7 +616,7 @@ parse_modem_snapshot (DetailedRegistrationStateContext *ctx,
|
||||
gboolean roaming = FALSE;
|
||||
|
||||
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;
|
||||
if (ctx->state.detailed_cdma1x_state != MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN)
|
||||
ctx->state.detailed_cdma1x_state = new_state;
|
||||
|
@@ -5640,7 +5640,7 @@ speri_ready (MMIfaceModemCdma *self,
|
||||
/* Try to parse the results */
|
||||
response = mm_strip_tag (response, "$SPERI:");
|
||||
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);
|
||||
detailed_registration_state_context_complete_and_free (ctx);
|
||||
return;
|
||||
|
@@ -1701,10 +1701,10 @@ static const EriItem eris[] = {
|
||||
};
|
||||
|
||||
gboolean
|
||||
mm_cdma_parse_speri_read_response (const gchar *reply,
|
||||
gboolean *out_roaming,
|
||||
guint *out_ind,
|
||||
const gchar **out_desc)
|
||||
mm_cdma_parse_eri (const gchar *reply,
|
||||
gboolean *out_roaming,
|
||||
guint *out_ind,
|
||||
const gchar **out_desc)
|
||||
{
|
||||
guint ind;
|
||||
const EriItem *iter = &eris[0];
|
||||
|
@@ -164,11 +164,11 @@ gboolean mm_cdma_parse_spservice_read_response (const gchar *reply,
|
||||
MMModemCdmaRegistrationState *out_cdma_1x_state,
|
||||
MMModemCdmaRegistrationState *out_evdo_state);
|
||||
|
||||
/* AT$SPERI? response parser */
|
||||
gboolean mm_cdma_parse_speri_read_response (const gchar *reply,
|
||||
gboolean *out_roaming,
|
||||
guint32 *out_ind,
|
||||
const gchar **out_desc);
|
||||
/* Generic ERI response parser */
|
||||
gboolean mm_cdma_parse_eri (const gchar *reply,
|
||||
gboolean *out_roaming,
|
||||
guint32 *out_ind,
|
||||
const gchar **out_desc);
|
||||
|
||||
/* AT+CRM=? response parser */
|
||||
gboolean mm_cdma_parse_crm_test_response (const gchar *reply,
|
||||
|
Reference in New Issue
Block a user