Commit Graph

25 Commits

Author SHA1 Message Date
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
2e0471fe6a libmm-glib: new common helpers to check band types 2018-08-21 17:02:39 +00: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
91613543d5 libmm-glib: set clear func by default in the MMModemPortInfo array
So that we don't leak the port names allocated within each
MMModemPortInfo.

    ==261== 672 bytes in 84 blocks are definitely lost in loss record 7,314 of 7,383
    ==261== at 0x402C51E: malloc (vg_replace_malloc.c:299)
    ==261== by 0x4484878: g_malloc (gmem.c:94)
    ==261== by 0x449D51D: g_strdup (gstrfuncs.c:363)
    ==261== by 0x44B5B73: g_variant_dup_string (gvariant.c:1529)
    ==261== by 0x44B945E: g_variant_valist_get_nnp (gvariant.c:4775)
    ==261== by 0x44B945E: g_variant_valist_get_leaf (gvariant.c:4945)
    ==261== by 0x44B945E: g_variant_valist_get (gvariant.c:5126)
    ==261== by 0x44B922C: g_variant_valist_get (gvariant.c:5161)
    ==261== by 0x44B9FC9: g_variant_get_va (gvariant.c:5388)
    ==261== by 0x44BA3C5: g_variant_get_child (gvariant.c:5486)
    ==261== by 0x6613FA8: mm_common_ports_variant_to_garray (mm-common-helpers.c:238)
    ==261== by 0x6601AB9: ensure_internal_ports (mm-modem.c:766)
    ==261== by 0x6603E42: mm_modem_peek_ports (mm-modem.c:825)
    ==261== by 0x65CD94D: owns_port (nm-modem-broadband.c:196)

Reported-by: Piotr Figiel <p.figiel@camlintechnologies.com>
2017-02-10 10:29:52 +01:00
Aleksander Morgado
292914cf65 iface-modem: always sort supported and current bands before exposing them 2016-10-12 13:24:09 +02:00
Aleksander Morgado
58c955f5f2 core: allow building and running without udev
Instead of relying on the udev daemon and GUDev to manage the devices reported
by the kernel, we can now run ModemManager relying solely on the kernel events
reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan'
option is implicit for the ModemManager daemon when udev is disabled in the
build.

Additionally, a new custom implementation of the kernel device object is
provided, which uses sysfs to load the properties and attributes required in
each kernel device, instead of using a GUdevDevice.

The udev rule files are kept in place, and a simple custom parser is provided
which preloads all rules in memory once and then applies them to the different
kernel objects reported via ReportKernelEvent(), e.g. to set port type hints.
A simple unit test setup is prepared to validate the udev rules during the
`check' Makefile target.
2016-09-29 15:43:05 +02:00
Aleksander Morgado
7460793caa libmm-glib,helpers: don't warn when trying to read invalid match info index
We may want to use the mm_get_()_from_match_info() calls to read optional items,
so that the method returns FALSE if the item index doesn't apply. So, avoid the
implicit warning issued by g_return_val_if_fail().
2016-08-10 09:04:54 +02:00
Aleksander Morgado
ccc148fe9b libmm-glib,common-helpers: fix reading boolean from string
The "0" case wasn't being handled properly:
  $ sudo mmcli -m 0 --create-bearer="apn=,allow-roaming=0"
  Error parsing properties string: 'Cannot get boolean from string '0''
2016-04-19 14:02:13 +02:00
Riccardo Vangelisti
0bf4ad6b66 libmm-glib: added support for Modem.Voice and Call interfaces 2015-08-02 10:39:12 +02:00
David McCullough
b8138d93f5 libmbim-glib: handle explicit '+' on positive numbers 2014-07-29 14:16:31 -05:00
Ben Chan
5d47478d06 libmbim-glib: consistently use spaces for indentation 2014-05-20 09:32:02 +02:00
Aleksander Morgado
86795b928e libmm-glib: allow new 'teleservice-id' and 'service-category' keywords in MMSmsProperties 2013-10-25 19:49:54 +02:00
Aleksander Morgado
7751f2d6ed mmcli,oma: support for the new OMA interface 2013-09-09 10:20:40 +02:00
Aleksander Morgado
8ab38ae968 libmm-glib: support for the 'OMA' interface 2013-09-09 10:15:18 +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
0db920b762 mmcli: new '--set-current-capabilities' command
New command to allow changing modem capabilities, if supported. The modem will
power cycle automatically after having changed 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
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
804642adc2 api: let MMBearerIpFamily be flags instead of a enumeration
We want to expose in the Modem interface the list of supported IP families, and
the easiest way to do so is to have the IP family as flags, and provide in the
interface a single enum.

Also, a value of 0 for a MMBearerIpFamily specifies that no flags are set, so
just rename it to 'NONE'.

And add a new 'ANY' value which sets all flags to 1.
2013-06-05 19:15:13 +02:00
Aleksander Morgado
b1bb8e30b4 broadband-modem: don't assume the returned string is always hex-encoded 2013-02-22 19:43:49 +01:00
Dan Williams
dd51f7a6ae libmm-glib: document mm_get_uint_from_str()
Unlike strtol/stroul, this function doesn't ignore leading or
trailing non-digit characters, so document that restriction.
2012-12-05 11:43:58 -06:00
Aleksander Morgado
e2a36bd6be libmm-glib: allow 'none' authentication with more values
Specifying 'none' is really not exclusive. We may want to say that the modem can
either authenticate with a given protocol, or otherwise just try without
authentication.

The reality is that 'none' itself is usually always given in the connection
settings.
2012-10-10 16:55:24 +02:00
Aleksander Morgado
ebd792d2aa api,libmm-glib: new `allowed-auth' configuration for bearers
For bearers using STATIC or DHCP IP method, the modem itself is the one
negotiating authentication with the network. The new `allowed-auth' property
allows users to specify which authentication method(s) are allowed to be used.

See the following NetworkManager commit for more reference:
    commit 34aef8aaaa09b7473b9496aa49e550bd2def03f8
    Author: Andrew Bird <ajb@spheresystems.co.uk>
    Date:   Thu Mar 15 16:19:43 2012 -0500
2012-10-07 21:12:00 +02:00
Aleksander Morgado
b6d628b3a1 build: merge libmm-common into libmm-glib
It's pointless to have libmm-common around, just merge it into libmm-glib and
make ModemManager depend on libmm-glib directly. At the end, the non-common
stuff in libmm-glib is really minimal.
2012-10-04 10:17:05 +02:00