Commit Graph
53 Commits
Author SHA1 Message Date
Ben Chan 0fb0184a2f iface-modem-messaging: port mm_iface_modem_messaging_disable to use GTask 2017-06-28 10:21:27 +02:00
Ben Chan 1603e6e4bd iface-modem-messaging: port mm_iface_modem_messaging_enable to use GTask 2017-06-28 10:21:27 +02:00
Ben Chan 6aa4e05108 iface-modem-messaging: port mm_iface_modem_messaging_initialize to use GTask 2017-06-28 10:21:27 +02:00
Carlo Lobrano eee6896648 broadband-modem: fixed wrong MEM1 value passed to +CPMS
In functions

- mm_broadband_modem_lock_sms_storages
- modem_messaging_set_default_storage

return with error when using current_sms_mem1_storage as +CPMS value, but
current_sms_mem1_storage value is UNKNOWN.
2017-03-28 11:02:58 +02:00
Carlo Lobrano be317e8b80 broadband-modem: fix +CPMS empty parameter support
* Add new async virtual method init_current_storages to
  MMIfaceModemMessaging
* Add logic of init_current_storages to MMBroadbandModem
* Add step "INIT_CURRENT_STORAGES" in MMIfaceModemMessaging
  initialization in order to load and store current SMS
  storages for mem1 and mem2.
* Add usage of current sms storage value for mem1 in place
  of an empty string parameter when the command AT+CPMS
  is used.

https://bugs.freedesktop.org/show_bug.cgi?id=93135
2016-03-09 14:43:08 +01:00
Aleksander Morgado a29382be70 sms: rename 'MMSms' to 'MMBaseSms'
Just so that we don't have same header names in src/ and /libmm-glib.
2014-07-06 16:55:29 +02:00
Aleksander Morgado ed623f6628 iface-modem-messaging: don't skip MT storage when reading if it's the only one 2014-06-16 18:03:38 +02:00
Aleksander Morgado f7546ad824 introspection,api: new 'Messages' property in the Messaging interface
https://bugzilla.gnome.org/show_bug.cgi?id=712276
2013-11-21 11:36:21 +01:00
Aleksander Morgado ef5aae5125 iface-modem-messaging: never add UNKNOWN to the lists of supported storages 2013-08-19 09:44:20 +02:00
Dan Williams 18436a8f77 iface-modem-messaging: fix INSTANCE_CAST() vs. GET_INTERFACE() confusion
Yeah, GObject is pretty obscure here.  But to get the implementation's
override function, we want GET_INTERFACE, otherwise we're looking at
some random memory location that's sometimes NULL.  And then we crash.
2013-02-06 15:50:22 -06:00
Aleksander Morgado b43575fdf9 iface-modem-messaging: fix storage string when reporting errors 2012-11-02 14:19:15 +01:00
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 e212f6b6ed sms: create SMS parts only when storing or sending
When a user creates an SMS object, we will expose all its properties in DBus
properly, but we will not create the internal list of SMS parts.

The list of SMS parts will be created when the SMS is stored or sent, whatever
comes first. When the message is sent and it was previously stored, the list of
parts is not re-created.

If the message requires multiple parts, the multipart reference is computed as
follows:
 * If the SMS was not stored and is being sent, we just use a random number.
 * If the SMS is being stored, we will use a multipart reference which is not
   being used already in another SMS to the same destination.
2012-09-14 07:05:26 +02:00
Aleksander Morgado b42b5795e3 iface-modem-messaging: automatically detect the best default storage
Instead of letting the plugins specify a default storage to use, just look at
the supported ones and use the best one.

"MT is preferred over "ME" or "SM", as "MT=ME+SM"
2012-09-14 07:05:23 +02:00
Aleksander Morgado bddcc2fb07 iface-modem-messaging: instead of mem1,mem2,mem3 use just a new default storage
There is no point in specifying a default 'mem1' memory storage, which is used
for reading/listing/deleting, as those are operations that need a specific
'mem1' set each time.

Also, there is no point in specifying separate default 'mem2' and 'mem3' memory
storages, specially because now we allow Sms.Store() to specify a storage.

