Commit Graph
489 Commits
Author SHA1 Message Date
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
Aleksander Morgado 0eda648bb9 libmm-glib,sim: new 'SimType', 'Removability' and 'EsimStatus' properties 2021-12-11 12:53:37 +01:00
Aleksander Morgado b07ce3cb87 libmm-glib,sim: reoder get_preferred_networks()
Add it along with the other getters.
2021-12-11 12:53:37 +01:00
Aleksander Morgado d2b620c5fa libmm-glib,modem: fix warning when loading SIM slots
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/465
2021-11-22 13:04:52 +00:00
Aleksander Morgado 21c775703c libmm-glib: fix license in sources
The libmm-glib library is LGPLv2+, not GPLv2+.
2021-11-16 17:54:26 +01:00
Som_SP 511859ef0a api,bearer: add 'uplink-speed' and 'downlink-speed' stats
These values show the rates that have been negotiated with the network
during the PS domain attach.

These are not the current ongoing data rates associated to the network
usage at some given moment.

Includes updates by Aleksander Morgado to fix coding style issues and
add missing documentation items.
2021-11-03 12:41:51 +01:00
Aleksander Morgado 3ab765f11c api,3gpp: new 'SetPacketServiceState()' method 2021-11-02 09:50:17 +00:00
Aleksander Morgado f55ea211a9 api,3gpp: new 'PacketServiceState' property
This property allows the user to know whether the device is attached
or detached from the packet domain service.
2021-11-02 09:50:17 +00:00
Michal Mazur c487ca1b36 libmm-glib: add documentation for disable_facility_lock 2021-10-22 16:23:40 +02:00
Frederic Martinsons 9d82d30978 cli, plugins: factorize usage of iso8601 datetime format
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Includes updates by Aleksander Morgado to fix coding style issues.
2021-10-22 13:48:20 +02:00
Frederic Martinsons 0510e9aef8 api,bearer: new 'start-date' field in bearer statistics
It stores the epoch timestamp of the current bearer session start.
If there is no connected bearer, it is set to 0 and not displayed
in mmcli output.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Includes updates by Aleksander Morgado to fix coding style issues.
2021-10-22 13:48:13 +02:00
Aleksander Morgado e8c4b88493 libmm-glib: new 'MMSignalThresholdProperties' helper object
To avoid needing to work with GVariants directly.
2021-10-20 22:14:57 +02:00
Som_SP 925f0bae11 libmm-glib,mmcli: add support for the new signal 'SetupThresholds()' API
Includes updates by Aleksander Morgado to fix mostly coding style issues.
2021-10-20 22:09:18 +02:00
Som_SP 9537261651 libmm-glib,mmcli: add support for 'error-rate' measurements in signal info
Includes updates by Aleksander Morgado to fix mostly coding style issues.
2021-10-20 22:07:24 +02:00