Commit Graph
528 Commits
Author SHA1 Message Date
Aleksander Morgado 39abb023ed serial: new property to enable RTS/CTS flow control 2011-06-22 15:53:37 +02:00
Aleksander Morgado 6e9d980e8c gsm: allow plugins to check if they need to issue the power-up command
Some modems only like the power-up command if not already in full functionality
mode. If the power-up is sent while already in full functionality mode, they get
rebooted and reseted.

With this changes, plugins can check whether they need the power-up and ask
the generic gsm code base to skip the command or not.

By default, power-up command (if any given) is never skipped.
2011-06-22 13:08:53 +02:00
Dan Williams 51c409d1eb ussd: fix reception, network notifications, and network requests
Because the code was sending the USSD request with a "notify me via
unsolicited result code" tag, the response could come from any port,
and in was coming from other ports on various devices.  But the code
expected the response on the main port, thus it got lost.

So turn the USSD response processing into an unsolicited command handler
instead, which allows us to process the response no matter where it
comes from.  This patch also enables network-initiated USSD
notifications and requests since that's easy to add once the first thing
here is done.
2011-06-15 13:06:37 -05:00
Dan Williams 77fa848820 serial: warn when open/close take longer than 7 seconds
Due to kernel bugs and such.
2011-06-15 12:50:35 -05:00
Dan Williams 6657e45a1e core: trivial whitespace cleanup
Tabs -> spaces
2011-06-09 16:53:05 -05:00
Nathan Williams 9f8d42a994 core: handle udev 'change' events
That's what the udev replay gives us these days (as of udev-152).
2011-06-09 16:51:35 -05:00
Dan Williams 63b29b79f9 gsm: fix memory leak when grabbing a new port 2011-06-09 15:01:20 -05:00
Dan Williams e5c967508d ussd: fix leaked callback info in error cases 2011-06-09 14:46:03 -05:00
Aleksander Morgado f9f6d1dfdb plugins: propagate cached probing result to supports task
We need to ensure that the supports task always has the results of the probing,
no matter if the probing was just launched by the plugin grabbing the port, or
by a previous plugin. We do this during supports_port(), by propagating to the
supports task any possible previously cached probing results.
2011-06-06 17:21:47 +02:00
Aleksander Morgado 22f15b87b5 base: disable the modem if up to N consecutive commands get timed out
This feature is initially disabled for all modems, but plugins can enable it by
setting a value greater than 0 for the "max-timeouts" property when creating the
modem object.
2011-06-06 17:20:17 +02:00
Aleksander Morgado f2ba435446 manager: protect ScanDevices() d-bus method with manager control policy rule 2011-06-06 17:20:17 +02:00
Aleksander Morgado c67cbcabef policy: new policy for manager control actions 2011-06-06 17:20:17 +02:00
Aleksander Morgado 3fb53d3348 manager: new ScanDevices() d-bus method to request a new device scan loop 2011-06-06 17:20:17 +02:00
Aleksander Morgado df0d9b480c plugin base: let plugins decide if they should be sorted last
Note that even if a plugin says it wants to be sorted last, the generic plugin
will always be the last one. Also, there is no order guaranteed between two
plugins that request to be sorted last.
2011-06-06 17:20:17 +02:00
Aleksander Morgado 5a2078a2a5 plugin base: include vendor ID and product ID retrieval during AT port probing
Port probing is extended to also query for Vendor ID and Product ID. This allows
plugins to check whether the reported IDs are expected, and thus we enable
plugins to handle modems connected via RS232 ports (where udev doesn't give any
vendor ID) or modems connected via a USB adapter (where udev gives the vendor ID
of the adapter).

Note that this effectively means that a plugin which expects these kind of modem
connections will end up always launching port probing as they won't only rely on
the vendor ID reported by udev.
2011-06-06 17:20:17 +02:00
Aleksander Morgado 668726dbd7 charsets: new utf8_to_hex() method 2011-06-06 17:20:16 +02:00
Aleksander Morgado 1e507824c6 gsm: let plugins use their own command for CMER enabling 2011-06-06 17:20:16 +02:00
Aleksander Morgado 85569f77e9 gsm: let plugins use their own commands for SMS indications and storage configuration 2011-06-06 17:20:16 +02:00
Dan Williams b122938ab5 core: allow plugins to stop probing and not support a modem
Previously plugins could only stop probing, *or* stop probing and
indicate support for a device.  For the Alcatel X200/X060s debacle
we need to stop probing and indicate that the plugin does not
support the device at all.
2011-06-05 20:58:13 -05:00
Aleksander Morgado d37dbaca2a core: ensure ERROR_REMOVED error is used in MMCallbackInfo when detecting modem removal 2011-06-05 17:51:03 +02:00
Aleksander Morgado 9323daec01 core, plugins: if modem removed don't process response
We try to avoid a memory leak when info->error is reset, as well as a second
re-schedule of the info.
2011-06-05 17:51:00 +02:00
Nathan Williams f7dff81eec gsm: free the string allocated by utils_hexstr2bin().
Change-Id: I1f7dabc8209d9757b573a59abb788a2346f72ad5
2011-06-02 17:50:47 -05:00
Nathan Williams a1378ae8e8 Spec out and implement a command to get a GSM SIM SPN value.
Using a SIM with a SPN, run the following command:
dbus-send --system --dest=org.freedesktop.ModemManager --print-reply /org/freedesktop/ModemManager/Modems/0 org.freedesktop.ModemManager.Modem.Gsm.Card.GetSpn

