Commit Graph

53 Commits

Author SHA1 Message Date
Ben Chan
830ef27bac libmm-glib: fix a memory leak of GMutex 2014-06-03 10:51:31 +02:00
Dan Williams
e3bebc85c4 libmm-glib: deep-copy ports array in ensure_internal_ports() (bgo #724900)
ensure_internal_ports() didn't deep-copy the ports array, which
meant that anything calling mm_modem_port_info_array_free() was
freeing the internal memory owned by MMModem if it retrieved
the array with mm_modem_get_ports().

https://bugzilla.gnome.org/show_bug.cgi?id=724900
2014-02-27 13:06:04 -06:00
Ben Chan
e438221258 libmm-glib: add methods to retrieve 'Bearers' property in Modem interface 2013-11-22 08:35:41 +01:00
Aleksander Morgado
7f442b777c introspection,api: new 'Bearers' property in the Modem interface
https://bugzilla.gnome.org/show_bug.cgi?id=712276
2013-11-21 10:50:49 +01:00
Aleksander Morgado
5dc6db1962 libmm-glib: fix some more introspection annotations 2013-10-24 17:38:36 +02:00
Aleksander Morgado
e1c0621b09 libmm-glib: fix several introspection annotations 2013-10-24 17:16:33 +02:00
Christian Persch
0abba497ab libmm-glib: Fix and add introspection annotations
Bug #705641.
2013-08-14 13:30:35 +02:00
Aleksander Morgado
3206e95663 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
2013-06-24 19:44:57 +02:00
Aleksander Morgado
a902e6859e api,introspection: new 'SetCurrentCapabilities' method
For those modems which expose a valid 'SupportedCapabilities' property with more
than one item in the list, we'll allow switching between them.
2013-06-05 19:15:15 +02:00
Aleksander Morgado
700ebc5c07 api,introspection: rename 'ModemCapabilities' to 'SupportedCapabilities'
And also make it a list of masks, specifying which are the specific combinations
supported, not just one mask with all.

E.g.:
  -------------------------
  Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
           |          model: 'MC7710'
           |       revision: 'SWI9200X_03.05.19.04ap r5475 carmd-en-10527 2012/09/17 17:57:14'
           |      supported: 'gsm-umts
           |                  gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '358178040668164'
2013-06-05 19:15:15 +02:00
Aleksander Morgado
1c67d050cb api,introspection: merge 'AllowedModes' and 'SupportedMode' into 'CurrentModes'
We now have a single 'CurrentModes' property which contains both values in a
tuple with signature "(uu)".

Also, rename 'SetAllowedModes()' to 'SetCurrentModes()', and update the list of
arguments expected to have a single "(uu)" tuple.
2013-06-05 19:15:14 +02:00
Aleksander Morgado
45ceba7692 api,introspection: 'SupportedModes' is now a list of possible combinations
Instead of just a mask of MMModemMode values, we now provide a list of the
allowed and preferred mode combinations supported by the modem. E.g.:

$> sudo mmcli -m 0
  -------------------------
  Modes    |      supported: 'allowed: 2g; preferred: none
           |                  allowed: 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: 2g
           |                  allowed: 2g, 3g; preferred: 3g
           |                  allowed: 4g; preferred: none
           |                  allowed: 2g, 3g, 4g; preferred: none'
2013-06-05 19:15:14 +02:00
Aleksander Morgado
212d00c529 api,instrospection: rename 'Bands' to 'CurrentBands'
... and 'SetBands()' to 'SetCurrentBands()'.

We'll keep the 'Current' keyword in those properties which also have
'Supported' values.
2013-06-05 19:15:14 +02:00
Aleksander Morgado
bd360aa029 libmm-glib,modem: handle the new 'SupportedIpFamilies' property 2013-06-05 19:15:13 +02:00
Aleksander Morgado
a12be165d1 libmm-glib,modem: avoid accessing an already freed GArray
We cannot g_array_unref() the GArray when get()-ing bands as that will clear
the contents of the GArray, even if there are references around. Instead, just
dup the array contents when returning.
2013-05-23 18:00:03 +02:00
Aleksander Morgado
75d20c15d4 api: notify in the interface about the reason why the modem is FAILED
We currently implement 'SIM missing' and 'SIM error', which are probably the
most common ones.
2013-02-22 16:35:56 +01:00
Aleksander Morgado
091c47d695 libmm-glib,modem: new methods to handle the power state 2013-01-11 10:05:46 +01:00
Aleksander Morgado
79fdddccbf api,modem: new 'PrimaryPort' property
We do need to specify which is the primary port being used for controlling the
modem. This allows us to match the device with an already existing bluetooth
device in NetworkManager.
2012-10-19 00:58:36 +02:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only.

We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI'
symbols, which if included before the `libmm-glib.h' library allow us to:

 * Don't include the libmm-glib high level API in the ModemManager daemon, as
   the object names would clash with those in the core.

 * Define some of the methods of helper objects to be included only if compiling
   ModemManager daemon or the mmcli.
2012-10-04 10:17:12 +02:00
Aleksander Morgado
ba075e48f4 libmm-glib,sim: `MMSim' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusSim'.
2012-10-03 20:45:20 +02:00
Aleksander Morgado
41ece5a021 libmm-glib,bearer: `MMBearer' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusBearer'.
2012-10-03 20:45:20 +02:00
Aleksander Morgado
8ae0c36ab9 libmm-glib,modem: `MMModem' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModem'.
2012-10-01 23:44:48 +02:00
Aleksander Morgado
0436b3e457 api,introspection: report list of drivers, not just one
Different ports of the same modem may get handled by different drivers. We
therefore need to provide a list of drivers (new `Modem.Drivers' property with
signature 'as') instead of just one (removed `Modem.Driver' property with
signature 's').

$ sudo mmcli -m 0 | grep drivers
           |        drivers: 'qcserial, qmi_wwan'
2012-08-24 13:34:51 +02:00
Aleksander Morgado
8b863c5a4b libmm-glib: don't change default DBus timeout when running Modem.Command()
Just warn if the default DBus timeout is shorter than the one being requested.
2012-07-25 11:44:09 +02:00
Nathan Williams
a07220650b libmm-glib,modem: mm_modem_{get,dup}_own_numbers(): fix inverted logic.
The string vector test was reversed, causing valid vectors not to be
returned, and commands like mmcli to not display own numbers from a
modem.

Change-Id: Ia889f49f18511a2dfcdbc71a80ee0239a6c912e0
2012-04-13 23:33:25 +02:00
Aleksander Morgado
59d8110767 libmm-glib: add support to retrieve own numbers 2012-03-16 14:53:21 +01:00
Aleksander Morgado
d306bb082f libmm-common: `MMBearerProperties' won't be considered internal any more
Renamed `MMCommonBearerProperties' to `MMBearerProperties', and removed the
`MMBearerProperties' provided in libmm-glib. We'll just use the original one
from libmm-common always.
2012-03-16 14:53:19 +01:00
Aleksander Morgado
3ccc78e858 api: `UnlockRetries' will reply a list of per-lock retry counts
Equivalent to `PinRetryCount' in the previous API. We don't have an additional
property for the retry count of the current lock, as it really is duplicating
information.
2012-03-16 14:53:19 +01:00
Nathan Williams
b6203ab425 libmm-glib: set the gdbus timeout to a value longer than that remote operation timeout
Lets commands like "mmcli -m 0 --command-timeout=60 --command='+COPS=?'" work,
instead of tripping over the 25-second gdbus default timeout first.

Change-Id: I67034423ca5ab08a07ecf3c9e313082d4860ffb3
2012-03-16 14:53:18 +01:00
Aleksander Morgado
09d2f062c7 api,dbus: rename AllowedBands' to just Bands'
ModemManager will load:
  1) The list of supported bands. Note that this doesn't mean that any possible
     combination of bands is supported, as modems may support only specific
     combinations, but at least gives a rough idea of what the modem is capable
     of handling.

  2) The list of CURRENT bands. There is no such "Allowed" bands, as we do with
     modes, modems will have a specific set of bands being currently used, which
     will be reported in the `Bands' property.

If the modem allows modifying the list of bands to use, this can be done with
the `SetBands()' method. If the modem doesn't support using a specific
combination of bands, this method will report an error.
2012-03-16 14:28:13 +01:00
Nathan Williams
3c41ce5d8b api,dbus: new `Command' method in the API to send arbitrary AT commands
BUG=chromium-os:25348
TEST="mmcli -m 0 --command='E0'"
Change-Id: I320587560fde5780f9d5a4998e32364d36a71ed7
2012-03-15 14:15:06 +01:00
Aleksander Morgado
26075236f6 libmm-glib: (trivial) fix some return types 2012-03-15 14:15:01 +01:00
Aleksander Morgado
69e860329b libmm-glib: no need to expose custom flags string builders 2012-03-15 14:14:52 +01:00
Aleksander Morgado
20acb274dc libmm-glib: use g_list_free_full() when possible 2012-03-15 14:14:46 +01:00
Aleksander Morgado
fe7f71b677 libmm-common,libmm-glib: new object to handle bearer creation properties 2012-03-15 14:14:38 +01:00
Aleksander Morgado
6cfccb1452 libmm-common,libmm-glib: new modes string builder 2012-03-15 14:14:37 +01:00
Aleksander Morgado
5e0df90272 libmm-common, libmm-glib: new bands string builder 2012-03-15 14:14:37 +01:00
Aleksander Morgado
9d7e3de4cd api: MMModemBand is now an enum, not flags
We don't want to handle bands as flags, in order to avoid the need of 64-bits
for the enum. This change implies that setting allowed bands will be done by
giving an array of uint32 values, signature "au".
2012-03-15 14:14:37 +01:00
Aleksander Morgado
6f98da9310 libmm-glib: handle new 'allow-roaming' property when creating bearers 2012-03-15 14:14:36 +01:00
Aleksander Morgado
52c5f6051b libmm-glib: new helper method to build a string with access technologies 2012-03-15 14:14:35 +01:00
Aleksander Morgado
516b097331 api,enums: renamed MMModemAccessTech' to MMModemAccessTechnology'
This one was the last enum without full name.
2012-03-15 14:14:35 +01:00
Aleksander Morgado
e2e0812272 api,dbus: renamed AccessTechnology' to AccessTechnologies'
We are reporting a bitmask of flags, not just one value.
2012-03-15 14:14:35 +01:00
Aleksander Morgado
dae3f95704 libmm-glib: get a list of MMBearer objects when listing bearers in the MMModem 2012-03-15 14:14:34 +01:00
Aleksander Morgado
c6d7fb893a libmm-glib: get the MMBearer object when creating it in the MMModem 2012-03-15 14:14:34 +01:00
Aleksander Morgado
6a07753ba0 libmm-glib: handle bearer creation, deletion and listing 2012-03-15 14:14:33 +01:00
Aleksander Morgado
4624846015 libmm-glib: return NULL instead of empty strings 2012-03-15 14:14:33 +01:00
Aleksander Morgado
ec8da67921 libmm-glib: new API method to build a string of capabilities from a bitmask 2012-03-15 14:14:33 +01:00
Aleksander Morgado
7acacbbfd7 libmm-glib: simplify handling of interfaces
Avoid trying to merge all interfaces into the same set of APIs, and keep having
a specific object (proxy) for each interface handled by the GDBusObjects
reported listed by the GDBusObjectManager.
2012-03-15 14:14:33 +01:00
Aleksander Morgado
95675e3e54 libmm-glib: fix macro implementing async ready callbacks 2012-03-15 14:14:32 +01:00
Aleksander Morgado
1257ecd136 cli: start to port Modem actions to use the new libmm-glib 2012-03-15 14:14:26 +01:00