diff options
author | Dan Williams <dcbw@redhat.com> | 2011-04-18 22:48:05 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-04-18 22:48:05 -0500 |
commit | 76bdc658d31c8c64dd74a120ec68d8126dd273cf (patch) | |
tree | 285db946c21f859ebb40f592909d65fd8dab5f28 /plugins/mm-modem-icera.c | |
parent | 8333fb657ab6e30e51aec8f4449dc4c505fea6f4 (diff) |
samsung: use common Icera code
Port the differences over to the common Icera code (there were only
two) and remove the duplicate code from the Samsung plugin. The
Icera NWSTATE regex had to be adjusted to capture "-1" in the first
element which wasn't handled before but which I've seen on the
Samsung Y3300 before the card has registered.
Diffstat (limited to 'plugins/mm-modem-icera.c')
-rw-r--r-- | plugins/mm-modem-icera.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mm-modem-icera.c b/plugins/mm-modem-icera.c index 11f95b54..d34e71ee 100644 --- a/plugins/mm-modem-icera.c +++ b/plugins/mm-modem-icera.c @@ -172,12 +172,16 @@ static MMModemGsmAccessTech nwstate_to_act (const char *str) { /* small 'g' means CS, big 'G' means PS */ - if (!strcmp (str, "2G-GPRS")) + if (!strcmp (str, "2g")) + return MM_MODEM_GSM_ACCESS_TECH_GSM; + else if (!strcmp (str, "2G-GPRS")) return MM_MODEM_GSM_ACCESS_TECH_GPRS; else if (!strcmp (str, "2G-EDGE")) return MM_MODEM_GSM_ACCESS_TECH_EDGE; else if (!strcmp (str, "3G")) return MM_MODEM_GSM_ACCESS_TECH_UMTS; + else if (!strcmp (str, "3g")) + return MM_MODEM_GSM_ACCESS_TECH_UMTS; else if (!strcmp (str, "3G-HSDPA")) return MM_MODEM_GSM_ACCESS_TECH_HSDPA; else if (!strcmp (str, "3G-HSUPA")) @@ -671,7 +675,7 @@ mm_modem_icera_register_unsolicted_handlers (MMModemIcera *self, GRegex *regex; /* %NWSTATE: <rssi>,<mccmnc>,<tech>,<connected>,<regulation> */ - regex = g_regex_new ("\\r\\n%NWSTATE:\\s*(\\d+),(\\d+),([^,]*),([^,]*),(\\d+)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); + regex = g_regex_new ("\\r\\n%NWSTATE:\\s*(-?\\d+),(\\d+),([^,]*),([^,]*),(\\d+)\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); mm_at_serial_port_add_unsolicited_msg_handler (port, regex, nwstate_changed, self, NULL); g_regex_unref (regex); |