Commit Graph
522 Commits
Author SHA1 Message Date
Dominique Martinet dea8f27464 api,bearer: new 'DisconnectRequest' property
To report that the bearer has been killed from the modem side and
the connection should be terminated.

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
2025-05-16 22:06:24 +09:00
Lukas Voegl 436081648b api,modem: new 'IgnoredPorts' property
Expose a new list of 'IgnoredPorts' via D-Bus and therefore remove the use of `MM_MODEM_PORT_TYPE_IGNORED`

Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2025-04-25 09:37:16 +02:00
Guido Günther 577639659c libmm-glib,cell-broadcast: Add setters for channel list
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther d6367c76c0 libmm-glib,cell-broadcast: Support channels property
Support reading channels in the API too

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther 4414344d82 libmm-glib,helpers: Add helpers to parse CB channels in and out of strings
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther d00ff2d0a1 libmm-glib,test: Remove trailing whitespace
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther 0c20d13b30 libmm-glib,helpers: Add helpers for CellBroadcast channel lists
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-28 20:53:52 +00:00
Guido Günther 68933455df treewide: Fix typos
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-11 23:15:57 +01:00
Evangelos Ribeiro Tzaras 50759c744c cell-broadcast: Fix "Since" annotations 2025-02-24 08:06:28 +01:00
Aleksander Morgado 623e786f7c libmm-glib,unlock-retries: remove invalid 'closure' annotation
../libmm-glib/mm-unlock-retries.c:135: Warning: ModemManager:
  invalid "closure" annotation: only valid on callback parameters
2024-12-22 17:12:40 +01:00
Guido Günther 0e4bc1b6ea api: Add Cell Broadcast support
Add access to the modem's CellBroadcast interface and to fetch
Cell Broadcast messages.

Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/253
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther 62f7b76e8e cbm: Add CellBroadcast interface
This adds support for the Cell Broadcast interface allowing to
receive, list, read and delete Cell Broadcast messages via the
org.freedesktop.ModemManager1.Modem.CellBroadcast and
org.freedesktop.ModemManager1.Cbm interfaces.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Akula Susmitha f22d099f38 api,core,mmcli: Add new 'API' support to set-default-storage for SMS
API support has been added to set default storage for SMS.
Changes were made to get, set the deafult storage value.
2024-10-07 16:35:09 +05:30
Ujjwal Pande 2904510e76 api: new NetworkRejection property
When a modem is not able to register to the network, MBIM and QMI indications
related to registration reports network rejection cause codes if request is
rejected by the network. This information is currently logged in the ModemManager
but not exposed outside of ModemManager.
These are the changes to define interface to expose network reject cause codes
over d-bus to the above layers which could be used by above layers to present
this information in a user friendly way.
2024-06-12 09:39:12 +00:00
Lubomir Rintel bd0551460b libmm-glib/signal: fix a copy'n'paste error 2024-05-31 10:46:59 +00:00
Aleksander Morgado 2ac4bda846 libmm-glib,3gpp-profile: fix loading roaming allowance in DBus dictionary 2024-02-01 14:59:55 +00:00
Aleksander Morgado 06eafc8c19 libmm-glib,3gpp-profile: fix loading profile source in DBus dictionary 2024-02-01 14:59:55 +00:00
Chris Talbot d84cc1a80a mm-sms-properties: document mm_sms_properties_set_validity_relative () 2023-12-12 11:39:45 +00:00
Aleksander Morgado 2de0763ac8 api,errors: new MMCarrierLockError type
This new error type will be used to report errors in the carrier lock
operations performed through ModemManager.

