Commit Graph

61 Commits

Author SHA1 Message Date
Ben Chan
b5ef861d12 modem-helpers,sim: auto-detect if ICCID response is character swapped
This patch modifies mm_3gpp_parse_iccid() to auto-detect if an ICCID
response is character swapped or not by comparsing the major industry
identifier part of the ICCID response to the known value (89) for
telecommunication purposes. This addresses the issue where the same AT
command (e.g. AT^ICCID used by the huawei plugin) does not report ICCID
in a consistent format.
2013-09-26 20:23:51 +02:00
Dan Williams
11a7e3dfdf core: add helper for parsing and validating the ICCID 2013-09-10 09:42:36 +02:00
Aleksander Morgado
700ebc5c07 api,introspection: rename 'ModemCapabilities' to 'SupportedCapabilities'
And also make it a list of masks, specifying which are the specific combinations
supported, not just one mask with all.

E.g.:
  -------------------------
  Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
           |          model: 'MC7710'
           |       revision: 'SWI9200X_03.05.19.04ap r5475 carmd-en-10527 2012/09/17 17:57:14'
           |      supported: 'gsm-umts
           |                  gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '358178040668164'
2013-06-05 19:15:15 +02:00
Aleksander Morgado
45ceba7692 api,introspection: 'SupportedModes' is now a list of possible combinations
Instead of just a mask of MMModemMode values, we now provide a list of the
allowed and preferred mode combinations supported by the modem. E.g.:

$> sudo mmcli -m 0
  -------------------------
  Modes    |      supported: 'allowed: 2g; preferred: none
           |                  allowed: 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: 2g
           |                  allowed: 2g, 3g; preferred: 3g
           |                  allowed: 4g; preferred: none
           |                  allowed: 2g, 3g, 4g; preferred: none'
2013-06-05 19:15:14 +02:00
Aleksander Morgado
2acb125819 modem-helpers: new CGDCONT=? test response parser 2013-06-05 19:15:13 +02: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
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
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
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
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
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
680e292914 build: fix header dependencies
We shouldn't depend on any header file from the previous implementation.
2012-03-16 14:28:15 +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
09adad847e modem-helpers: new CPMS format result parser 2012-03-15 14:15:03 +01:00
Aleksander Morgado
3912bf062e modem-helpers: new common CMTI regex getter 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
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
9efabb8fcb modem-helpers: new CDMA helper parsers 2012-03-15 14:14:45 +01:00
Aleksander Morgado
ffae95a46b iface-modem: new helpers to check if modem has LTE capabilities 2012-03-15 14:14:43 +01:00
Aleksander Morgado
d5e6776a52 modem-helpers: new common regex for CIEV unsolicited messages 2012-03-15 14:14:40 +01:00
Aleksander Morgado
4387fa183c broadband-modem: use new common method to check if modem is 3GPP 2012-03-15 14:14:37 +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
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
Aleksander Morgado
430878c452 modem-helpers: use MMModem3gppRegistrationState when parsing C(G)REG responses 2012-03-15 14:14:29 +01:00
Eric Shienbrood
eede5bb621 gsm: add new property to track which facility locks are enabled
The property EnabledFacilityLocks on the .Modem.Gsm.Card interface
is a bit mask that indicates which of the various personalization
codes from 3GPP TS 22.022, plus the SIM PIN lock and SIM PIN2 lock,
are enabled. The set of facility locks supported by the modem is
determined at the time the modem is initialized, and the state of
each supported lock (enabled or disabled) is determined. When the
state of a lock changes, a property-change signal is sent out. Note
that ModemManager only supports enabling and disabling SIM-PIN, via
the EnablePin method on Modem.Gsm.Card.
2011-11-16 23:41:49 -06:00
Aleksander Morgado
ea23851326 api: use common ModemManager.h for API, core and plugins 2011-08-19 22:54:48 +02:00
Dan Williams
16039244bb core: rework logging
Make it more flexible, add logging to a file, and absolute and
relative timestamps.
2011-01-23 20:51:48 -06:00
Dan Williams
ea0797cbec gsm: prefer AT+CIND signal quality for modems that support it (lp:682282) (bgo #636040)
Some devices always reply with 99 for AT+CSQ when in UMTS mode (Linktop LW273)
so if the modem supports it, use CIND/CIEV instead.
2010-11-30 10:04:46 -06:00
Dan Williams
2dd59c3ddd core: add index to CIND helper 2010-11-28 21:34:00 -06:00
Dan Williams
9479c04aec core: add +CIND parsing helpers 2010-11-28 19:45:53 -06:00
Dan Williams
7ae8ffe21b core: use hardware IDs as part of DeviceIdentifier
Pass the device's hardware IDs through modem creation and use them
when calculating the device's identifier.  Add a bunch of testcases
for real hardware to ensure we don't break the device ID in the
future unless we really want to.
2010-10-22 11:06:48 -05:00
Dan Williams
328d2369a9 core: add DeviceIdentifier property
This is computed before any PIN is entered, and thus before we can
usually get IMEI or MEID/ESN out of the device in many cases. It's
therefore not the same as EquipmentIdentifier.

This is intended to be used by UI programs for matching devices with
PIN numbers for automatic unlocking.  While the PIN number is actually
*SIM* specific, no modems allow access to the IMSI before the PIN is
entered, and thus we cannot actually match the PIN with the SIM.  The
device ID is the next best thing we can use and should allow auto
unlocking in most cases.
2010-10-21 16:57:37 -05:00