Commit Graph

1627 Commits

Author SHA1 Message Date
Nathan Williams
87ec5e09a5 gsm: multipart SMS support
Keep a local cache of SMS message fragments when we perform a List or
Get command on the modem; use this cache to reassemble fragments into
complete messages, which are then what is returned by the Get and List
DBus commands. Similarly, cause Delete to delete all known parts of a
multipart message.

While here, remove some extra whitespace in the SMS commands we send
to the modem.
2011-11-02 20:50:03 -05:00
Dan Williams
889ae2fb4b gsm: fix parsing of unsolicited CREG/CGREG response with RAC 2011-10-27 16:38:11 -05:00
Dan Williams
ccad4aaa9d gsm: add regex for unsolicited CREG/CGREG response with RAC 2011-10-27 15:13:30 -05:00
Aleksander Morgado
58aa172b4e serial: use g_value_set_schar() and g_value_get_schar() when glib >= 2.31 2011-10-24 21:45:37 +02:00
Aleksander Morgado
28f64090df core: don't include private headers from glib
The "glib/gtypes.h" is now considered private, and only "glib.h" should be
included directly.
2011-10-24 21:44:30 +02:00
Dan Williams
d40e043623 core: better handle NULL spew from serial ports during probing
Observed on a generic ZTE device.
2011-10-18 13:17:39 -05:00
Aleksander Morgado
3bcbc7b644 api: Let MM_MODEM_MODE be a bitfield, and new PreferredMode property
Supported and Allowed modes are modified to be bitmasks of MM_MODEM_MODE values,
and preference of a specific mode is now given in the new PreferredMode
property and as an extra argument to the SetAllowedModes() call.

 * Supported Modes: bitmask specifying which modes are supported by the specific
hardware. For example, a modem may only support 1G/2G/3G connections (not 4G).

 * Allowed Modes: bitmask specifying which modes, of the ones Supported by the
modem, are allowed to use. For example, a modem may support 1G/2G/3G connections
but only 1G and 2G connections are allowed by the user as 3G involves more
expensive data rates.

 [Allowed] ⊆ [Supported]

 * Preferred Mode: specific mode which is preferred among the ones defined in
the Allowed modes bitmask. For example, a modem may allow 1G/2G/3G connections
but the user would like that if possible 2G be used, as 3G consumes too much
battery. If 2G is not possible, 3G can be used.

 [Preferred] ∈ [Allowed]
2011-10-17 12:50:44 +02:00
Aleksander Morgado
0984dd9df8 build: ensure all needed files are included in dist
Added all needed headers to libwmc_la_SOURCES, so that they get into the dist
tarball.
2011-10-17 09:41:50 +02:00
Aleksander Morgado
5f24703b12 build: mm-modem-gsm.h no longer exists 2011-10-17 09:39:43 +02:00
Aleksander Morgado
fd9f2d2804 serial: skip NUL bytes coming before real AT responses
Some Cinterion modems send a NUL byte before the "CONNECTED" reply to "ATD"
(only during the first ATD try anyway).