They have a one to one mapping to the MBIM status specific errors.
2023-10-27 07:33:44 +00:00
Ujjwal Pande ae02c47634 ModemManager: Add force option to set initial EPS bearer settings
Adding a new force option to force send initial EPS bearer settings to
modem even if they match the existing ones. Currently settings are
not sent to the modem if they match old settings
2023-10-11 14:07:53 +00:00
Lukas Voegl 8cd1c1bdb9 api,modem: new 'Physdev' property
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2023-09-18 10:53:12 +02:00
Ujjwal Pande e3a1206c57 api: new carrier lock support
Adding support for carrier lock for MBIM modems using google simlock
mechanism.
2023-06-08 20:16:12 +00:00
Maxim Anisimov 7f476c2e27 libmm-glib,location-3gpp: fix conversion to gulong in mm_location_3gpp_new_from_string_variant
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2023-05-09 09:15:12 +00:00
Aleksander Morgado bf2843ad77 libmm-glib: separate files for flags and enums types
This allows us to skip needing to include the non-existent
build_string_from_mask() or get_string() counterparts in the
documentation index.
2023-04-27 12:23:04 +00:00
Aleksander Morgado efcfce02a9 build-aux,mkenums: import custom mkenums tool from libqmi/libmbim
We're going to use certain new features included in the custom tool.
2023-04-27 12:23:04 +00:00
Frederic Martinsons 02aafa2948 libmm-glib,common-helpers: Add multiple apn-type management
Fixes #676

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
2023-02-17 10:46:44 +00:00
Frederic Martinsons 511f712160 libmm-glib,tests: extend tests for common helpers (string conversion)
Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
2023-02-17 10:46:44 +00:00
som e8d63c1743 modem-cellinfo: adding bandwidth and serving cell type
adding bandwidth information in mm-dbus interface
for the serving cell. In serving cell, the details
on whether the pcell/scell are from MCS or SCG is
also updated.

Co-author: Shilpa Shivakumar
2023-02-17 10:43:20 +00:00
Lubomir Rintel 1af34e1746 libmm-glib,common-helpers: undeprecate g_date_time_format_iso8601()
Avoid a deprecation warning with too new glib:

  ../libmm-glib/mm-common-helpers.c: In function ‘date_time_format_iso8601’:
  ../libmm-glib/mm-common-helpers.c:1729:5: warning: ‘g_date_time_format_iso8601’ is deprecated: Not available before 2.62 [-Wdeprecated-declarations]
   1729 |     return g_date_time_format_iso8601 (dt);
        |     ^~~~~~

This call site is protected by version guards and provides an alternative
implementation in date_time_format_iso8601().
2023-01-18 10:51:40 +00:00
Lubomir Rintel 6179667d3d libmm-glib,common-helpers: avoid using g_time_zone_new_offset()
It requires newer glib than we do:

  ../libmm-glib/mm-common-helpers.c: In function ‘mm_new_iso8601_time’:
  ../libmm-glib/mm-common-helpers.c:1787:9: warning: ‘g_time_zone_new_offset’ is deprecated: Not available before 2.58 [-Wdeprecated-declarations]
   1787 |         tz = g_time_zone_new_offset (offset_minutes * 60);
        |         ^~
  In file included from /usr/include/glib-2.0/glib/gdatetime.h:33:
  /usr/include/glib-2.0/glib/gtimezone.h:67:25: note: declared here
     67 | GTimeZone *             g_time_zone_new_offset                          (gint32       seconds);
        |                         ^~~~~~~~~~~~~~~~~~~~~~

Let's not use the routine with older versions of glib.
2023-01-18 10:51:40 +00:00
Fabrice Fontaine a9651f2390 meson: Un-hardcode building a shared library
Use library() instead of shared_library() to allow specifying which kind
of library to build with "meson setup --default-library ..."

This will avoid the following static build failure:

