530 Commits
Author SHA1 Message Date
Aleksander Morgado f8bf6673db libmm-glib,3gpp-profile: fix profile comparison logic
Conveniently warned by the compiler...

  ../libmm-glib/mm-3gpp-profile.c: In function ‘mm_3gpp_profile_cmp’:
  ../libmm-glib/mm-3gpp-profile.c:98:1: warning: control reaches end of non-void function [-Wreturn-type]
     98 | }
        | ^
2021-09-07 10:55:43 +00:00
Aleksander Morgado 12ada44156 libmm-glib,simple-status: avoid shadowing 'properties' variable
../libmm-glib/mm-simple-status.c: In function ‘mm_simple_status_new_from_dictionary’:
  ../libmm-glib/mm-simple-status.c:426:21: warning: declaration of ‘properties’ shadows a global declaration [-Wshadow]
    426 |     MMSimpleStatus *properties;
        |                     ^~~~~~~~~~
  ../libmm-glib/mm-simple-status.c:55:20: note: shadowed declaration is here
     55 | static GParamSpec *properties[PROP_LAST];
        |                    ^~~~~~~~~~
2021-09-07 10:55:43 +00:00
Aleksander Morgado 93a0476b4d libmm-glib,manager: fix warning with -Wdiscarded-qualifiers
In file included from /usr/include/glib-2.0/glib.h:50,
                   from ../libmm-glib/mm-common-helpers.h:18,
                   from ../libmm-glib/mm-manager.c:27:
  /usr/include/glib-2.0/glib/ghash.h:68:61: note: expected ‘gpointer’ {aka ‘void *’} but argument is of type ‘const char *’
     68 |                                             gpointer        key,
        |                                             ~~~~~~~~~~~~~~~~^~~
  ../libmm-glib/mm-manager.c:81:43: warning: passing argument 2 of ‘g_hash_table_insert’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     81 |         g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Simple",                   GSIZE_TO_POINTER (MM_TYPE_MODEM_SIMPLE));
        |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /usr/include/glib-2.0/glib.h:50,
                   from ../libmm-glib/mm-common-helpers.h:18,
                   from ../libmm-glib/mm-manager.c:27:
2021-09-07 10:55:43 +00:00
Iñigo Martínez 77d1c24361 build: Port to meson
meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.
2021-09-07 10:55:43 +00:00
Teemu Ikonen d6dafe5cb4 location-gps-nmea: Fix handling of multi-sentence NMEA messages
Fixes the regexp in check_append_or_replace() to accept

 1. more multi-sentence NMEA messages (ALM, GSV, RTE, SFI)
 2. multi-sentence NMEA messages from all talkers, not just GPS
    (i.e. GPGSV, GLGSV, GAGSV etc.)
2021-08-30 06:49:59 +00:00
Aleksander Morgado 686e37ff84 api: remove Modem.Sar interface
There is no real implementation for it yet, so let's recover these
changes once 1.18 has been released.
2021-08-09 23:03:23 +02:00
Iñigo Martínez 7c4db66eb3 build: Rename template files
The template files in the `build-aux` directory used in enums sources
and headers generation use the `{$name}-template.[ch]` pattern.
However, the examples in the official guide[0] and usually GNOME and
Freedesktop packages use the `{$name}.[ch].template` pattern.

Due to this, the name of the template files and build commands have
been changed.

[0] https://developer.gnome.org/gobject/stable/glib-mkenums.html
2021-07-30 10:14:52 +00:00
Benoît Monin dc66ee2aaa libmm-glib,common-helpers: fix build with glib 2.56
The support of autoptr for GEnumClass and GFlagsClass was introduced in
glib 2.58. To keep compatibility with glib 2.56, declare the autoptr
cleanup functions.

