Age | Commit message (Collapse) | Author |
|
Not used for anything anymore so we can remove the property.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
No longer depend on MMBaseModem since everything that specifically
uses it is now removed.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Instead of going through the messaging interface, which just asks
the MMSmsList anyway, just go straight to the list.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Instead of getting it from the MMIfaceModemMessaging when the
SMS is stored. This flattens dependencies between MMBaseSms and
MMIfaceModemMessaging.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
MMBroadbandModem class
This commit moves creation of the MMBaseSms objects out of MMSmsList and up
into MMIfaceModemMessaging (which is already a MMBroadbandModem) and
the MMBroadbandModem subclasses themselves.
This flattens the creation of MMBaseSms objects by passing them down
from the object that creates the SMS parts, rather than having a
convoluted callback scheme relying on MMSmsList and MMBaseSms having
direct knowledge of their owning modem.
The goal is to eventually remove usage of MMBaseModem from MMBaseSms
and MMSmsList so that we can test them more easily.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Allows us to test things that rely on MMBaseSms more easily..
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Continues removing usage of MMBaseModem in a bunch of files
by splitting out bits of its usage to separate interfaces.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Rather than make all of them rely on MMBaseModem for it. This
lets us disentangle dependencies for easier unit testing.
For interfaces, rather than casting directly to MMBaseModem
use intermediate interfaces (MMIfaceAuth and MMIfaceOpLock)
that tests can fake out.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
|
Signed-off-by: Akula Susmitha <quic_asusmith@quicinc.com>
|
|
Check for supported storages before setting default storage.
Signed-off-by: Akula Susmitha <quic_asusmith@quicinc.com>
|
|
API support has been added to set default storage for SMS.
Changes were made to get, set the deafult storage value.
|
|
|
|
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.
|
|
|
|
Use g_auto* helpers where needed, and switch to use the slice
allocator for the handler operation contexts.
|
|
|
|
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/671
|
|
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)
|
|
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,
^
|
|
|
|
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:
| ^~~~
...
|
|
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) {
| ^~~~~~
...
|
|
So that clients are able to have the full updated list before the list
update notification.
|
|
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.
|
|
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]
|
|
|
|
|
|
|
|
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.
|
|
* 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
|
|
Just so that we don't have same header names in src/ and /libmm-glib.
|
|
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=712276
|
|
|
|
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.
|
|
|
|
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
|
|
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.
|
|
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.
|
|
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"
|
|
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).
|
|
We will list which are the storages allowed to use when receiving/storing SMS
messages.
|
|
Selection specific storages to run actions on them can now be done with the
broadband-modem-specific lock|unlock_sms_storages() methods.
|
|
We really want the 'mem3' storage set as soon as possible.
|
|
We can now check whether a specific storage is valid for receiving or storing.
|
|
So that plugins can subclass the generic SMS object.
|
|
|
|
|
|
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.
|