Commit Graph

84 Commits

Author SHA1 Message Date
Aleksander Morgado
804642adc2 api: let MMBearerIpFamily be flags instead of a enumeration
We want to expose in the Modem interface the list of supported IP families, and
the easiest way to do so is to have the IP family as flags, and provide in the
interface a single enum.

Also, a value of 0 for a MMBearerIpFamily specifies that no flags are set, so
just rename it to 'NONE'.

And add a new 'ANY' value which sets all flags to 1.
2013-06-05 19:15:13 +02:00
Dan Williams
93fcaf93ce modem-helpers: handle commas within +COPS response items (bgo #701329)
Modems can probably put whatever they want between the quotes for
the operator name, including commas.  Handle that.

https://bugzilla.gnome.org/show_bug.cgi?id=701329
2013-05-31 13:13:09 -05:00
Dan Williams
2e8866c8b7 time: normalize GetNetworkTime() response to local time + timezone info (bgo #697372)
The GetNetworkTime() response is defined to be an ISO8601 string, which
is in turn defined to be in local time.  Make sure that's reflected in
the documentation, and append the timezone offset to UTC where we have
it.

Oddly, Icera devices return their time info in UTC with an offset to
the local timezone, so we have to jump through some hoops there to
convert the response to localtime based on the reported offset.

Some additional fixes by Aleksander Morgado <aleksander@lanedo.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=697372
2013-04-25 15:14:14 -05:00
Aleksander Morgado
40dc35a657 modem-helpers: ensure error is set when +CRM response parser doesn't match 2013-04-25 09:36:51 +02:00
Aleksander Morgado
c1e70924d8 broadband-modem: update CMGL parsing logic
Pantech UMW190 modem uses a custom +CMGL response which includes only
three fields before the actual PDU, e.g:

  +CMGL: <index>,<status>,<something>\r\n<PDU>

instead of what we had before:

  +CMGL: <index>,<status>,<alpha>,<length>\r\n<PDU>

The CMGL parsing logic is now updated to use a regex to match the reply, and
also considering the UMW190 specific case.

Actually, we end up reading only the two first fields (index and status) which
are the ones we really need, so we skip the <length> and the <alpha> if given.

Added also unit tests to cover all these known cases.

Partially fixes https://bugzilla.gnome.org/show_bug.cgi?id=696723 (missing the
actual PDU parsing fixes).
2013-04-02 09:53:46 +02:00
Dan Williams
3b3326bdf0 broadband-modem: parse +GSN response for IMEI, MEID, and ESN (bgo #696596)
+GSN response differs widely between modems.  Some prefix the
MEID and/or ESN with 0x, some have leading zeros, some return the
MEID and the ESN, and some append the serial number to the end of
the IMEI.  Handle that and make the ESN, MEID, IMEI, and
EquipmentIdentifier parsing consistent.
2013-03-27 08:23:52 -05:00
Ben Chan
85b67ed8d9 modem: use +CEREG to determine EPS network registration status
This patch adds the support for solicited/unsolicited EPS network
registration status via AT+CEREG, which is configurable via the
'iface-modem-3gpp-eps-network-supported' property of the
MMIfaceModem3gpp interface and is disabled by default.
2013-02-15 08:53:45 +01:00
Dan Williams
75731cf21c modem-helpers: add EVDO rev. B and "CDMA2000 1X" to access tech helper
Some Huawei modems report these, and we may use the generic helper
in the future.
2012-12-05 11:43:58 -06:00
Jiří Klimeš
e97b229e66 core: fix possible crash in g_utf8_validate()
We can skip additional UTF-8 validity check when parsing operator.
mm_charset_take_and_convert_to_utf8() already does a UTF-8 validity check
internally before returning the string, so it's pointless to do a new one
on the returned string.
Plus, mm_charset_take_and_convert_to_utf8() may really return NULL, which
would end up in segfaulting as g_utf8_validate() expects always a non-NULL
string.

Based on 219424a6e2d017491a05ecbed661bccde3f991ef (MM_06 branch)
2012-11-27 13:25:25 +01:00
Aleksander Morgado
b317996a8e iface-modem: always ensure that current bands is a subset of supported bands
In QMI modems the logic behind supported and current bands is completely
separated in different services (DMS vs NAS). Actually, the list reported by NAS
as current band preferences seems to include more values than the ones reported
by DMS as supported bands (e.g. CDMA bands are reported even if the firmware
image is GSM/HSPA only).

So, just clean up the list of current preferred bands so that no more than those
given as supported is used.
2012-10-22 19:06:49 +02:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only.

We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI'
symbols, which if included before the `libmm-glib.h' library allow us to:

 * Don't include the libmm-glib high level API in the ModemManager daemon, as
   the object names would clash with those in the core.

 * Define some of the methods of helper objects to be included only if compiling
   ModemManager daemon or the mmcli.
2012-10-04 10:17:12 +02:00
Ben Chan
6124022ab3 modem-helpers: handle the case when operator name is "Unknown"
Some modems report "Unknown" as the operator name when failed to obtain
the actual value:

    --> 'AT+COPS=3,0;+COPS?<CR>'
    <-- '<CR><LF>+COPS: 0,0,"Unknown",0<CR><LF><CR><LF>OK<CR><LF>'

This patch prevents "Unknown" from being treated as a valid operator name.
2012-09-20 12:02:06 -05:00
Aleksander Morgado
a6faae3260 broadband-modem: skip +CGMM: prefix when loading device model
Some devices, e.g. ZTE MF820D, seem to prefix the `AT+CGMM?' response with the
`+CGMM:' string, resulting in the following model string being loaded:

   model: '+CGMM: "MF820D"'

Avoid this by:
 1) Removing the expected prefixes.
 2) Unquoting the resulting string.

Reported by: Marius Kotsbak <marius.kotsbak@gmail.com>
2012-09-19 07:42:47 +02:00
Aleksander Morgado
8acaf7baa7 broadband-modem: process not-stored SMS part indications 2012-09-14 07:05:24 +02:00
Marius B. Kotsbak
5eab715bb6 modem-helpers: recognize "4G" as LTE access technology
Some modems (e.g. ZTE MF 820D) report LTE access technology as "4G":
  +ZPAS: "4G","PS_ONLY"
2012-09-02 15:32:59 +02:00
Aleksander Morgado
529eecdb97 modem-helpers: new helper to convert from netmask string to CIDR 2012-08-31 15:11:29 +02:00
Aleksander Morgado
51678e141b modem-helpers: new method to validate and/or parse MCC/MNC operator ID string 2012-08-29 17:26:44 +02:00
Aleksander Morgado
5764d39689 modem-helpers: ERI parser is generic enough, not just for !SPERI 2012-08-23 18:56:22 +02:00
Aleksander Morgado
1ac18a06bb api,dbus: 'ip-type' property now given as a MMBearerIpFamily (u)
Instead of using a predefined set of string values for 'ip-type' in
Modem.CreateBearer() and Simple.Connect(), we'll use an enumeration. The
implementation will then need to convert the requested IP family type to e.g.
the correct PDP type in 3GPP modems.

This change also consolidates the use of enums in dictionary properties when
possible to do so, as with the Rm Protocol.
2012-08-22 09:38:21 +02:00
Dan Williams
90f4a034b2 modem-helpers: recognize 3GPP2 access tech strings too
Various Gobi-based devices (USB551L, probably Gobis too) can report
EVDO and 1X as the current RAT from CNTI so parse that here too.
2012-05-04 17:38:36 -05:00
Nathan Williams
01a17f5c6c helpers: adjust parsing of +CNUM response to permit spaces in the alphanumeric descriptor.
This permits matching a response such as '"Line 1","+19999999999",145',
which previously did not match.

Change-Id: I666af8774507c6c3b3e214b820449542065dd8b4
2012-04-13 23:35:13 +02:00
Aleksander Morgado
46d16d5c99 libmm-common: new common uint/int/str parsers 2012-03-18 17:28:14 +01:00
Aleksander Morgado
1f250585dd modem-helpers: refactor and reorganize sources 2012-03-16 14:53:21 +01:00
Aleksander Morgado
51c28d0f79 modem-helpers: new +CNUM response parser and tests 2012-03-16 14:53:21 +01:00
Aleksander Morgado
75a2b407bd modem-helpers: port facility lock related helpers to use `MMModemFacility' enums 2012-03-16 14:53:18 +01:00
Aleksander Morgado
8b78e037a2 modem-helpers: temporarily disable facility-related helpers 2012-03-16 14:53:17 +01:00
Aleksander Morgado
1359c0a928 modem-helpers: updated the string to access technology converter
We can now return a mask of flags specifying more than one access technology,
and therefore the order is not really important any more, unless for special
cases like looking for substrings of valid expected strings (e.g "HSPA" and
"HSPA+").

Also, add "LTE" in the list of expected strings.
2012-03-16 14:28:14 +01:00
Aleksander Morgado
2a12322a80 modem-helpers: allow leading zeroes in CREG/CGREG responses 2012-03-15 14:15:06 +01:00
Aleksander Morgado
09adad847e modem-helpers: new CPMS format result parser 2012-03-15 14:15:03 +01:00
Aleksander Morgado
61697b0054 modem-helpers: use new common charset converter when parsing operator name/code
This is the port of commit 4af8483ae4 into the
06-api branch.
2012-03-15 14:15:00 +01:00
Aleksander Morgado
3912bf062e modem-helpers: new common CMTI regex getter 2012-03-15 14:15:00 +01:00
Aleksander Morgado
aee2b32a35 modem-helpers: allow strings instead of indexes in CIEV unsolicited events
Some modems will report strings instead of indicator indexes, like:
 +CIEV: roam,1

So allow non-integer indicators.
2012-03-15 14:15:00 +01:00
Aleksander Morgado
18ca53b667 modem-helpers: update the regex for the AT+CIND=? response
Cinterion modems seem to include
   "signal",(0-7,99)

We just get rid of the ',99' part.
2012-03-15 14:15:00 +01:00
Aleksander Morgado
2bb43e0020 modem-helpers: new CMGF format query result parser 2012-03-15 14:14:58 +01:00
Aleksander Morgado
f37a1a2b62 modem-helpers: new method to get common CUSD regex 2012-03-15 14:14:56 +01:00
Aleksander Morgado
7e36f04b37 core: use new enums/flags string getters/builders 2012-03-15 14:14:52 +01:00
Aleksander Morgado
4e06e0e67d bearer-cdma: implement bearer connection and disconnection 2012-03-15 14:14:48 +01:00
Aleksander Morgado
d1cfdd974c bearer-cdma: when specific RM protocol given to be used, ensure it is supported
If the requested RM protocol is not supported, the CDMA Bearer creation will
fail.
2012-03-15 14:14:48 +01:00
Aleksander Morgado
48d5ac6682 core: use g_list_free_full() when possible 2012-03-15 14:14:46 +01:00
Aleksander Morgado
9efabb8fcb modem-helpers: new CDMA helper parsers 2012-03-15 14:14:45 +01:00
Aleksander Morgado
d5e6776a52 modem-helpers: new common regex for CIEV unsolicited messages 2012-03-15 14:14:40 +01:00
Aleksander Morgado
6cce67a451 modem-helpers: MMModemAccessTechnology is flags, not enum 2012-03-15 14:14:36 +01:00
Aleksander Morgado
516b097331 api,enums: renamed MMModemAccessTech' to MMModemAccessTechnology'
This one was the last enum without full name.
2012-03-15 14:14:35 +01:00
Aleksander Morgado
b6a3ccd578 modem-helpers: renamed 3GPP registration related helpers with `mm_3gpp' prefix 2012-03-15 14:14:35 +01:00
Aleksander Morgado
cadc27ca0e core,libmm-glib: include ony `libmm-common.h'
Don't include one by one all the headers from libmm-common, just include the
global `libmm-common.h' which includes all the others.
2012-03-15 14:14:34 +01:00
Aleksander Morgado
5f4655c574 helpers: implement CGDCONT reply parsing
New method to parse the PDP query reply, and build a list of structs with the
found info.
2012-03-15 14:14:33 +01:00
Aleksander Morgado
3dcdc3c920 modem-helpers: new helper to count number of bits set in a bitmask 2012-03-15 14:14:32 +01:00
Aleksander Morgado
a92e9c59c1 modem-helpers: provide list of scanned networks in a list of structs
We provide the result of the +COPS=? parsing in a GList of MM3gppNetworkInfo
structures. We avoid the previous hash table, or using a dictionary, as a
list of structs with a predefined set of elements, which should be easier for
plugins wanting to make their own version
2012-03-15 14:14:30 +01:00
Aleksander Morgado
0c7281b2d9 broadband-modem: implement Operator Code and Name loading 2012-03-15 14:14:30 +01:00
Aleksander Morgado
5805a931e6 modem-helpers: use MMModemAccessTech when parsing C(G)REG responses 2012-03-15 14:14:29 +01:00