This fix will ignore any NUL byte leading the real response.
2011-10-14 17:22:12 +02:00
Dan Williams
6e0e46e51e huawei: Gobi devices should be driven by gobi not huawei (bgo #660998) 2011-10-12 18:47:23 -05:00
Dan Williams
c61423f2cf wmc: add initial command parsing and response handling 2011-10-04 11:16:39 -05:00
Dan Williams
a7637ddf87 qcdm: add more mode prefs
It seems that various firmwares just pass values from eg AT^SYSCFG
straight through to the firmware so it's pretty easy to map them
to the actual response here.  Note that the NV mode pref item uses
a different mapping than CM state info response.  Yay.
2011-10-04 11:16:39 -05:00
Aleksander Morgado
a9f4ea9f81 api: rename MM_MODEM_ALLOWED_MODE to MM_MODEM_MODE
Makes more sense to have the enum named just as 'mode', as it applies to both
Supported and Allowed.
2011-10-01 15:23:11 +02:00
Aleksander Morgado
40406693b6 api: new SetAllowedBands() to be able to modify the allowed bands in the modem
Changing the allowed bands in a modem may fail, for example if trying to set a
frequency band which is not in the bands mask reported as Supported by the modem.
Therefore, we need an explicit SetAllowedBands() method with proper error
reporting instead of making the property writable.
2011-10-01 15:23:09 +02:00
Aleksander Morgado
b5393091de api: new SetAllowedModes() to be able to modify the allowed mode in the modem
Changing the allowed mode of a modem may fail, for example if trying to set a
mode which is not in the modes reported as Supported by the modem. Therefore, we
need an explicit SetAllowedModes() method with proper error reporting instead of
making the property writable.
2011-10-01 15:23:08 +02:00
Aleksander Morgado
dbc64d83ba api: let SignalQuality say if the given value was recently taken
Modems which only expose a single port will not be able to update the signal
quality value while in connected mode. The signal quality value reported in this
case, while the modem is connected, will be the last signal quality value read
before the connection.

The additional boolean value proposed here in the SignalQuality property will
just say if the given signal quality was recently taken (if TRUE) or cached
some time ago (if FALSE). The time to assume the value was recently taken or not
could depend on different things, for example:

 * If the modem always has an AT port, even if connected, we could directly
   query the current signal quality and report the value as being fresh.

 * If the modem has a single port, we could report the value as not being fresh
   as soon as the modem gets in connected state.

 * For modems which report the signal quality updates in unsolicited messages,
   we could report the value as being fresh if the update was received in the
   last minute or so.
2011-10-01 15:23:06 +02:00
Aleksander Morgado
e9743f4b49 api: let the Modem expose a 'Sim' property to link to a specific SIM object
SIM objects will be listed as independent objects in the DBus API, and the 'Sim'
property in a given modem object will specify which SIM object is in use.
2011-10-01 15:23:05 +02:00
Aleksander Morgado
588f9550ed api: remove GetInfo() from the Modem API and use read-only properties instead.
New 'Manufacturer', 'Model' and 'Revision properties are added, all being
read-only strings.
2011-10-01 15:23:02 +02:00
Aleksander Morgado
9d9a189026 api: include ScanDevices() and SetLogging() in the new manager API
These methods were available in the old API, and are needed in the new one.
2011-10-01 15:20:14 +02:00
Dan Williams
7a7014330c examples: add example of auto-enabling modems 2011-09-30 14:38:11 -05:00
Dan Williams
30a67862ec zte: update port hints for Onda MSA110 and others 2011-09-28 10:31:32 -05:00
Dan Williams
368b808869 libwmc: simpler logging and error handling 2011-09-27 15:33:53 -05:00
Nathan Williams
8710820156 core: ensure that GMatchInfo and GRegex objects are freed properly
In particular, g_regex_match() and g_regex_match_full() allocate a
match_info structure on both success and failure, so calling
g_match_info_free() only in the success case is insufficient.

BUG=None
TEST=Inspection

Change-Id: Iea76b5b5dc3ec48120e15601a5e2dd45322133d8
2011-09-27 13:40:39 -05:00
Nathan Williams
00670456ff sms: sanitize 8-bit data so that it is UTF8-clean
When receiving a SMS message with raw 8-bit data, sanitize it by
replacing non-ASCII characters with \xNN escape sequences. This
prevents a problem further down the line where the body of the message
is passed into DBus as a string, and DBus requires strings to be UTF-8.

BUG=chrome-os-partner:5953
TEST=Run network_ModemManagerSMS.py with the PDU from this bug.

Change-Id: Ic33a365f9a065c49a325e047e4c3f5e81450fa1f
Reviewed-on: http://gerrit.chromium.org/gerrit/8232
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Nathan J. Williams <njw@chromium.org>
Commit-Ready: Nathan J. Williams <njw@chromium.org>
2011-09-27 13:16:08 -05:00
Dan Williams
18fc92ef73 libwmc: add more test code and start of com tests 2011-09-27 13:13:40 -05:00
Dan Williams
8250dee131 libwmc: add more tests including for UML290 quirks 2011-09-19 13:42:00 -05:00
Dan Williams
46a5c77616 libwmc: rename some test functions 2011-09-19 11:24:43 -05:00
Dan Williams
3dd4cdaf2b libwmc: beginning of bits for WMC-based devices like UML290 2011-09-17 13:27:54 -05:00
Thomas Tuttle
953701a6f8 modem: add firmware interface 2011-09-08 17:20:00 -04:00
Aleksander Morgado
4c514bfd6d gsm/cdma: unsigned integers can't be < 0, so remove unnecessary conditions
It fixes compilation with the llvm/clang compiler as well.
2011-08-30 11:53:05 +02:00
Aleksander Morgado
2a9a6ad79b nokia: use E1 E0 when initializing the modem
Passing E1 and E0 afterwards seems to properly disable the echo in Nokia modems
(N900 and C7 at least)
2011-08-25 22:00:56 -05:00
Torgny Johansson
7348b4c0c8 mbm: add more Ericsson and Dell vid/pids
Add the vid/pid for Ericsson H5321gw/w, F5321gw/w, C5621gw/w, C3304w and Dell DW5560.
2011-08-25 21:51:38 -05:00
Eric Shienbrood
7605ffec59 gsm: pass GSM registration errors up to caller
Register was appearing to succeed even when it failed.
2011-08-21 09:04:08 -05:00
Nathan J. Williams
acc0928315 sms: check for the correct return value from sscanf() in sms_get_done()
Remove an unused variable so it's more obvious what the correct value is.
Fixes live (vs. list) SMS reception on ToT.

BUG=none
TEST=Send SMS to device, see that it shows up in Chrome.

Change-Id: I9c76fb15ef229fe83672e2eee8ae37d7e6ab7b9e
Reviewed-on: http://gerrit.chromium.org/gerrit/3216
Reviewed-by: Nathan J. Williams <njw chromium org>
Tested-by: Nathan J. Williams <njw chromium org>
2011-08-21 08:59:11 -05:00
Aleksander Morgado
531fa05192 api: remove unneeded code from header generator 2011-08-20 00:06:14 +02:00
Aleksander Morgado
ea23851326 api: use common ModemManager.h for API, core and plugins 2011-08-19 22:54:48 +02:00
Aleksander Morgado
c4a8291349 build: ensure common header is built first 2011-08-17 16:21:21 +02:00
Aleksander Morgado
2dee5b0ae0 api: rename common header to ModemManager.h 2011-08-17 16:21:21 +02:00
Aleksander Morgado
e48648e406 api: generate enums instead of defines in common header 2011-08-17 16:21:21 +02:00
Aleksander Morgado
15f77d131a api: add license and header include guards 2011-08-17 16:21:21 +02:00
Aleksander Morgado
6eb32c72da introspection: renamed MM_MODEM_STATE_CHANGED_REASON to MM_MODEM_STATE_REASON 2011-08-17 16:21:21 +02:00
Aleksander Morgado
36dabababd introspection: rename changed reason UNKNOWN to NONE 2011-08-17 16:15:06 +02:00
Aleksander Morgado
914ad628ab introspection: define MM_MODEM_TYPE_UNKNOWN 2011-08-17 16:15:06 +02:00
Aleksander Morgado
7e246f6018 introspection: use state type in StateChanged signal definition 2011-08-17 16:15:06 +02:00
Aleksander Morgado
713c07290f introspection: define type MM_MODEM_STATE 2011-08-17 16:02:57 +02:00
Dan Williams
8799f4da1f core: when probing mark ports as AT capable too
On a ZTE MF626, sometimes the aux port will respond only with
"ERROR" to probing commands (while the SIM is starting up) and
previously we'd lose the port because we were only looking for
valid probe responses.  But if the port returns ERROR or CME ERROR
etc we know it's an AT port and that we can use it once we've
gotten the type response (CDMA or GSM) from the main port.
2011-08-14 16:02:41 -05:00
Dan Williams
8ea17921e7 gsm: check both CS and PS registration state during poll
When connecting, and the modem isn't yet registered or denied, poll
both CS and PS registration state instead of just CS state, because
we're really more interested in PS state anyway.  If at least one
of the CS and PS state checks is successful then proceed with the
connection.
2011-08-14 15:37:38 -05:00
Dan Williams
f683391169 test: allow modem numbers in addition to object paths
If the command-line arg doesn't look like an object path,
treat it as the modem # and make the object path.
2011-08-09 16:49:29 +02:00
Dan Williams
33a97cdb13 core: log when serial port unexpectedly hangs up 2011-08-02 21:57:07 -05:00