So, we will now only have a 'default' memory storage, which is applicable for
both 'mem2' and 'mem3' (storing, sending from storage and deleting).
2012-09-14 07:05:23 +02:00
Aleksander Morgado 67081f02c8 api: new `SupportedStorages' property in the Messaging interface
We will list which are the storages allowed to use when receiving/storing SMS
messages.
2012-09-14 07:05:23 +02:00
Aleksander Morgado 96928909b9 iface-modem-messaging: setting preferred storages is a one-time operation
Selection specific storages to run actions on them can now be done with the
broadband-modem-specific lock|unlock_sms_storages() methods.
2012-09-14 07:05:22 +02:00
Aleksander Morgado 2481d97d52 iface-modem-messaging: load initial SMS parts after having set default storages
We really want the 'mem3' storage set as soon as possible.
2012-09-14 07:05:22 +02:00
Aleksander Morgado 83dc9e3e1d iface-modem-messaging: new methods to check support for storage actions
We can now check whether a specific storage is valid for receiving or storing.
2012-09-14 07:05:22 +02:00
Aleksander Morgado a90d149ce4 sms: SMS objects need to be create by `create_modem()' in the Messaging iface
So that plugins can subclass the generic SMS object.
2012-09-06 19:58:01 +02:00
Aleksander Morgado 11740e9075 iface-modem-messaging: plug memleak 2012-09-06 13:16:29 +02:00
Aleksander Morgado dd8dcbb899 messaging: don't treat as fatal error if we cannot read from a given storage 2012-07-22 13:33:07 +02:00
Ben Chan 717977d0b5 iface-modem-messaging: check if supported storage is allocated before use
load_supported_storages may fail, which results in unallocated storage
memory. This patch modifies load_initial_sms_parts_from_storages and
is_storage_supported to handle that gracefully.
2012-07-17 08:02:13 +02:00
Aleksander Morgado 9eebb75ca3 iface-modem-messaging: 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 cd63df938f libmm-common: `MMSimpleStatus' won't be considered internal any more
Renamed `MMCommonSimpleProperties' to `MMSimpleStatus', and removed the
`MMSimpleStatusProperties' provided in libmm-glib. We'll just use the original
one from libmm-common always.
2012-03-16 14:53:20 +01:00
Aleksander Morgado ef9fb0bfac libmm-common: `MMSmsProperties' won't be considered internal any more
Renamed `MMCommonSmsProperties' to `MMSmsProperties', and removed the
`MMSmsProperties' provided in libmm-glib. We'll just use the original one
from libmm-common always.
2012-03-16 14:53:19 +01:00
Aleksander Morgado 333779bda9 iface-modem-messaging: include policy authorization checks 2012-03-16 14:53:16 +01:00
Aleksander Morgado 3dd5ec64cc iface-modem-messaging: need to enable/disable SMS indications 2012-03-15 14:15:06 +01:00
Aleksander Morgado 21a722b616 core: don't pass primary port to interface initializations
They will all get it themselves.
2012-03-15 14:15:05 +01:00
Aleksander Morgado 978801ee7b sms: specify storage where the SMS is kept 2012-03-15 14:15:04 +01:00
Aleksander Morgado 50d474056d iface-modem-messaging: once all messages initially loaded, set default storages 2012-03-15 14:15:03 +01:00
Aleksander Morgado f7c41b8e48 iface-modem-messaging: use defaults when no specific storage specified 2012-03-15 14:15:03 +01:00
Aleksander Morgado 9e3f66393f iface-modem-messaging: load initial parts from all available storages 2012-03-15 14:15:03 +01:00
Aleksander Morgado 69ecae2dc4 iface-modem-messaging: new method to set preferred SMS storages 2012-03-15 14:15:03 +01:00
Aleksander Morgado f6ef117d32 iface-modem-messaging: new properties to define preferred mem1/mem2/mem3 storages 2012-03-15 14:15:03 +01:00
Aleksander Morgado 7fb1234015 iface-modem-messaging: load supported SMS storages during initialization 2012-03-15 14:15:03 +01:00
Aleksander Morgado 6bb4f9cb57 iface-modem-messaging: handle the flag to use PDU mode as a property 2012-03-15 14:15:02 +01:00
Aleksander Morgado b61c94016a api,dbus: remove the option to send the SMS in the Create() call
An SMS must be first created with the Messaging interface, and then sent using the
Send() method from the SMS-specific interface.
2012-03-15 14:15:02 +01:00
Aleksander Morgado 714e4ca44b sms: export uncomplete multipart messages as well
Uncompleted multipart SMS will be exported to DBus, where only the "state"
property is valid, so that we allow completely removing those uncompleted
multipart SMS which will never get completed due to one reason or another.
2012-03-15 14:15:02 +01:00
Aleksander Morgado ad3b3d0ba7 iface-modem-messaging: don't allow method calls if not enabled 2012-03-15 14:15:02 +01:00
Aleksander Morgado 76aaac23ec iface-modem-messaging: allow creating new SMS objects 2012-03-15 14:15:01 +01:00
Aleksander Morgado d9f5779bbb iface-modem-messaging: allow setting up unsolicited events 2012-03-15 14:15:00 +01:00
Aleksander Morgado 6f103c1366 sms-list: don't signal completed messages
We will instead not export an SMS until completed and assembled
2012-03-15 14:15:00 +01:00
Aleksander Morgado 47a9903901 iface-modem-messaging: handle SMS listing 2012-03-15 14:14:59 +01:00
Aleksander Morgado 19ce344df8 iface-modem-messaging: handle SMS deletion requests 2012-03-15 14:14:59 +01:00
Aleksander Morgado 2ede62e45e iface-modem-messaging: emit SMS added/completed/deleted signals 2012-03-15 14:14:59 +01:00
Aleksander Morgado d996ef84f4 iface-modem-messaging: load initial list of SMS parts 2012-03-15 14:14:59 +01:00
Aleksander Morgado 21b1de678d iface-modem-messaging: allow configuring preferred SMS format 2012-03-15 14:14:59 +01:00