Change-Id: I8f36c8432f40fa4e3cb3f8c6ceef16b2bdadf2a1
Reviewed-on: http://gerrit.chromium.org/gerrit/1464
Reviewed-by: Nathan J. Williams <njw@chromium.org>
Tested-by: Nathan J. Williams <njw@chromium.org>
2011-06-02 17:45:56 -05:00
Nathan Williams dfab00bf1e sms_decode_address(): Add a leading "+" on international numbers.
BUG=chromium-os-partner:4278
TEST=Send SMS from phone (to get +... format) and from AIM-SMS gateway
(to get raw-digit format).

Change-Id: I36eb9f1432a432435578180dfdb315b0e7ee5744
2011-06-02 17:42:20 -05:00
Aleksander Morgado 6d69432a85 serial-parser: allow 0 or more whitespaces before error code in regular expresions 2011-06-02 16:49:53 +02:00
Nathan Williams b8cb764d08 sms: use correct start and length for alphanumeric data
sms_parse_pdu(): Protocol ID doesn't actually affect decoding, so
don't fret about its value.

ChromeOS:
Change-Id: Ia4cb20c415aed1026bb7b8dd4daa8ae53dd749e8
2011-05-27 10:26:01 -05:00
Nathan Williams 52bd7646e8 gsm: correctly set registration status when disabling
Chromium:
Change-Id: I0629706985f273832ac3662acb260388d0e6ed83
2011-05-19 15:45:22 -05:00
Dan Williams e28946841d ussd: formatting and spacing cleanups 2011-05-19 10:44:03 -05:00
Nathan Williams fa15c50b29 sms: suppress duplicate SMS received notifications
If the modem sends the same notification on more than one port,
make sure we don't send a signal out to clients more than once.
2011-05-11 21:46:09 -05:00
Aleksander Morgado 673005e602 manager: avoid assertion warning when enumerating devices 2011-05-09 18:21:46 +02:00
Dan Williams 1bc70be993 gsm: whitespace fixes 2011-05-09 11:05:28 -05:00
Aleksander Morgado db7c11768a utils: new utils_check_for_single_value() method
It was being used in several places with different static implementations
2011-04-29 12:31:10 +02:00
Aleksander Morgado 466b6edbf7 gsm: allow setting more than one band 2011-04-29 12:31:07 +02:00
Dan Williams 1cf7a4da44 plugins: allow multiple custom init commands in sequence
Huawei will need this.
2011-04-26 23:44:56 -05:00
Dan Williams 0befde3ce9 plugins: simplify custom init commands
Instead of having two places that custom init stuff got processed
(a hook in the MMPluginBase class itself and a callback too) just
use a callback, and simplify it somewhat so that the plugin tracks
how many tries it cares about and what to do based on the response
or error.
2011-04-26 19:43:40 -05:00
Dan Williams 74b1503c60 core: tear down all pending work when closing a port
Make sure all pending work, if any, is torn down when closing
the port, since it's closed, and is likely going to get unreffed
soon and we don't want anything running after the port is dead.
2011-04-18 17:39:59 -05:00
Dan Williams fca4d3aa37 gsm: return success if unlocked but doesn't allow subsequent CPIN commands
If the modem for some reason returns ERROR for a +CPIN when it's
unlocked, and subsequent PIN post-unlock pin checks return READY,
just treat the modem as unlocked don't return the +CPIN error.
2011-04-18 17:38:39 -05:00
Dan Williams 5dadfa4c21 Merge remote-tracking branch 'lanedo/plugin-wavecom' 2011-04-14 14:20:43 -05:00
Nathan Williams 487972c1ac gsm: implement basic SMS reception and PDU parsing 2011-04-14 14:07:31 -05:00
Aleksander Morgado 48c7dac009 serial: ensure response array is empty before setting cached reply 2011-04-14 13:34:02 -05:00
Nathan Williams d05c87e4c8 charset: change GSM unpack to take number of characters rather than octets
Change interface to take the number of GSM characters
rather than the number of octets, so that it is possible to
distinguish the 7-character and 8-character cases.
2011-04-14 13:30:15 -05:00
Dan Williams 0a06dd324d serial: ensure spew control can be changed after port is created
Since we don't allow properties to be passed into the serial port
create routines we don't want a construct-only property here.
2011-04-14 13:26:16 -05:00
Nathan Williams 1c3101fbaf serial: allow spew control to be turned off
It's only used during probing where some port types (Sierra CnS
and some Icera devices) may send streams of data that we can't
understand until we close the port.  It interferes with some SMS
operations, so turn it off for ports opened after probing.
2011-04-14 13:22:54 -05:00
Aleksander Morgado ade8c17f6a gsm: handle UMTS 2600 internal band 2011-04-11 10:04:27 +02:00
Aleksander Morgado 262edb96d5 wavecom: handle READY without OK in CPIN? reply 2011-04-11 10:04:27 +02:00
Dan Williams ed5aefb3cb serial: allow plugins to specify probe-time send_delay
Let modems we know don't suck use a zero send-delay at probe time,
which greatly reduces time required to probe AT-compatible ports.
2011-04-08 16:19:36 -05:00
Dan Williams 7d20acc566 gsm: make sure verbose error reporting is enabled before checking PIN
Otherwise we don't get the expected "Incorrect password" error if the
PIN is wrong, just a generic error.
2011-04-08 16:00:36 -05:00
Dan Williams 273f4203d4 serial: send entire command in one write if send_delay is 0 (chromium:13506)
Avoids additional USB latency and groups the whole command into one
USB packet.

BUG=chromium-os:13506
2011-04-08 15:42:28 -05:00
Nathan Williams dbf9e085d4 sms: don't try to destroy NULL hash tables 2011-04-07 17:48:03 -05:00
Aleksander Morgado 9435a937ce serial: allow user to provide custom regex for successful and error replies
New mm_serial_parser_v1_set_custom_regex() method.
2011-04-06 17:11:20 -05:00