aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-messaging.c
AgeCommit message (Collapse)Author
2023-10-27core: ensure all errors returned in DBus operations are normalizedAleksander Morgado
We want to ensure that all errors reported via DBus operations are normalized to MM-specific errors. We don't want to return QMI or MBIM specific errors, as those are protocol specific and we don't want DBus clients to need to rely on knowing which is the protocol in use by the device.
2022-11-30iface-modem-messaging: improve logging of user operationsAleksander Morgado
2022-11-30iface-modem-messaging: refactor memory management in handlersAleksander Morgado
Use g_auto* helpers where needed, and switch to use the slice allocator for the handler operation contexts.
2022-11-30iface-modem-messaging: use the abort_invocation_if_state_not_reached() helperAleksander Morgado
2022-11-30iface-modem-messaging: allow Delete operation during enabling/disablingAleksander Morgado
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/671
2020-09-19iface-modem-messaging: if sms list doesn't exist, free partAleksander Morgado
If the device goes away while we are listing SMS messages, it may happen that we ask the messaging interface to take a part and the sms list object has already been disposed. Make sure the part is freed in that case, so that we avoid memory leaks. ==19138== 6,914 (1,232 direct, 5,682 indirect) bytes in 11 blocks are definitely lost in loss record 5,282 of 5,287 ==19138== at 0x483A77F: malloc (vg_replace_malloc.c:307) ==19138== by 0x5023349: g_malloc (in /usr/lib/libglib-2.0.so.0.6600.0) ==19138== by 0x50446FF: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.6600.0) ==19138== by 0x5044D6A: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.6600.0) ==19138== by 0x2577FC: mm_sms_part_new (mm-sms-part.c:180) ==19138== by 0x2504D0: mm_sms_part_3gpp_new_from_binary_pdu (mm-sms-part-3gpp.c:385) ==19138== by 0x21A15C: add_sms_part (mm-broadband-modem-mbim.c:5169) ==19138== by 0x21A31F: sms_read_query_ready (mm-broadband-modem-mbim.c:5215) ==19138== by 0x4E600F3: ??? (in /usr/lib/libgio-2.0.so.0.6600.0) ==19138== by 0x4E64638: ??? (in /usr/lib/libgio-2.0.so.0.6600.0) ==19138== by 0x4D3870D: transaction_task_complete_and_free (mbim-device.c:236) ==19138== by 0x4D396B9: process_message (mbim-device.c:616)
2020-05-19iface-modem-messaging: avoid cast-align errorsAleksander Morgado
We can safely cast the data in a GArray to gpointer first, and then to the pointer type we require. mm-iface-modem-messaging.c: In function 'load_supported_storages_ready': mm-iface-modem-messaging.c:1154:53: error: cast increases required alignment of target type [-Werror=cast-align] mem1 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem1->data, ^ mm-iface-modem-messaging.c:1156:53: error: cast increases required alignment of target type [-Werror=cast-align] mem2 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem2->data, ^ mm-iface-modem-messaging.c:1158:53: error: cast increases required alignment of target type [-Werror=cast-align] mem3 = mm_common_build_sms_storages_string ((MMSmsStorage *)storage_ctx->supported_mem3->data, ^
2020-04-08iface-modem-messaging: port to use object loggingAleksander Morgado
2020-01-30iface-modem-messaging: fix warnings with -Wimplicit-fallthroughAleksander Morgado
mm-iface-modem-messaging.c: In function ‘interface_disabling_step’: mm-iface-modem-messaging.c:615:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 615 | ctx->step++; | ~~~~~~~~~^~ mm-iface-modem-messaging.c:617:5: note: here 617 | case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS: | ^~~~ ...
2020-01-30iface-modem-messaging: fix warnings with -Wswitch-defaultAleksander Morgado
mm-iface-modem-messaging.c: In function ‘interface_disabling_step’: mm-iface-modem-messaging.c:612:5: error: switch missing default case [-Werror=switch-default] 612 | switch (ctx->step) { | ^~~~~~ ...
2019-05-08iface-modem-messaging: flush sms list update before notifying added/removedAleksander Morgado
So that clients are able to have the full updated list before the list update notification.
2018-09-25iface-modem-messaging: if only one storage supported, select it right awayAleksander Morgado
Some plugins or implementations (e.g. notably MBIM) may report a single storage as supported and no way to update the current default storage. In this specific case, we will initialize the default storage to that single one supported right away, regardless of whether selecting others is implemented or not.
2018-04-24all: drop unused variablesLubomir Rintel
Keeps build with GCC 8 happy. mm-base-call.c:758:18: warning: variable 'response' set but not used [-Wunused-but-set-variable] mm-base-call.c:822:18: warning: variable 'response' set but not used [-Wunused-but-set-variable] mm-base-sms.c:908:18: warning: variable 'response' set but not used [-Wunused-but-set-variable] mm-sms-list.c:331:25: warning: variable 'ctx' set but not used [-Wunused-but-set-variable] mm-iface-modem-messaging.c:1210:21: warning: variable 'storage_ctx' set but not used [-Wunused-but-set-variable] huawei/mm-plugin-huawei.c:183:18: warning: variable 'response' set but not used [-Wunused-but-set-variable] ublox/mm-plugin-ublox.c:161:24: warning: variable 'response' set but not used [-Wunused-but-set-variable] ublox/mm-plugin-ublox.c:159:24: warning: variable 'ctx' set but not used [-Wunused-but-set-variable] icera/mm-modem-helpers-icera.c:218:25: warning: variable 'first_free' set but not used [-Wunused-but-set-variable] novatel/mm-common-novatel.c:50:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
2017-06-28iface-modem-messaging: port mm_iface_modem_messaging_disable to use GTaskBen Chan
2017-06-28iface-modem-messaging: port mm_iface_modem_messaging_enable to use GTaskBen Chan
2017-06-28iface-modem-messaging: port mm_iface_modem_messaging_initialize to use GTaskBen Chan
2017-03-28broadband-modem: fixed wrong MEM1 value passed to +CPMSCarlo Lobrano
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.
2016-03-09broadband-modem: fix +CPMS empty parameter supportCarlo Lobrano
* 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
2014-07-06sms: rename 'MMSms' to 'MMBaseSms'Aleksander Morgado
Just so that we don't have same header names in src/ and /libmm-glib.
2014-06-16iface-modem-messaging: don't skip MT storage when reading if it's the only oneAleksander Morgado
2013-11-21introspection,api: new 'Messages' property in the Messaging interfaceAleksander Morgado
https://bugzilla.gnome.org/show_bug.cgi?id=712276
2013-08-19iface-modem-messaging: never add UNKNOWN to the lists of supported storagesAleksander Morgado
2013-02-06iface-modem-messaging: fix INSTANCE_CAST() vs. GET_INTERFACE() confusionDan Williams
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.
2012-11-02iface-modem-messaging: fix storage string when reporting errorsAleksander Morgado
2012-10-11core: make sure objects retrieved with g_object_get() are valid in the ifacesAleksander Morgado
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-04libmm-glib: remove the `libmm-common.h' headerAleksander Morgado
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-09-14sms: create SMS parts only when storing or sendingAleksander Morgado
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-14iface-modem-messaging: automatically detect the best default storageAleksander Morgado
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-14iface-modem-messaging: instead of mem1,mem2,mem3 use just a new default storageAleksander Morgado
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-14api: new `SupportedStorages' property in the Messaging interfaceAleksander Morgado
We will list which are the storages allowed to use when receiving/storing SMS messages.
2012-09-14iface-modem-messaging: setting preferred storages is a one-time operationAleksander Morgado
Selection specific storages to run actions on them can now be done with the broadband-modem-specific lock|unlock_sms_storages() methods.
2012-09-14iface-modem-messaging: load initial SMS parts after having set default storagesAleksander Morgado
We really want the 'mem3' storage set as soon as possible.
2012-09-14iface-modem-messaging: new methods to check support for storage actionsAleksander Morgado
We can now check whether a specific storage is valid for receiving or storing.
2012-09-06sms: SMS objects need to be create by `create_modem()' in the Messaging ifaceAleksander Morgado
So that plugins can subclass the generic SMS object.
2012-09-06iface-modem-messaging: plug memleakAleksander Morgado
2012-07-22messaging: don't treat as fatal error if we cannot read from a given storageAleksander Morgado
2012-07-17iface-modem-messaging: check if supported storage is allocated before useBen Chan
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-03-16iface-modem-messaging: let initialization and enabling sequences get cancelledAleksander Morgado
2012-03-16base-modem: new port getters and peekersAleksander Morgado
* 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-16libmm-common: `MMSimpleStatus' won't be considered internal any moreAleksander Morgado
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-16libmm-common: `MMSmsProperties' won't be considered internal any moreAleksander Morgado
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-16iface-modem-messaging: include policy authorization checksAleksander Morgado
2012-03-15iface-modem-messaging: need to enable/disable SMS indicationsAleksander Morgado
2012-03-15core: don't pass primary port to interface initializationsAleksander Morgado
They will all get it themselves.
2012-03-15sms: specify storage where the SMS is keptAleksander Morgado
2012-03-15iface-modem-messaging: once all messages initially loaded, set default storagesAleksander Morgado
2012-03-15iface-modem-messaging: use defaults when no specific storage specifiedAleksander Morgado
2012-03-15iface-modem-messaging: load initial parts from all available storagesAleksander Morgado
2012-03-15iface-modem-messaging: new method to set preferred SMS storagesAleksander Morgado
2012-03-15iface-modem-messaging: new properties to define preferred mem1/mem2/mem3 ↵Aleksander Morgado
storages