FAILED: src/ModemManager
/home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/bin/m68k-linux-gcc  -o src/ModemManager src/ModemManager.p/meson-generated_.._mm-daemon-enums-types.c.o src/ModemManager.p/main.c.o src/ModemManager.p/mm-auth-provider.c.o src/ModemManager.p/mm-base-bearer.c.o src/ModemManager.p/mm-base-call.c.o src/ModemManager.p/mm-base-manager.c.o src/ModemManager.p/mm-base-modem-at.c.o src/ModemManager.p/mm-base-modem.c.o src/ModemManager.p/mm-base-sim.c.o src/ModemManager.p/mm-base-sms.c.o src/ModemManager.p/mm-bearer-list.c.o src/ModemManager.p/mm-broadband-bearer.c.o src/ModemManager.p/mm-broadband-modem.c.o src/ModemManager.p/mm-call-list.c.o src/ModemManager.p/mm-context.c.o src/ModemManager.p/mm-device.c.o src/ModemManager.p/mm-dispatcher.c.o src/ModemManager.p/mm-dispatcher-connection.c.o src/ModemManager.p/mm-dispatcher-fcc-unlock.c.o src/ModemManager.p/mm-filter.c.o src/ModemManager.p/mm-iface-modem-3gpp.c.o src/ModemManager.p/mm-iface-modem-3gpp-profile-manager.c.o src/ModemManager.p/mm-iface-modem-3gpp-ussd.c.o src/ModemManager.p/mm-iface-modem.c.o src/ModemManager.p/mm-iface-modem-cdma.c.o src/ModemManager.p/mm-iface-modem-firmware.c.o src/ModemManager.p/mm-iface-modem-location.c.o src/ModemManager.p/mm-iface-modem-messaging.c.o src/ModemManager.p/mm-iface-modem-oma.c.o src/ModemManager.p/mm-iface-modem-sar.c.o src/ModemManager.p/mm-iface-modem-signal.c.o src/ModemManager.p/mm-iface-modem-simple.c.o src/ModemManager.p/mm-iface-modem-time.c.o src/ModemManager.p/mm-iface-modem-voice.c.o src/ModemManager.p/mm-plugin.c.o src/ModemManager.p/mm-plugin-manager.c.o src/ModemManager.p/mm-port-probe.c.o src/ModemManager.p/mm-port-probe-at.c.o src/ModemManager.p/mm-private-boxed-types.c.o src/ModemManager.p/mm-sms-list.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -static '-Wl,-rpath,$ORIGIN/../libmm-glib' -Wl,-rpath-link,/home/autobuild/autobuild/instance-11/output-1/build/modem-manager-1.20.2/build/libmm-glib -Wl,--start-group src/libport.a src/libkerneldevice.a src/libhelpers.a libmm-glib/libmm-glib.so.0.9.0 libqcdm/src/libqcdm.a libmm-glib/generated/tests/libmm-test-generated.a -Wl,--export-dynamic /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libgmodule-2.0.a /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libglib-2.0.a -pthread -lm /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libpcre.a /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libgio-2.0.a /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libgobject-2.0.a /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libffi.a /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libz.a /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libmount.a /home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/m68k-buildroot-linux-uclibc/sysroot/usr/lib/libblkid.a -Wl,--end-group
/home/autobuild/autobuild/instance-11/output-1/per-package/modem-manager/host/opt/ext-toolchain/bin/../lib/gcc/m68k-buildroot-linux-uclibc/11.2.0/../../../../m68k-buildroot-linux-uclibc/bin/ld: attempted static link of dynamic object `libmm-glib/libmm-glib.so.0.9.0'

Fixes:
 - http://autobuild.buildroot.org/results/9803d593305df36c4a8d67aac2fb4c9a3120a072

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-12-31 13:18:04 +00:00
Aleksander Morgado f419f56628 build: drop autotools 2022-11-07 14:26:02 +00:00
Aleksander Morgado 7ea2452b1e build: fix building without tests support 2022-11-07 14:25:34 +00:00
Pavan Holla 1533112182 iface-modem-signal: print signal quality under INFO verbosity 2022-11-04 13:12:57 +00:00
Aleksander Morgado 5bfa677bbc libmm-glib,simple-connect-properties: new print() method 2022-11-04 13:12:56 +00:00
Aleksander Morgado 46af452487 libmm-glib,bearer-properties: new print() method 2022-11-04 13:12:56 +00:00
Aleksander Morgado a114e131ab libmm-glib,3gpp-profile: new print() method
Can be used right away in the mmcli output generation logic.
2022-11-04 13:12:56 +00:00
Aleksander Morgado 0e6660025e libmm-glib,common: add helpers to build printable strings 2022-11-04 13:12:56 +00:00
Aleksander Morgado 976a3d4d82 libmm-glib,common-helpers: minor coding style fix in mm_new_iso8601_time() 2022-10-05 09:07:06 +00:00
Aleksander Morgado bfba265009 libmm-glib,common-helpers: don't assume new_from_unix_utc() always succeeds
The g_date_time_new_from_unix_utc() method in glib2 may fail if the
given timestamp is too far into the future. The value is supposed to
be seconds since unix time origin, but internally it will be converted
into usecs, so any value longer than G_MAXINT64 / USEC_PER_SECOND
isn't allowed.

This is currently used in the CLI, and we're anyway ignoring the error
returned in that case, but at least it won't crash if it ever happens.
2022-10-05 09:06:22 +00:00
Aleksander Morgado 74fc5baca2 core: port GRegex/GMatchInfo to use autoptr()
The behavior of GRegex changed in 2.73.2 once it was ported from pcre1
to pcre2. In some cases it was made more strict, which is fine, in
other cases it exposed some change in how it behaves on certain
matches that is not extremely clear whether it's ok or not.

See https://gitlab.gnome.org/GNOME/glib/-/issues/2729
See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601
See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/621

Either way, one thing that was assumed was that initializing all
GRegex/GMatchInfo variables to NULL and making sure they're NULL
before they're initialized by glib (especially the GMatchInfo) was a
good and safer approach.

So, whenever possible, g_autoptr() is used to cleanup the allocated
GMatchInfo/GRegex variables, and otherwise, g_clear_pointer() is used
to ensure that no free/unref is attempted unless the given variable is
not NULL, and also so that the variable is reseted to NULL after being
disposed.
2022-09-05 17:33:11 +00:00
Aleksander Morgado 451eb040cd libmm-glib,sms: simplify 'data' property retrieval logic 2022-08-19 15:53:43 +00:00
Aleksander Morgado cd933c740e libmm-glib,sim: add support to get GID1 and GID2 fields 2022-08-19 15:53:43 +00:00
Aleksander Morgado 219efb0253 libmm-glib,sim: add missing separators in source code 2022-08-19 15:53:43 +00:00
Louis-Alexis Eyraud a97b58ebf7 libmm-glib,profile-manager: fix memory leaks when listing connection profiles
This commit fixes memory leaks that occur when invoking
mm_modem_3gpp_profile_manager_list function.

When processing the connection profile data retrieved from dbus
in build_list_results function, the iterator data (of GVariant type)
were not properly freed after use in the while loop.

==7903== 2,697 (144 direct, 2,553 indirect) bytes in 3 blocks are definitely lost in loss record 2,525 of 2,538
==7903==    at 0x484086F: malloc (vg_replace_malloc.c:381)
==7903==    by 0x4A13938: g_malloc (gmem.c:106)
==7903==    by 0x4A2B1F4: g_slice_alloc (gslice.c:1069)
==7903==    by 0x4A51322: UnknownInlinedFun (gvariant-core.c:486)
==7903==    by 0x4A51322: UnknownInlinedFun (gvariant-core.c:624)
==7903==    by 0x4A51322: g_variant_builder_end (gvariant.c:3718)
==7903==    by 0x4C2FEC1: parse_value_from_blob.isra.0 (gdbusmessage.c:1866)
==7903==    by 0x4C2FE8F: parse_value_from_blob.isra.0 (gdbusmessage.c:1766)
==7903==    by 0x4C2FF37: parse_value_from_blob.isra.0 (gdbusmessage.c:1850)
==7903==    by 0x4BF93A7: g_dbus_message_new_from_blob (gdbusmessage.c:2226)
==7903==    by 0x4C09334: _g_dbus_worker_do_read_cb (gdbusprivate.c:750)
==7903==    by 0x4B9EA79: g_task_return_now (gtask.c:1219)
==7903==    by 0x4B9EABC: complete_in_idle_cb (gtask.c:1233)
==7903==    by 0x4A0774A: g_idle_dispatch (gmain.c:5848)

Signed-off-by: Louis-Alexis Eyraud <louis-alexis.eyraud@unabiz.com>
2022-08-09 14:53:34 +02:00
Dylan Van Assche ba96ccc615 build: make tests optional
Add a meson option -Dtests and --without-tests automake option
to disable the compilation of all available testcases.
This is useful for compiling projects with Flatpak such as
GNOME Control Center which disables all possible integrations since they
only need the DBus part of ModemManager.

Contributes to https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1392
2022-07-25 11:01:51 +02:00
Carlo Lobrano ac243f9467 sms: prevent crash if date is out of range
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out
of range, and currently mm_new_iso8601_time passes the GDateTime created
by those two functions to date_time_format_iso8601 without checking for
NULL values, causing a g_date_time_format_iso8601 crash if PDU data is
corrupted with wrong date.

To prevent this, mm_new_iso8601_time now can return NULL and set a new
GError if GDateTime created by g_date_time_new is NULL.

Fixes #546
2022-04-08 15:41:49 +02:00
Andrew Lassalle 9793378870 bearer-properties: Match UNKNOWN auth to CHAP for loose comparison
MBIM and QMI fallback to CHAP when a username or password is present
but no authentication type was provided. Consider CHAP==UNKNOWN when
using loose comparison.
2022-03-29 16:01:30 +00:00
Aleksander Morgado 19ecd327dc build,meson: fix 'export_packages' in GIR setup
The 'export_packages' field in the generate_gir() command should
include the name of the pkg-config package being exported, not the
name of the library file.

Without this change, building GIR files depending on the one we
provide here would fail as the corresponding .pc file isn't found.
2022-02-14 15:16:07 +00:00
Pablo Barciela 839af5553f mm-call-audio-format: avoid redundant condition 2022-02-14 10:40:28 +01:00