Commit Graph
662 Commits
Author SHA1 Message Date
Aleksander Morgado 59c783eb61 plugin-base: new 'allowed-subsystems' property
The plugins can set this property to filter support check requests by subsystem.
The value given to the property should be a NULL-terminated array of C strings,
e.g.:

    const gchar *subsystems[] = { "tty", NULL };
2012-03-15 14:14:20 +01:00
Aleksander Morgado 27e1d97aca port-probe: new cache of Port Probe results
Whenever a plugin has probed for some information in a given port, that data
should be available for any other plugin wanting it during its own probing
process. This new cache of Port Probe results allows to easily retrieve the
already probed information.
2012-03-15 14:14:20 +01:00
Aleksander Morgado a3ace206b0 port-probe: add comment explaining the probing process flow 2012-03-15 14:14:20 +01:00
Aleksander Morgado fa3fa38e0d port-probe: allow providing custom initialization AT commands 2012-03-15 14:14:20 +01:00
Aleksander Morgado 610bffc4e8 port-probe: enable probing for QCDM support 2012-03-15 14:14:20 +01:00
Aleksander Morgado b73fb8e8f2 port-probe: enable probing for Product 2012-03-15 14:14:20 +01:00
Aleksander Morgado 1f9fd9e0be port-probe: enable probing for Vendor 2012-03-15 14:14:20 +01:00
Aleksander Morgado 05f8493ee7 port-probe: enable probing for Capabilities 2012-03-15 14:14:20 +01:00
Aleksander Morgado 6816c2e61d port-probe: enable probing for AT support
We will initially probe for AT support in the port.
2012-03-15 14:14:20 +01:00
Aleksander Morgado d7238403c4 port-probe: new type to define commands used during probing
The new `MMPortProbeAtCommand' type defines what command will be sent to the
serial AT port, and also a response processor method to parse the string
returned by the port.

The response processor gets as input either the text reply string or an error,
and it should give as output either a GValue (type depends on the probing kind
being done) or a new error (which will force the whole probing process to be
aborted.
2012-03-15 14:14:20 +01:00
Aleksander Morgado f7b1d99fa0 port-probe: allow cancelling the probing operation
The new `mm_port_probe_cancel()' will cancel the probing operation currently in
progress, if any. Note that we don't need to pass any argument to specify which
operation to cancel, as there can only be one.
2012-03-15 14:14:20 +01:00
Aleksander Morgado f227572d8f port-probe: setup an asynchronous method for port probing
The new method `mm_port_probe_run()' will run the whole probing process
asynchronously. Result of the probing can be later obtained with
`mm_port_probe_run_finish()'.
2012-03-15 14:14:20 +01:00
Aleksander Morgado 1b84994feb port-probe: set port details when creating the object
Each port probe is always associated to one specific port.
2012-03-15 14:14:20 +01:00
Aleksander Morgado 74145f5af7 port-probe: new MMPortProbe object 2012-03-15 14:14:20 +01:00
Aleksander Morgado 916cf5dd3e manager: integrate the Plugin Manager
All plugin handling and port support checks now done by the Plugin Manager.
2012-03-15 14:14:20 +01:00
Aleksander Morgado fad89b1d7e plugin-manager: new methods to check for ongoing port support operations
The new mm_plugin_manager_is_finding_port_support() allows to check whether the
Plugin Manager is looking for support in a specific port.

The new mm_plugin_manager_is_checking_device_support() allows to check whether
the Plugin Manager is looking for support in any port of a given device.
2012-03-15 14:14:20 +01:00
Aleksander Morgado 5f2d0d474c plugin-manager: allow suggesting a plugin when launching support checks
The newly launched support check will start probing with the suggested plugin
right away.
2012-03-15 14:14:20 +01:00
Aleksander Morgado 8fed241767 plugin-manager: propagate support check results to tasks in the same device
As soon as the first support check of a port in a given device finishes with a
valid best plugin and level > 0, propagate the result to other support tasks
corresponding to ports in the same physical device.

Previously, this propagation of support check results was only done once the
port was grabbed by a plugin, not just when the plugin reported that it
supported it. This change in behaviour isn't probably a big deal, as there
should not be any case where a plugin says it supports a port and then cannot
grab it.
2012-03-15 14:14:20 +01:00
Aleksander Morgado 0626de0879 plugin-manager: keep track of all launched support checks
We will keep a reference to each of the support checks currently in progress,
grouped by physical device path. The stored SupportsInfo structs as well as
the support check operations, are guaranteed to be kept valid as long as the
Plugin Manager exists. Or in other words, the Plugin Manager cannot be disposed
if there is still an ongoing supports check operation.
2012-03-15 14:14:19 +01:00
Aleksander Morgado 1e32139707 plugin-manager: new method to look for best plugin supporting a given port
The new `mm_plugin_manager_find_port_support()' method requests the Plugin
Manager to iterate over the list of plugins internally handled, launching
supports task for the given port in each of them.

The method is fully asynchronous, and the result can be retrieved with
`mm_plugin_manager_find_port_support_finish()' once the operation is ready.
2012-03-15 14:14:19 +01:00
Aleksander Morgado 7007825781 plugin-manager: ensure we always print paths in UTF-8
There is little chance of having a PLUGINDIR which is not UTF-8, but it may
happen, and g_log() won't like it.
2012-03-15 14:14:19 +01:00
Aleksander Morgado 035be28730 plugin-manager: find and load plugins when the manager object is created
Ported the plugin finding and loading code from the MMManager object.
2012-03-15 14:14:19 +01:00
Aleksander Morgado 51a8dc6ff3 plugin-manager: let it be initable
Looking for plugins and loading them will be done during the object creation,
so the operation may fail and we need to report it.
2012-03-15 14:14:19 +01:00
Aleksander Morgado 03655fcf9f plugin-manager: new MMPluginManager object 2012-03-15 14:14:19 +01:00
Aleksander Morgado 62030debf2 plugin-base: rename 'cancel_supports_port' to 'supports_port_cancel'
We now have 'supports_port' (async method) and 'supports_port_finish' (to get
the result of the async method), so it makes sense to rename the method to
'supports_port_cancel'.
2012-03-15 14:14:19 +01:00
Aleksander Morgado dc30536456 plugin-base: rewrite port supports check as fully asynchronous
Before this change, supports check was either synchronous (e.g. in some
UNSUPPORTED cases) or asynchronous (when IN_PROGRESS was returned).

