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;
|
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;
|
||||||
|
@@ -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;
|
||||||
|
@@ -1701,10 +1701,10 @@ 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)
|
||||||
{
|
{
|
||||||
guint ind;
|
guint ind;
|
||||||
const EriItem *iter = &eris[0];
|
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_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);
|
||||||
|
|
||||||
/* AT+CRM=? response parser */
|
/* AT+CRM=? response parser */
|
||||||
gboolean mm_cdma_parse_crm_test_response (const gchar *reply,
|
gboolean mm_cdma_parse_crm_test_response (const gchar *reply,
|
||||||
|
Reference in New Issue
Block a user