Fixes #397
2021-07-09 10:07:52 +00:00
Aleksander Morgado 132fc268b8 libmm-glib,call: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado 19b3a55230 libmm-glib,bearer: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado 5012c1a3f3 libmm-glib,modem-signal: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado b8e939ceac libmm-glib,modem-location: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado 6372d97e87 libmm-glib,modem-firmware: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado 1ecbc5e025 libmm-glib,modem-time: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado f72a6377f3 libmm-glib,modem-oma: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado 434d7be3f2 libmm-glib,modem-messaging: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado ccefbbc0c6 libmm-glib,modem-3gpp: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado d7acc276e5 libmm-glib,modem: use helper macros to manage the monitored properties 2021-07-01 23:38:04 +02:00
Aleksander Morgado 22396a7d1d libmm-glib,helpers: new helper macros to define common property management 2021-07-01 23:38:04 +02:00
Aleksander Morgado afc7e5f902 libmm-glib: use single mutex in each type to sync access
There is truly no need for a per-property mutex, using a global one
for the whole object is equally fine.
2021-07-01 15:18:44 +02:00
Aleksander Morgado 30c9fc65da libmm-glib,common-helpers: refactor helper methods
Remove unused methods, like all the variant_to_array() ones, and
reorder some others so that both header and source file have the same
order always.
2021-07-01 15:18:44 +02:00
Aleksander Morgado f226b63301 libmm-glib,location: new signaled location API support
We allow clients to receive asynchronous updates of location
information, e.g. if "location signaling" is explicitly enabled (with
the setup() method).

But if so, we should also allow clients to easily process those
asynchronous updates in the libmm-glib library, instead of requiring
them to run explicit DBus queries to refresh the location information.

These new signaled location APIs allow clients to do so; they can
enable location signaling, and then just wait for the updates to
arrive.
2021-07-01 01:10:39 +02:00
Aleksander Morgado 4e4cb6d66a libmm-glib,location: build_locations() doesn't own the dictionary
Rework the build_locations() method so that it doesn't take ownership
of the input dictionary. This allows us reusing this method with
dictionaries for which ownership cannot be transferred.
2021-06-30 23:02:33 +02:00
Aleksander Morgado 12613eac87 libmm-glib,modem: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado 4bf7657086 libmm-glib,location-3gpp: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado 219700ba6d libmm-glib,simple-status: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado a09b13de86 libmm-glib,pco: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado 27a192c1ef libmm-glib,modem-3gpp: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado 6363add86a libmm-glib,location-gps-nmea: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado b38586a12c libmm-glib,simple-connect-properties: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado febd5778e7 libmm-glib,bearer-properties: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado c1fae670b7 libmm-glib,call-properties: move deprecated methods to compat source 2021-06-25 19:01:06 +02:00
Aleksander Morgado 49f52d9182 libmm-glib,location-gps-nmea: add missing type check in get_traces() 2021-06-25 19:01:06 +02:00
Aleksander Morgado c368a63e01 libmm-glib,oma: deprecate method names without the mm_modem_oma prefix 2021-06-25 10:56:38 +02:00
Aleksander Morgado fefd59e3ce libmm-glib,3gpp: fix initial-eps-bearer-settings property updates 2021-06-25 10:36:25 +02:00
Aleksander Morgado dfeaec99ce libmm-glib,messaging: avoid array cleanup in get_supported_storages()
If we return a reference to the internal array in
ensure_internal_supported_storages() and then we free the array
unconditionally in the caller, the next time we call it, the array
would be valid, but it would be fully empty.
2021-06-24 15:51:04 +02:00
Aleksander Morgado 059f13ffd3 libmm-glib,modem: add missing input argument checks 2021-06-24 15:43:33 +02:00
Aleksander Morgado de6b1324cb api,bearer: new 'ConnectionError' property
This new property will provide detailed information about the failed
connection attempt, or about the network initiated disconnection. The
property will be cleared only if a new connection attempt is
triggered, and so it can be used to investigate why a given attempt
failed without needing to be the one who triggered the attempt (e.g.
so that failures in NetworkManager-triggered connection attempts can
be investigated looking at the DBus API).

