Commit Graph
1068 Commits
Author SHA1 Message Date
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
Dan Williams da57b9a0eb sierra: fix possible double-free
Need to reset password to NULL after freeing it.
2011-08-02 21:57:02 -05:00
Dan Williams eb2d14ab4a core: fix possible double-free
If there was data waiting, the task freed it, but then the port
got closed, and the data callback might have freed the data again.
2011-08-02 21:56:56 -05:00
Dan Williams 804cd7f077 gsm: work around Motorola Android phone modem bugs (bgo #637327)
It seems the Motorola Flipout with Android 2.1 doesn't like to return
configured PDP contexts via AT+CGDCONT?; it returns an error.  It
seems to accept the rest of the dial sequence though, so just ignore
the error when reading existing PDP contexts.
2011-08-02 12:43:26 -05:00
Dan Williams 7985a27321 doc: update README (bgo #652910) 2011-08-02 12:26:23 -05:00
Dan Williams b9c2180886 core: fix serial port flashing after d3c2228f7b (bgo #650740)
Fix one more possible memory leak (left un-fixed by d3c2228 but not
caused by it) and ensure that modems that do want flashing get it
by default by adding the missing G_PARAM_CONSTRUCT so FLASH_OK
defaults to TRUE.
2011-08-02 11:07:55 -05:00
Dan Williams 26debc1a97 mbm: don't flash serial ports on disconnect (bgo #650740)
The F5521gw resets various port properties like echo when the port
is flashed, which was happening on disconnect.  Since MM had already
turned of echo with ATE0, and the AT parser in-use expected no
echo, this confused MM when the port magically started echoing commands
back.  We don't need flashing on the Ericsson devices because there
will always be a free AT port even if PPP is used for a secondary
PDP context, so we can just skip flashing entirely for these
devices.
2011-08-02 10:47:25 -05:00
Dan Williams d3c2228f7b core: allow ports to skip flash behavior (bgo #650740)
Flashing is a technique to break out of the data/PPP stream and
re-enter command stream (like +++) and MM uses it in the generic
paths in various cases.  But devices that don't need it (ie, ones
with at least one AT capable port that won't be used for data)
now sometimes appear to have side-effects.

The Ericsson F5521gw firmware R2A07 resets port attributes like
echo and &C and such when the port is flashed, leading to
confusion on the part of MM.  Since the Ericsson devices will
always have at least one free AT port they don't need flashing
anyway.
2011-08-02 10:43:54 -05:00
Dan Williams 18231c9f8d api: refine new API based on suggestions from Eric Shienbrood 2011-08-01 17:47:38 -05:00
Dan Williams e0eb7038af gsm: allow SIM operations while connected
No point in requiring these to be done from the primary port.
2011-08-01 17:18:08 -05:00