Commit Graph
284 Commits
Author SHA1 Message Date
Dan Williams 397faef3c5 mm-common-helpers: add mm_autoptr helpers for GRegex and GMatchInfo
Alias them to g_autoptr() on glib >= 2.44, otherwise re-implement.
2018-12-04 17:39:15 +00:00
Aleksander Morgado c7af14cc80 api,manager: new 'Version' property
This string shows the runtime version of the ModemManager daemon.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/94
2018-12-04 17:26:59 +00:00
Aleksander Morgado d0bb8d1d50 libmm-glib,manager: fix manager interface proxy creation
We were re-using the GDBusObjectManagerClientFlags set in the
MMManager object as GDBusProxyFlags for the Manager1 interface proxy
object, and that was completely broken.

Instead of setting "DO_NOT_AUTO_START" in the proxy, we were actually
setting "DO_NOT_LOAD_PROPERTIES"...
2018-12-04 17:26:59 +00:00
Aleksander Morgado 8b8bc0773f libmm-glib,bearer-properties: don't document non-public API
To avoid gtk-doc complaining about that.
2018-11-12 12:22:24 +01:00
Aleksander Morgado e9fd90a70c libmm-glib,3gpp: add missing set_eps_ue_mode_operation() API docs 2018-11-12 12:22:19 +01:00
Ben Chan bf1b396596 tests: use memcmp() instead of g_assert_cmpmem() for now
g_assert_cmpmem() isn't available until glib 2.46, while the minimum
glib version required by ModemManager is 2.36. This patch replaces the
uses of g_assert_cmpmem() with memcmp() instead.
2018-11-08 17:00:59 +01:00
Aleksander Morgado 025fcb7e92 api: deprecate SubscriptionState property 2018-10-26 09:41:44 -07:00
Ben Chan 749b806c30 core: remove unnecessary NULL checks for g_free()
g_free() already check if the given pointer is NULL and does nothing on
a NULL pointer.
2018-10-18 13:17:36 +02:00
Aleksander Morgado fe05383fe5 libmm-glib,gps-raw: prefer $GNGGA over $GPGGA
The $GNGGA traces provide "combined" values when multiple satellite
constellations are used (e.g. GPS+GLONASS). Prefer these values over
the GPS-only $GPGGA traces if both are received.
2018-10-17 11:17:17 +02:00
Dan Williams 627303a748 api/libmm-glib/cli: add AudioPort and AudioFormat properties to the Call object 2018-10-16 17:09:21 +00:00
Thomas Haller 8bde29c9e2 libmm-glib: use helper function to convert enum/flags from string 2018-10-04 09:43:15 +02:00
Thomas Haller d83f50794d libmm-glib, modem-helpers: unref enum/flags GType classes in enum getters 2018-10-04 09:43:05 +02:00
Aleksander Morgado 0ca95254ae libmm-glib,location-3gpp: don't ignore location updates when MNC is 0
E.g. China Mobile (MCC 460, MNC 0).

    $ mmcli -m toby --location-get

    /org/freedesktop/ModemManager1/Modem/0
      -------------------------
      3GPP location   | Mobile country code: '460'
                      | Mobile network code: '0'
                      |  Location area code: '6188'
                      |             Cell ID: '40955'
      -------------------------
      GPS NMEA traces | Not available
      -------------------------
      Raw GPS         | Not available
      -------------------------
      CDMA BS         | Not available
2018-09-25 19:21:00 +02:00
Aleksander Morgado 8e98922880 libmm-glib,pco: add some more missing documentation for MMPco 2018-08-28 10:50:44 +02:00
Ben Chan c49f60db02 libmm-glib,pco: add missing documentation for MMPco 2018-08-28 10:50:39 +02:00
Guido Günther f24d8279bc docs: mm_modem_get_sim is async
Signed-off-by: Guido Günther <guido.gunther@puri.sm>
2018-08-27 10:55:19 -05:00
Aleksander Morgado 2e0471fe6a libmm-glib: new common helpers to check band types 2018-08-21 17:02:39 +00:00
Aleksander Morgado 091bf4dbd8 api: support location assistance data
Sometimes SUPL-server based A-GPS is not possible, e.g. if the module
doesn't have Internet connectivity. In such cases, the modem may
support injecting additional "assistance data" that may be downloaded
from the Internet using external means (e.g. WiFi), in order to keep
having a quick time to first fix.

We now support using this location assistance data, with the following
new API elements:

 * A new mask of supported assistance data types is provided in the
   SupportedAssistanceData property.

 * A new list of URLs from where the aassistance data may be
   downloaded is also provided in a new AssistanceDataServers
   property.

 * A new InjectAssistanceData() method is provided, to perform the
   data injection in the module once it's been downloaded to the host
   system.
