Commit Graph

502 Commits

Author SHA1 Message Date
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
Dylan Van Assche
bdf4d898f6 libmm-glib,firmware-update-settings: setter for method
Allow to set the firmware update method even after
initialization of the MMFirmwareUpdateSettings object.
2022-02-08 19:33:51 +01:00
Iñigo Martínez
0ab9fc343f build,meson: Fix gdbus code generation
Changes on meson 0.61 makes the build to fail due to empty
annotations in some gdbus code generation[0].

Taking advantage of `kwargs` support, it has been changed to avoid
the issue.

Fixes #499

[0] https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/499
2022-01-26 16:37:57 +01:00
Aleksander Morgado
dbeeb98745 libmm-glib,modem: new methods to get list of cell infos 2022-01-18 09:00:10 +00:00
Aleksander Morgado
ec7bcc88d3 libmm-glib,cell-info-nr5g: new 'MMCellInfoNr5g' object
Implementing support for 5GNR cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado
c1fc027f66 libmm-glib,cell-info-lte: new 'MMCellInfoLte' object
Implementing support for LTE cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado
e682b8a499 libmm-glib,cell-info-tdscdma: new 'MMCellInfoTdscdma' object
Implementing support for TDSCDMA cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado
b5a5d58650 libmm-glib,cell-info-umts: new 'MMCellInfoUmts' object
Implementing support for UMTS cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado
7c7f97807b libmm-glib,cell-info-gsm: new 'MMCellInfoGsm' object
Implementing support for GSM cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado
58de2a9904 libmm-glib,cell-info-cdma: new 'MMCellInfoCdma' object
Implementing support for CDMA cell info.
2022-01-18 09:00:10 +00:00
Aleksander Morgado
bfb66970f2 libmm-glib,cell-info: new helpers to implement subclasses 2022-01-18 09:00:10 +00:00
Aleksander Morgado
3ca7201444 libmm-glib,cell-info: new 'MMCellInfo' object
Generic base object to implement support for the different types of
cell infos.

Provides support for the 'serving' boolean, which is common to all.
2022-01-18 09:00:10 +00:00
Aleksander Morgado
4515b00020 libmm-glib,modem-3gpp: fix leak when processing scan results 2022-01-07 21:35:43 +01:00
Aleksander Morgado
f97957046b libmm-glib,profile-manager: new getters for the 'IndexField' property 2021-12-24 14:06:13 +01:00
Aleksander Morgado
50fc0101f5 libmm-glib: new 'profile-source' in 3GPP profile
Not applicable to bearer properties, as this is exclusively a proflie
management setting, unrelated to connection attempts.
2021-12-24 14:03:15 +01:00
Aleksander Morgado
f6a91b2250 libmm-glib: new 'roaming-allowance' in 3GPP profile and bearer properties 2021-12-24 14:03:15 +01:00
Aleksander Morgado
24e634229d libmm-glib: new 'profile-enabled' in 3GPP profile
Not applicable to bearer properties, as this is exclusively a proflie
management setting, unrelated to connection attempts.
2021-12-24 14:03:15 +01:00
Aleksander Morgado
e61fd7ca58 libmm-glib: new 'access-type-preference' in 3GPP profile and bearer properties 2021-12-24 14:03:13 +01:00
Aleksander Morgado
5395a85443 libmm-glib,modem-3gpp: add support to get/set 5GNR registration settings 2021-12-24 12:41:27 +00:00
Aleksander Morgado
22657021fb libmm-glib: new helper to handle the 5GNR registration settings 2021-12-24 12:41:27 +00:00
Frederic Martinsons
9fc3d15d29 api, dbus, bearer: Add ReloadStatsSupported bearer dbus property
This property means that the current bearer can reload stats and read TX
and RX bytes transmitted.

The property is initiliazed as soon as the bearer is connected.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-12-13 09:35:28 +00:00