Commit Graph

97 Commits

Author SHA1 Message Date
Dan Williams
9bbcd9d6a5 sms: add support for message class
We need to redefine the message class property to int since class
0 is a valid message class.  Thus -1 now means "unspecified class".
2013-05-06 10:45:55 -05:00
Aleksander Morgado
31215aba32 modem-helpers-qmi: explicitly add LTE as current cap if modem caps report it
For loading current capabilities we use a mix of "Technology Preference" (TP),
"System Selection Preference" (SSP) and DMS-reported capabilities. But, as we
also use TP and SSP for allowed modes, it may be the case that we end up
leaving 4G out of the allowed modes, which afterwards will make the modem not
report LTE as current capabilitiy, as TP/SSP don't include LTE.

So, just assume LTE is a current capability if DMS-reported capabilities include
it. We can really do this because LTE is the only 4G technology, the same logic
wouldn't apply correctly for 2G or 3G (due to having different techs for 3GPP
and 3GPP2).
2013-04-11 09:17:13 +02:00
Aleksander Morgado
162d96b116 test-modem-helpers-qmi: new unit tests to check the 'current-capabilities' logic
Based on Dan's tests with QMI modems.
2013-04-11 09:17:13 +02:00
Aleksander Morgado
f9105bff87 api,introspection: update 'Validity' property in the SMS interface
We don't want to support only 'relative' validity, so don't assume that the
Validity property will always be a uint32 value.

Instead, we define the Validity propery as '(uv)' tuple, where the first value
(a MMSmsValidityType) specifies the type of validity, and the second value is
a variant formatted accordingly to what the validity type specifies (e.g. a
uint32 value if the type is MM_SMS_VALIDITY_TYPE_RELATIVE).
2013-04-05 17:48: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
Aleksander Morgado
675d8aeeea tests: add PDP context reply parser test for Samsung/Icera replies 2012-10-25 16:19:28 +02:00
Aleksander Morgado
99cb8cb2e6 tests: fix sms part tests 2012-10-04 12:10:22 +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
Aleksander Morgado
b6d628b3a1 build: merge libmm-common into libmm-glib
It's pointless to have libmm-common around, just merge it into libmm-glib and
make ModemManager depend on libmm-glib directly. At the end, the non-common
stuff in libmm-glib is really minimal.
2012-10-04 10:17:05 +02:00
Aleksander Morgado
a66f971a7c libmm-common: added common utils from core
Moved the utils to play with binary to hex strings into libmm-common.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
baf3ed0c64 sms-part: don't keep track of the whole TP-DCS value
We already retrieve the bits we use from it, class and encoding.
2012-09-14 07:05:25 +02:00
Aleksander Morgado
7faa48ea94 api: new `PduType' property in the SMS interface
It will help deciding the type of message.
2012-09-14 07:05:24 +02:00
Aleksander Morgado
5b6e080472 test: set text encoding when testing PDU creator 2012-09-14 07:05:24 +02:00
Aleksander Morgado
6c5bead94b test: print all logs in SMS part tests
They are extremely helpful for debugging issues.
2012-09-14 07:05:24 +02:00
Aleksander Morgado
f7caa7c9bc test: new tests to parse SUBMIT PDUs 2012-09-14 07:05:24 +02:00
Aleksander Morgado
f139bbe485 test: new tests to parse non-stored PDUs 2012-09-14 07:05:24 +02:00
Aleksander Morgado
af4f23a1d2 test: new tester for +CDS unsolicited messages 2012-09-14 07:05:24 +02:00
Aleksander Morgado
e7b094ea3c sms-part: new util to split input text string into chunks to fit in PDUs 2012-09-14 07:05:22 +02:00
Dan Williams
c524734d9f core: better handling of non-UCS2 conversions that should be UCS2 (bgo #683817)
Some modems return the +COPS operator name in hex-encoded current
character set (as set with +CSCS).  Others return the operator name
in ASCII when set to UCS2, while yet others return the  ASCII name
with trash at the end (*cough* Huawei *cough*).  Handle that better
by not crashing.
2012-09-12 23:03:58 -05:00
Aleksander Morgado
32c41f62e5 sms-part: add helper debug logs 2012-09-06 13:14:16 +02:00
Aleksander Morgado
4804c37604 build: new `--without-qmi' configure option
For those who don't care about the QMI support through libqmi-glib, or if you're
stuck with glib 2.30 (libqmi-glib requires 2.32), this configure switch allows
disabling the QMI support completely.