With this fix, the supports check requested to the plugin will always be
completed asynchronously; either directly in an idle before launching any real
probing operation, or once the probing operation is finished.

Therefore, it is not expected to get a IN_PROGRESS reply in
mm_plugin_supports_port_finish(), only UNSUPPORTED|SUPPORTED|DEFERRED.
2012-03-15 14:14:19 +01:00
Aleksander Morgado d47176a32c core: avoid using DBusGMethodInvocation in auth API
While porting to GDBus, use opaque pointers. This allows us to include either a
DBusGMethodInvocation or a GDBusMethodInvocation in the 'context' pointer.

Once fully ported to GDBus, we can safely change it back to make the context be
a GDBusMethodInvocation.
2012-03-15 14:14:19 +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
Aleksander Morgado 791e097ab5 at-serial-port: new property to control whether echo removal should be applied 2012-03-13 20:14:58 +01:00
Dan Williams 5f6c65e7c1 gsm: retry sending SMS in PDU mode if text fails and PDU is supported
In the future we'll just default to PDU mode.
2012-03-01 17:23:46 -06:00
Aleksander Morgado bc118aa160 modem-helpers: plug memleak
g_match_info_fetch() returns always a heap-allocated string which should be
freed by the caller.
2012-02-29 16:51:50 +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
Tom Goetz 86bfe96ddb cdma: fix crash on NULL error (bgo #670145) 2012-02-25 20:06:33 -06:00
Aleksander Morgado b42ce2d8e6 charsets: plug memleak
The string passed to utils_bin2hexstr() needs to be freed afterwards.
2012-02-18 11:15:31 +01:00
Aleksander Morgado 7b8e9203f2 gsm: don't query PS network registration status if not supported 2012-02-17 13:25:03 +01:00
Aleksander Morgado 920fefa8e2 modem: new property to allow specifying longer timeouts when configuring IP
This IpTimeout property will be read by NetworkManager, and used as the time to
wait for pppd to establish the IP configuration.
2012-02-17 13:25:03 +01:00
Aleksander Morgado 4b0cd28baf iridium: fix operator name and code to be reported 2012-02-17 13:25:02 +01:00
Aleksander Morgado 3a7f970931 gsm: let plugins override the operator name and code retrieval 2012-02-17 13:25:02 +01:00
Aleksander Morgado 26d69ca0f2 gsm: allow leading zeroes in numbers in CREG/CGREG responses 2012-02-17 13:25:02 +01:00
Aleksander Morgado 40512451cc generic: only send CGACT if PS network is supported 2012-02-17 13:25:02 +01:00
Aleksander Morgado 740680fd3b generic: query PS network registration status only if PS network supported by the modem 2012-02-17 13:25:02 +01:00
Aleksander Morgado a87b4b46c8 gsm: set pin check flag before requesting ICCID check 2012-02-17 13:25:02 +01:00
Aleksander Morgado 7cbc8f3b80 gsm: allow no whitespaces before CPIN? reply value 2012-02-17 13:25:02 +01:00
Aleksander Morgado 670f560b3d iridium: add initial dummy plugin 2012-02-17 13:25:02 +01:00
Aleksander Morgado 20693529ef core: fix loop limits in echo removal
-1 was actually correct, if data->len is 10, i goes from 0 to 8.
2012-02-16 18:20:31 +01:00
Aleksander Morgado 21162a366a at-serial-port: implement built-in echo/garbage removal
We expect the responses to start always with <CR><LF>. We just remove anything
that comes before that.
2012-02-16 10:27:22 +01:00
Aleksander Morgado 1db0004033 charsets: don't crash when passing a NULL string to the UTF-8 converter 2012-02-08 12:06:59 -06:00
Dan Williams 7b4d6cf605 test: fix SMS testcase errors due to uninitialized GError 2012-02-07 14:12:15 -06:00
Dan Williams 2104cd725a gsm: ensure text mode SMS list doesn't pick up too much text
This likely has no effect, but just make sure the regex stops
grabbing message content when it hits the CF/LF that terminates
the message content in text mode.
2012-02-07 13:59:32 -06:00