The property is built as a (ss) tuple, but the libmm-glib interface
provides methods to read this property as a GError.
2021-05-23 01:22:07 +02:00
Aleksander Morgado ff45d292ee libmm-glib: setup common helper to register DBus errors 2021-05-22 22:58:37 +00:00
Aleksander Morgado d661d822f7 libmm-glib,common-helpers: avoid signed vs unsigned comparisons
mm-common-helpers.c: In function 'mm_get_int_from_str':
  mm-common-helpers.c:1349:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (eol == num)
               ^~
  mm-common-helpers.c: In function 'mm_utils_hexstr2bin':
  mm-common-helpers.c:1718:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i = 0; i < len; i += 2) {
                     ^
2021-05-18 14:51:05 +02:00
Aleksander Morgado 21ff48ed7d libmm-glib: drop default timeout checks in Command()
The g_dbus_proxy_get_default_timeout() is by default -1 unless
explicitly updated, so the check doesn't make any sense really. We
didn't see any warning produced because mmcli provides an explicit
timeout of 30s, so it was never the default -1.
2021-05-18 14:51:05 +02:00
Aleksander Morgado a325acd6b1 libmm-glib: remove unused cmp_allow_roaming() method
mm-bearer-properties.c:725:1: warning: 'cmp_allow_roaming' defined but not used [-Wunused-function]
   cmp_allow_roaming (gboolean                   a,
   ^~~~~~~~~~~~~~~~~
2021-05-18 14:51:05 +02:00
Aleksander Morgado 0ea6e01c9b libmm-glib,location-3gpp: fix string overflow
mm-location-3gpp.c: In function ‘mm_location_3gpp_get_mobile_country_code’:
  mm-location-3gpp.c:139:12: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
    139 |     mcc[4] = '\0';
        |     ~~~~~~~^~~~~~
  mm-location-3gpp.c:132:11: note: at offset 4 to object ‘mcc’ with size 4 declared here
    132 |     gchar mcc[4];
        |           ^~~
2021-05-17 14:29:35 +02:00
Teijo Kinnunen 879ec1a5d4 libmm-glib,iface-modem-location: add MMLocation3gpp 3 digit MNC support
MMLocation3gpp provides MCC/MNC information as integers, so it can not
make distinction between operator codes such as XXX01 and XXX001.

This commit deprecates mm_location_3gpp_get_mobile_network_code() and
implements a new function mm_location_3gpp_get_operator_code() which
provides the MCC+MNC in string format.

The mm_location_3gpp_get_mobile_country_code() is still available as
returning the MCC as an integer does not have ambiguity issues.
2021-05-17 12:46:52 +03:00
Teijo Kinnunen d77d8dff42 libmm-glib,simple: fix docs: g_object_ref -> g_object_unref 2021-05-04 14:14:15 +03:00
Michal Mazur 25ffe4211a api,libmm-glib,cli: add command to disable facility lock 2021-04-30 18:40:29 +00:00
Michal Mazur b1dde0aec3 libmm-glib: add helper to get 3gpp facility from string 2021-04-30 18:40:29 +00:00
Aleksander Morgado 9fd5aced67 api,bearer: new 'ProfileId' property
To report which is the currently active profile with this bearer, if
known. If the modem doesn't support profiles, or if the bearer is
disconnected, -1 (MM_3GPP_PROFILE_ID_UNKNOWN) will be reported.

It is guaranteed that no two connected bearers will have the same
ProfileId property value.
2021-04-29 10:13:22 +00:00
Aleksander Morgado 2d43ea48e1 api,modem: new Modem3gpp.ProfileManager interface
This new interface allows modems to expose the list of available
connection profiles stored in the device and edit or delete them; as
long as the underlying device/protocol allows it.
2021-04-29 10:13:22 +00:00
Aleksander Morgado 793370f2f8 api,bearer: new 'profile-id' setting
We define a new 'profile-id' setting in the bearer properties that
users will use to specify which connection profile of the ones
available in the device should be connected.

When the 'profile-id' is given, the associated bearer object will be
bound to the 'profile-id', and the user is able to provide additional
settings to apply on top (e.g. if the profile storage doesn't allow
some of the settings we support, like 'apn-type', or if the setting is
completely unrelated to profiles, like 'multiplex').

After introducing the 'profile-id' as a valid setting in the bearer
properties, we also reimplement the properties object internals to
make use a 3GPP profile for the subset of common settings between both
objects.
2021-04-29 10:13:22 +00:00