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
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().
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.
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.
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.
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>
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
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
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.
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.
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>