gsm: rework registration handling
First, generically handle registration polling if the device does not support unsolicited registration. Second, using the new creg/cgreg parsing functions from mm-modem-helpers.c, handle CREG=2 unsolicited registration replies to capture the GSM LAC/CI for the location information API. Because of these changes we can simplify the registration polling during connection as well by using the common registration parsing code and the cached registration state.
This commit is contained in:
@@ -647,8 +647,6 @@ grab_port (MMModem *modem,
|
||||
if (ptype == MM_PORT_TYPE_PRIMARY) {
|
||||
GRegex *regex;
|
||||
|
||||
mm_generic_gsm_set_unsolicited_registration (gsm, TRUE);
|
||||
|
||||
regex = g_regex_new ("_OWANCALL: (\\d),\\s*(\\d)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
|
||||
mm_serial_port_add_unsolicited_msg_handler (MM_SERIAL_PORT (port), regex, connection_enabled, modem, NULL);
|
||||
g_regex_unref (regex);
|
||||
|
||||
@@ -560,8 +560,6 @@ grab_port (MMModem *modem,
|
||||
if (ptype == MM_PORT_TYPE_SECONDARY) {
|
||||
GRegex *regex;
|
||||
|
||||
mm_generic_gsm_set_unsolicited_registration (MM_GENERIC_GSM (modem), TRUE);
|
||||
|
||||
regex = g_regex_new ("\\r\\n\\^RSSI:(\\d+)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
|
||||
mm_serial_port_add_unsolicited_msg_handler (MM_SERIAL_PORT (port), regex, handle_signal_quality_change, modem, NULL);
|
||||
g_regex_unref (regex);
|
||||
|
||||
@@ -747,8 +747,6 @@ grab_port (MMModem *modem,
|
||||
if (port && MM_IS_SERIAL_PORT (port) && (ptype == MM_PORT_TYPE_PRIMARY)) {
|
||||
GRegex *regex;
|
||||
|
||||
mm_generic_gsm_set_unsolicited_registration (MM_GENERIC_GSM (modem), TRUE);
|
||||
|
||||
regex = g_regex_new ("\\r\\n\\*EMRDY: \\d\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
|
||||
mm_serial_port_add_unsolicited_msg_handler (MM_SERIAL_PORT (port), regex, mbm_emrdy_received, modem, NULL);
|
||||
g_regex_unref (regex);
|
||||
|
||||
@@ -211,7 +211,6 @@ grab_port (MMModem *modem,
|
||||
if (port && MM_IS_SERIAL_PORT (port)) {
|
||||
GRegex *regex;
|
||||
|
||||
mm_generic_gsm_set_unsolicited_registration (gsm, TRUE);
|
||||
g_object_set (port, MM_PORT_CARRIER_DETECT, FALSE, NULL);
|
||||
|
||||
regex = g_regex_new ("\\r\\n\\+ZUSIMR:(.*)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
|
||||
|
||||
Reference in New Issue
Block a user