The logic to detect cdc-wdm ports is still in place, but the QMI probing is
never launched at them. Also, all QMI-related objects won't be compiled.
2012-09-05 20:02:31 +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
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
Aleksander Morgado
8a47621a5c sms,tests: new test to check for multipart support in SMS parts 2012-05-06 18:48:59 +02:00
Aleksander Morgado
5a485d74a2 qcdm-serial-port: allow cancelling the response timeout 2012-03-16 14:53:22 +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
4a52a19c41 tests,modem-helpers: cleanup tests
Properly order the tests in blocks, and ensure that the common data for
registration tests is not passed to other non-registration related tests.
2012-03-16 14:53:21 +01:00
Aleksander Morgado
4c38ab4864 test,modem-helpers: remove conditional compilation
We require already GLib 2.30
2012-03-16 14:53:21 +01:00
Aleksander Morgado
8f200940ec tests: fix automake rule dependencies
We need to ensure all test programs are built.
2012-03-16 14:53:18 +01:00
Aleksander Morgado
21c0731ad9 tests: fix CGDCONT reply test, NULL expected instead of empty string 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
4de848de39 tests,sms: print traces if enabled during compilation 2012-03-16 14:28:15 +01:00
Aleksander Morgado
2522acf899 tests,sms: refactor SMS part related tests
Now using the MMSmsPart setup.
2012-03-16 14:28:15 +01:00
Aleksander Morgado
2a12322a80 modem-helpers: allow leading zeroes in CREG/CGREG responses 2012-03-15 14:15:06 +01:00
Aleksander Morgado
f8cc4114ad qcdm-serial-port: no need to pass port type when creating the object 2012-03-15 14:15:05 +01:00
Aleksander Morgado
cd184f33f9 test: new tester for CPMS=? results 2012-03-15 14:15:03 +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
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
b3389ff2d4 test-modem-helpers: fix C(G)REG parsing tests 2012-03-15 14:14:29 +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
c58db4e015 core: start using our newly defined errors 2012-03-15 14:14:25 +01:00
Aleksander Morgado
6b69605633 build: chain up new 0.6 API and link against libmm-common
Also removed the MMSerialError implementation from `src/mm-errors.[h|c]', as it
is now included in the new `include/ModemManager-errors.h' header file. All the
other enums and errors without clashing names will be ported afterwards to the
new base code.
2012-03-15 14:14:19 +01:00
Aleksander Morgado
c164246642 tests: serial port tests don't need errors header 2012-03-15 14:14:17 +01:00
Dan Williams
4dad94d500 core: rework port grabbing and organization
Make port roles more flexible.  We have modems that do PPP
on interfaces other than the primary interface, and that
wasn't possible with the old code.  So clean up all that
logic and move the port organization code into the core
so we can reduce code in the plugins.

In the new world order, the plugins say whether the port
is a QCDM port, an AT port, or ignored.  If it's an AT
port the plugins get to tag it as primary, secondary, or
PPP, or any combination of the 3.  This allows for modems
where PPP should really be done on the secondary port
(Huawei E220, Sierra devices) so that the primary port
stays open for command and status.

Modem subclasses no longer get asked to handle port grabbing
themselves.  Instead, that's now done by the generic classes
(MMGenericCdma and MMGenericGsm) and the plugins are notified
when a port is grabbed so they can add unsolicited response
handlers for it.  After all ports are grabbed by the generic
classes, they get "organized", which assigns various ports
to the roles of PRIMARY, SECONDARY, DATA, and QCDM based
on specific rules and hints that the plugin provided (which
are expressed as MMAtPortFlags).  The plugins then have
a chance to perform fixups on the primary port if they choose.

The plugin code is responsible for determining the port
hints (ie MMAtPortFlags) at probe time, instead of having
a combination of the plugin and the modem class do the
job.  This simplifies things greatly for the plugins at
the expense of more complicated logic in the core.
2012-02-28 10:06:04 -06:00
Aleksander Morgado
26d69ca0f2 gsm: allow leading zeroes in numbers in CREG/CGREG responses 2012-02-17 13:25:02 +01:00