From 3206e9566392e8a9678bbd49e0de9bb21ed75291 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 20 Jun 2013 23:45:12 +0200 Subject: api,introspection: new 'Ports' property in the Modem interface We will expose a new 'Ports' property listing all ports currently known by a given modem. Ports which are not used but are detected as being part of the modem will be listed with an 'unknown' port type. This change uses the new 'MMModemPortType' enum and the new 'MMModemPortInfo' helper struct to handle these values in libmm-glib. The already available 'MMPortType' enum hasn't been re-used for the interface because it contains values that we don't need (e.g. IGNORED). The port list is now also included in the modem information command of mmcli: $ sudo mmcli -m 0 /org/freedesktop/ModemManager1/Modem/0 (device id '97b7b99e3e2bea103880545b619fb05a3cc81b26') ------------------------- System | device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4' | drivers: 'qcserial, qmi_wwan' | plugin: 'Gobi' | primary port: 'cdc-wdm0' | ports: 'ttyUSB0 (qcdm), ttyUSB1 (at), cdc-wdm0 (qmi), wwp0s29u1u4 (net)' https://bugzilla.gnome.org/show_bug.cgi?id=702678 --- libmm-glib/mm-common-helpers.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libmm-glib/mm-common-helpers.h') diff --git a/libmm-glib/mm-common-helpers.h b/libmm-glib/mm-common-helpers.h index 161d9030..c9e7c2ce 100644 --- a/libmm-glib/mm-common-helpers.h +++ b/libmm-glib/mm-common-helpers.h @@ -32,6 +32,9 @@ gchar *mm_common_build_capabilities_string (const MMModemCapability *capabilitie gchar *mm_common_build_bands_string (const MMModemBand *bands, guint n_bands); +gchar *mm_common_build_ports_string (const MMModemPortInfo *ports, + guint n_ports); + gchar *mm_common_build_sms_storages_string (const MMSmsStorage *storages, guint n_storages); @@ -57,6 +60,13 @@ MMBearerAllowedAuth mm_common_get_allowed_auth_from_string (const gchar *str, MMSmsStorage mm_common_get_sms_storage_from_string (const gchar *str, GError **error); +GArray *mm_common_ports_variant_to_garray (GVariant *variant); +MMModemPortInfo *mm_common_ports_variant_to_array (GVariant *variant, + guint *n_ports); +GVariant *mm_common_ports_array_to_variant (const MMModemPortInfo *ports, + guint n_ports); +GVariant *mm_common_ports_garray_to_variant (GArray *array); + GArray *mm_common_sms_storages_variant_to_garray (GVariant *variant); MMSmsStorage *mm_common_sms_storages_variant_to_array (GVariant *variant, guint *n_storages); -- cgit v1.2.3-70-g09d2