2018-08-21 13:26:08 +00:00
Ben Chan d46aa0c36a modem-3gpp: add 'Pco' property to Modem3gpp interface
This patch adds a 'Pco' property to the Modem3gpp interface for tracking
PCOs that the modem has received from the network.
2018-08-18 13:34:06 -07:00
Ben Chan eb327b4203 libmm-glib,pco: add helpers for managing a list of MMPco 2018-08-18 13:34:06 -07:00
Ben Chan 28e64d0018 libmm-glib: add MMPco for handling raw PCO data 2018-08-18 13:29:46 -07:00
Aleksander Morgado fe66bdf65e libmm-glib,signal: fix MM_SIGNAL_UNKNOWN symbol value
Unfortunately, G_MINDOUBLE is basically 0.0, so MM_SIGNAL_UNKNOWN ends
up giving us a value that may fall in the range of expected values for
the signal component.

Update the MM_SIGNAL_UNKNOWN symbol to match a value which is
definitely out any other possible valid range, so that we can easily
detect which values are set and which aren't.

While API is maintained, this fix is introducing an ABI break. Not a
big deal anyway, as the purpose of the value is just to detect unset
fields.
2018-08-09 13:52:53 +00:00
Aleksander Morgado 7e6b4d7aa9 api,location: give Tracking Area Code field in 3GPP location info
The "location area code" field is given in GSM/UMTS networks
exclusively. LTE networks use the concept of "tracking area code"
instead.

