Commit Graph

9 Commits

Author SHA1 Message Date
Aleksander Morgado
c16bcdf68c core: make sure objects retrieved with g_object_get() are valid in the ifaces
The interfaces usually retrieve objects (e.g. skeletons) from the Modem object
using g_object_get(), but we didn't make sure that these objects were actually
valid before using them.

This should clean up errors happening when the modem gets unplugged and still
some actions are ongoing.

Should fix https://bugzilla.gnome.org/show_bug.cgi?id=685933
2012-10-11 11:41:15 +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
e2a56ba490 iface-modem-time: let initialization and enabling sequences get cancelled 2012-03-16 14:53:24 +01:00
Aleksander Morgado
cc6d4a97fb base-modem: new port getters and peekers
* mm_base_modem_peek_port_* () will return either a port object (no new
reference), or NULL if none available.

You would usually peek() a port if you're going to use it just in the current
method, as there is no way to that reference to get invalid (we're single
threaded).

 * mm_base_modem_get_port_* () will return either NEW references to valid
port objects, or NULL if none available.

And, you would usually get() a port, whenever you want the port object to be
valid even out of the current method, for example when keeping it in the
context of an async operation.

Also, we need to consider that the primary AT port MAY BE NULL when you
peek() or get() it. This is due to the fact that we may be releasing ports
(due to device disconnection) in the middle of async operations.
2012-03-16 14:53:23 +01:00
Aleksander Morgado
a339546c45 iface-modem-time: setup generic unsolicited message handling
Modems may get notified via unsolicited messages (either AT or QMI or some
other thing), that the network time was updated. This setup allows subclasses
implementing the Time interface to setup/cleanup and enable/disable the
unsolicited messages, as well as notify about the network time updates.
2012-03-16 14:53:21 +01:00
Aleksander Morgado
5b01df5baa iface-modem-time: handle `GetNetworkTime' 2012-03-16 14:53:21 +01:00
Aleksander Morgado
10669881a5 iface-modem-time: only retry if MM_CORE_ERROR_RETRY was returned
We don't want to retry if the error is fatal in some other kind, e.g. a reply
parsing error or something.
2012-03-16 14:53:20 +01:00
Aleksander Morgado
6e75399629 iface-modem-time: load network timezone information
Following the same logic as in the original implementation, we try to load the
network timezone information only after being registered, and also with up to N
retries. The async operation in charge of the loading can be cancelled
gracefully, i.e. if the interface is disabled before we get ever registered.
2012-03-16 14:53:20 +01:00
Aleksander Morgado
16cf2a49f6 iface-modem-time: new interface to handle the Time DBus interface 2012-03-16 14:53:20 +01:00