modem-helpers: renamed 3GPP registration related helpers with `mm_3gpp' prefix
This commit is contained in:
@@ -235,7 +235,7 @@ mm_base_modem_grab_port (MMBaseModem *self,
|
||||
mm_serial_parser_v1_destroy);
|
||||
|
||||
/* Set up CREG unsolicited message handlers, with NULL callbacks */
|
||||
array = mm_gsm_creg_regex_get (FALSE);
|
||||
array = mm_3gpp_creg_regex_get (FALSE);
|
||||
for (i = 0; i < array->len; i++) {
|
||||
mm_at_serial_port_add_unsolicited_msg_handler (MM_AT_SERIAL_PORT (port),
|
||||
(GRegex *)g_ptr_array_index (array, i),
|
||||
@@ -243,7 +243,7 @@ mm_base_modem_grab_port (MMBaseModem *self,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
mm_gsm_creg_regex_destroy (array);
|
||||
mm_3gpp_creg_regex_destroy (array);
|
||||
|
||||
/* { */
|
||||
/* regex = g_regex_new ("\\r\\n\\+CIEV: (\\d+),(\\d)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); */
|
||||
|
@@ -1114,13 +1114,13 @@ reg_state_changed (MMAtSerialPort *port,
|
||||
gboolean cgreg = FALSE;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_gsm_parse_creg_response (match_info,
|
||||
&state,
|
||||
&lac,
|
||||
&cell_id,
|
||||
&act,
|
||||
&cgreg,
|
||||
&error)) {
|
||||
if (!mm_3gpp_parse_creg_response (match_info,
|
||||
&state,
|
||||
&lac,
|
||||
&cell_id,
|
||||
&act,
|
||||
&cgreg,
|
||||
&error)) {
|
||||
mm_warn ("error parsing unsolicited registration: %s",
|
||||
error && error->message ? error->message : "(unknown)");
|
||||
g_clear_error (&error);
|
||||
@@ -1172,7 +1172,7 @@ setup_unsolicited_registration (MMIfaceModem3gpp *self,
|
||||
ports[1] = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self));
|
||||
|
||||
/* Set up CREG unsolicited message handlers in both ports */
|
||||
array = mm_gsm_creg_regex_get (FALSE);
|
||||
array = mm_3gpp_creg_regex_get (FALSE);
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (ports[i]) {
|
||||
guint j;
|
||||
@@ -1187,7 +1187,7 @@ setup_unsolicited_registration (MMIfaceModem3gpp *self,
|
||||
}
|
||||
}
|
||||
}
|
||||
mm_gsm_creg_regex_destroy (array);
|
||||
mm_3gpp_creg_regex_destroy (array);
|
||||
|
||||
g_simple_async_result_set_op_res_gboolean (result, TRUE);
|
||||
g_simple_async_result_complete_in_idle (result);
|
||||
@@ -1229,7 +1229,7 @@ cleanup_unsolicited_registration (MMIfaceModem3gpp *self,
|
||||
ports[1] = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self));
|
||||
|
||||
/* Set up CREG unsolicited message handlers in both ports */
|
||||
array = mm_gsm_creg_regex_get (FALSE);
|
||||
array = mm_3gpp_creg_regex_get (FALSE);
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (ports[i]) {
|
||||
guint j;
|
||||
@@ -1244,7 +1244,7 @@ cleanup_unsolicited_registration (MMIfaceModem3gpp *self,
|
||||
}
|
||||
}
|
||||
}
|
||||
mm_gsm_creg_regex_destroy (array);
|
||||
mm_3gpp_creg_regex_destroy (array);
|
||||
|
||||
g_simple_async_result_set_op_res_gboolean (result, TRUE);
|
||||
g_simple_async_result_complete_in_idle (result);
|
||||
@@ -1576,13 +1576,13 @@ registration_status_check_ready (MMBroadbandModem *self,
|
||||
gulong lac = 0;
|
||||
gulong cid = 0;
|
||||
|
||||
parsed = mm_gsm_parse_creg_response (match_info,
|
||||
&state,
|
||||
&lac,
|
||||
&cid,
|
||||
&act,
|
||||
&cgreg,
|
||||
&inner_error);
|
||||
parsed = mm_3gpp_parse_creg_response (match_info,
|
||||
&state,
|
||||
&lac,
|
||||
&cid,
|
||||
&act,
|
||||
&cgreg,
|
||||
&inner_error);
|
||||
g_match_info_free (match_info);
|
||||
|
||||
if (!parsed) {
|
||||
@@ -2547,7 +2547,7 @@ mm_broadband_modem_init (MMBroadbandModem *self)
|
||||
self->priv->modem_state = MM_MODEM_STATE_UNKNOWN;
|
||||
self->priv->modem_current_capabilities = MM_MODEM_CAPABILITY_NONE;
|
||||
self->priv->modem_3gpp_registration_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
self->priv->reg_regex = mm_gsm_creg_regex_get (TRUE);
|
||||
self->priv->reg_regex = mm_3gpp_creg_regex_get (TRUE);
|
||||
self->priv->reg_cs = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
self->priv->reg_ps = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
self->priv->current_charset = MM_MODEM_CHARSET_UNKNOWN;
|
||||
@@ -2559,7 +2559,7 @@ finalize (GObject *object)
|
||||
MMBroadbandModem *self = MM_BROADBAND_MODEM (object);
|
||||
|
||||
if (self->priv->reg_regex)
|
||||
mm_gsm_creg_regex_destroy (self->priv->reg_regex);
|
||||
mm_3gpp_creg_regex_destroy (self->priv->reg_regex);
|
||||
|
||||
G_OBJECT_CLASS (mm_broadband_modem_parent_class)->finalize (object);
|
||||
}
|
||||
|
@@ -410,7 +410,7 @@ mm_3gpp_parse_pdp_query_response (const gchar *reply,
|
||||
#define CREG8 "\\+(CREG|CGREG):\\s*(\\d{1})\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*(\\d{1,2})\\s*,\\s*([^,\\s]*)"
|
||||
|
||||
GPtrArray *
|
||||
mm_gsm_creg_regex_get (gboolean solicited)
|
||||
mm_3gpp_creg_regex_get (gboolean solicited)
|
||||
{
|
||||
GPtrArray *array = g_ptr_array_sized_new (7);
|
||||
GRegex *regex;
|
||||
@@ -483,7 +483,7 @@ mm_gsm_creg_regex_get (gboolean solicited)
|
||||
}
|
||||
|
||||
void
|
||||
mm_gsm_creg_regex_destroy (GPtrArray *array)
|
||||
mm_3gpp_creg_regex_destroy (GPtrArray *array)
|
||||
{
|
||||
g_ptr_array_foreach (array, (GFunc) g_regex_unref, NULL);
|
||||
g_ptr_array_free (array, TRUE);
|
||||
@@ -531,13 +531,13 @@ item_is_lac_not_stat (GMatchInfo *info, guint32 item)
|
||||
}
|
||||
|
||||
gboolean
|
||||
mm_gsm_parse_creg_response (GMatchInfo *info,
|
||||
MMModem3gppRegistrationState *out_reg_state,
|
||||
gulong *out_lac,
|
||||
gulong *out_ci,
|
||||
MMModemAccessTech *out_act,
|
||||
gboolean *out_cgreg,
|
||||
GError **error)
|
||||
mm_3gpp_parse_creg_response (GMatchInfo *info,
|
||||
MMModem3gppRegistrationState *out_reg_state,
|
||||
gulong *out_lac,
|
||||
gulong *out_ci,
|
||||
MMModemAccessTech *out_act,
|
||||
gboolean *out_cgreg,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success = FALSE, foo;
|
||||
gint n_matches, act = -1;
|
||||
|
@@ -46,17 +46,15 @@ void mm_3gpp_pdp_context_list_free (GList *pdp_list);
|
||||
GList *mm_3gpp_parse_pdp_query_response (const gchar *reply,
|
||||
GError **error);
|
||||
|
||||
GPtrArray *mm_gsm_creg_regex_get (gboolean solicited);
|
||||
|
||||
void mm_gsm_creg_regex_destroy (GPtrArray *array);
|
||||
|
||||
gboolean mm_gsm_parse_creg_response (GMatchInfo *info,
|
||||
MMModem3gppRegistrationState *out_reg_state,
|
||||
gulong *out_lac,
|
||||
gulong *out_ci,
|
||||
MMModemAccessTech *out_act,
|
||||
gboolean *out_cgreg,
|
||||
GError **error);
|
||||
GPtrArray *mm_3gpp_creg_regex_get (gboolean solicited);
|
||||
void mm_3gpp_creg_regex_destroy (GPtrArray *array);
|
||||
gboolean mm_3gpp_parse_creg_response (GMatchInfo *info,
|
||||
MMModem3gppRegistrationState *out_reg_state,
|
||||
gulong *out_lac,
|
||||
gulong *out_ci,
|
||||
MMModemAccessTech *out_act,
|
||||
gboolean *out_cgreg,
|
||||
GError **error);
|
||||
|
||||
const char *mm_strip_tag (const char *str, const char *cmd);
|
||||
|
||||
|
@@ -495,7 +495,7 @@ test_creg_match (const char *test,
|
||||
g_assert (info != NULL);
|
||||
g_assert_cmpuint (regex_num, ==, result->regex_num);
|
||||
|
||||
success = mm_gsm_parse_creg_response (info, &state, &lac, &ci, &access_tech, &cgreg, &error);
|
||||
success = mm_3gpp_parse_creg_response (info, &state, &lac, &ci, &access_tech, &cgreg, &error);
|
||||
g_assert (success);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpuint (state, ==, result->state);
|
||||
@@ -1234,16 +1234,16 @@ test_data_new (void)
|
||||
TestData *data;
|
||||
|
||||
data = g_malloc0 (sizeof (TestData));
|
||||
data->solicited_creg = mm_gsm_creg_regex_get (TRUE);
|
||||
data->unsolicited_creg = mm_gsm_creg_regex_get (FALSE);
|
||||
data->solicited_creg = mm_3gpp_creg_regex_get (TRUE);
|
||||
data->unsolicited_creg = mm_3gpp_creg_regex_get (FALSE);
|
||||
return data;
|
||||
}
|
||||
|
||||
static void
|
||||
test_data_free (TestData *data)
|
||||
{
|
||||
mm_gsm_creg_regex_destroy (data->solicited_creg);
|
||||
mm_gsm_creg_regex_destroy (data->unsolicited_creg);
|
||||
mm_3gpp_creg_regex_destroy (data->solicited_creg);
|
||||
mm_3gpp_creg_regex_destroy (data->unsolicited_creg);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user