This patch updates the Location interface to Provide separate fields
for LAC and TAC, instead of giving TAC values in the LAC field.
2018-08-08 21:46:28 +02:00
Enrico Mioso f01d88bf91 libmm-glib: reference dup_equipment_identifier instead of dup_plugin
Fix the comment.
2018-06-29 09:34:37 +02:00
Aleksander Morgado 066c9c1e40 libmm-glib,location-gps-raw: plug memleak
==8663== 1 bytes in 1 blocks are definitely lost in loss record 5 of 4,864
    ==8663==    at 0x4C2CEDF: malloc (vg_replace_malloc.c:299)
    ==8663==    by 0x669FAC9: g_malloc (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x66B9AEA: g_strndup (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x66ACE52: g_match_info_fetch (in /usr/lib/libglib-2.0.so.0.5600.1)
    ==8663==    by 0x4E96DD2: mm_location_gps_raw_add_trace (mm-location-gps-raw.c:208)
    ==8663==    by 0x18721E: mm_iface_modem_location_gps_update (mm-iface-modem-location.c:264)
    ==8663==    by 0x1B9C7F: loc_location_nmea_indication_cb (mm-shared-qmi.c:712)
    ==8663==    by 0x640C9E7: g_cclosure_marshal_VOID__BOXEDv (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x6409C95: ??? (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x64259E8: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x642612F: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.5600.1)
    ==8663==    by 0x54AAB2D: process_indication (qmi-loc.c:7454)

Reported by: Thomas Weißschuh <thomas@weissschuh.net>
2018-06-28 00:09:27 +02:00
Aleksander Morgado c147dfc267 libmm-glib: use ModemManager prefix to refer to the introspected types 2018-03-13 13:07:10 +01:00
Aleksander Morgado 5dff6ce594 libmm-glib,modem: fix introspection annotation for bearer list 2018-03-13 12:53:37 +01:00
Aleksander Morgado eb6b4cac8a libmm-glib: add several missing headers 2018-03-13 12:53:18 +01:00
Aleksander Morgado 1481dd58e2 libmm-glib,bearer-properties: minor documentation typo fix 2018-03-13 12:41:47 +01:00
Aleksander Morgado 9535f4c474 libmm-glib,bearer: cleanup stats related mutex and object 2018-03-13 12:25:43 +01:00
Ville Skyttä 90b89bb9f4 *: Spelling fixes 2018-01-25 09:52:12 +01:00
Aleksander Morgado d4aaa436d9 modem-3gpp: allow loading and changing EPS UE mode of operation
The UE modes of operation for LTE are defined in 3GPP TS 24.301 (e.g.
section 4.3 in v10.3.0):
  * PS mode 1: EPS only, 'voice centric'
  * PS mode 2: EPS only, 'data centric'
  * CS/PS mode 1: EPS and non-EPS, 'voice centric'
  * CS/PS mode 2: EPS and non-EPS, 'data centric'

The mode specifies, among other things, how the UE should behave w.r.t
CS fallback depending on the capabilities reported by the network.
2018-01-20 15:41:07 +01:00
Aleksander Morgado 3ee1dc5fa0 libmm-glib,sms: fix get|dup_data() introspection annotations
We need to specify explicitly that the return type is an array of
guint8 elements.
2017-09-27 17:33:31 +02:00
Ben Chan 9c6a1ebb1e libmm-glib: add helpers for loading hardware revision 2017-09-20 09:56:23 -07:00
Ben Chan 2b08a66645 libmm-glib,cdma: fix potential NULL dereference
This patch fixes a potential NULL referenece issue in
mm_cdma_manual_activation_properties_get_prl() where it accesses
`self->priv->prl->data' when `self->priv->prl' could be potentially
NULL.
2017-08-11 17:09:15 -05:00
Ben Chan c02dcd397a libmm-glib,sms-properties: fix potential NULL dereference
This patch fixes a potential NULL referenece issue in
mm_sms_properties_get_data() where it accesses `self->priv->data->data'
when `self->priv->data' could be potentially NULL.
2017-08-11 17:09:13 -05:00
Ben Chan e33aa01963 location-gps-nmea: fix memory leaks
There are potential memory leaks in MMLocationGpsNmea:

- When the `trace' string provided to location_gps_nmea_take_trace() isn't
  added to the hash table, its ownership is still considered transferred.
  It should thus be freed. Similarly, the `trace_type' string isn't
  added the hash table and should thus be freed.

- mm_location_gps_nmea_add_trace() duplicates a given trace string and
  then passes the trace copy to location_gps_nmea_take_trace(). When
  location_gps_nmea_take_trace() returns FALSE, the ownership of the
  copy isn't transferred. mm_location_gps_nmea_add_trace() should thus
  free the copy.

This patch fixes the above memory leaks by having
location_gps_nmea_take_trace() always take the ownership of the `trace'
string and internally free `trace' and `trace_type' when necessary.
2017-08-04 15:07:56 +02:00
Ben Chan bae4590784 libmm-glib,firmware: fix unique_id checks
The following checks in mm_modem_firmware_select() and
mm_modem_firmware_select_sync() could result in a NULL pointer
dereference if `unique_id' is NULL:

  g_return_if_fail (unique_id != NULL || unique_id[0] == '\0')
  g_return_val_if_fail (unique_id != NULL || unique_id[0] == '\0', FALSE)

This patch fixes the checks to properly verify that `unique_id' is
neither NULL nor an empty string.
2017-08-03 12:19:37 +02:00
Ben Chan 3d800c2f49 compat: add compatibility definitions for old MM_MODEM_BAND_EUTRAN_* values
Those Roman numeral suffixes in MM_MODEM_BAND_EUTRAN_* were replaced
with 1, 2, 3, ..., etc. This patch adds a compatibility header,
ModemManager-compat.h, to alias the old MM_MODEM_BAND_EUTRAN_* values to
the new values.
2017-06-28 18:21:25 +02:00
Ben Chan 292f2402d0 libmm-glib,voice: port mm_modem_voice_list_calls to use GTask 2017-06-25 09:47:58 +02:00
Ben Chan 9bf9d036ec libmm-glib,voice: port mm_modem_voice_create_call to use GTask 2017-06-25 09:47:58 +02:00
Ben Chan 135fc84cf1 libmm-glib,messaging: port mm_modem_messaging_list to use GTask 2017-06-25 09:47:58 +02:00
Ben Chan 498400d943 libmm-glib,messaging: port mm_modem_messaging_create to use GTask 2017-06-25 09:47:58 +02:00
Ben Chan aebc1f3f6c libmm-glib,modem: port mm_modem_list_bearers to use GTask 2017-06-25 09:45:18 +02:00
Ben Chan 23206d794a libmm-glib,modem: port mm_modem_create_bearer to use GTask 2017-06-23 22:32:08 +02:00
Ben Chan d84bb54e77 libmm-glib,modem: port mm_modem_get_sim to use GTask 2017-06-23 22:32:08 +02:00
Ben Chan 2327ebddf1 libmm-glib: use g_list_copy_deep for deep copying a GList 2017-06-23 22:32:07 +02:00
Ben Chan 19794d0846 libmm-glib,manager: port mm_manager_scan_devices to use GTask 2017-06-23 10:26:53 +02:00
Ben Chan 2f3d9642f6 libmm-glib,manager: port mm_manager_set_logging to use GTask 2017-06-23 10:26:52 +02:00
Ben Chan 56ec672669 libmm-glib,simple: port mm_modem_simple_connect to use GTask 2017-06-23 10:26:50 +02:00