Commit Graph

216 Commits

Author SHA1 Message Date
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
4f0a796ece cli: port mmcli_get_call to GTask 2017-11-03 11:55:04 +01:00
Aleksander Morgado
6f9e2003e0 cli: port mmcli_get_sim to GTask 2017-11-03 11:55:04 +01:00
Aleksander Morgado
050eb46f51 cli: port mmcli_get_sms to GTask 2017-11-03 11:55:03 +01:00
Aleksander Morgado
f94a93d66a cli: port mmcli_get_bearer to GTask 2017-11-03 11:55:03 +01:00
Aleksander Morgado
11e9b727b4 cli: port mmcli_get_modem to GTask 2017-11-03 11:55:03 +01:00
Aleksander Morgado
6bf046b6fc cli: port mmcli_get_manager to GTask 2017-11-03 11:55:03 +01:00
Aleksander Morgado
25007741c8 mmcli,sim: force sync operation for the info action 2017-10-18 23:05:18 +02:00
Ben Chan
4a5a73eb1e cli: show hardware revision property of Modem interface 2017-09-20 09:56:23 -07:00
Aleksander Morgado
b2a859a782 build: WITH_UDEV is only defined when enabled
Looks like the preprocessor doesn't choke when using #if WITH_UDEV and
it isn't defined to any value, but anyway, better explicitly say that
we're checking if it's defined or not.
2017-06-22 10:43:45 +02:00
Ben Chan
b225b7a267 cli: remove explicit GDestroyNotify cast on g_object_unref
g_object_unref is in form of  `void (*)(gpointer)`, which matches the
GDestroyNotify signature. An explicit GDestroyNotify cast on
g_object_unref is thus not needed.
2017-03-29 10:22:28 +02:00
Aleksander Morgado
5a8620d984 cli: minor indentation fix 2017-02-08 18:38:03 +01:00
Ben Chan
31655bb5a5 glib: remove invocations of g_type_init()
g_type_init() has been deprecated (and also marked with the attribute
'deprecated') since glib 2.36 as the type system is automatically
initialized. Since the minimum version of glib required by ModemManager
is 2.36, calling g_type_init() isn't necessarily in the ModemManager
code.
2017-02-03 10:05:14 +01:00
Aleksander Morgado
9b3549e375 api,signal: new RSCP item 2016-10-12 13:24:08 +02:00
Aleksander Morgado
fe460b2f54 3gpp: update registration state enumeration with CSFB related states
Introduce "sms only" and "CSFB not preferred" home/roaming states to be reported
for the CS context, while already registered on LTE.

Based on 3GPP TS 27.007 v13.5.0.
2016-10-12 13:24:08 +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
c4a584416a core: allow disabling auto-scan and notifying ports one by one via API
This commit enables a new core ModemManager daemon option, so that automatic
detection of available modems is totally disabled: '--no-auto-scan'. Note that
this option also replaces the previously used '--test-no-auto-scan' option,
which was only used during tests.

Along with the new ModemManager option, a new ReportKernelEvent() method in
the API is defined, which allows notifying the daemon of which interfaces it
should be accessing, as well as the main details of each interface. The only
mandatory parameters in the new method are 'action' (add/remove), 'name' (the
name of the interface) and 'subsystem' (the subsystem of the interface).

The mmcli tool has support for using the new api method via several new options:

 * The '--report-kernel-event' option allows specifying device ports one by
   one, and is a direct mapping of the ReportKernelEvent() method:
     $ sudo mmcli --report-kernel-event="action=add,name=wwan0,subsystem=net"
     $ sudo mmcli --report-kernel-event="action=add,name=cdc-wdm0,subsystem=usbmisc"

 * The '--report-kernel-event-auto-scan' option uses udev monitoring to notify
   events automatically to the daemon. This allows to operate in a way
   equivalent to the default daemon operation (with implicit auto-scan).

Worth noting that the ReportKernelEvent() method is only usable when
'--no-auto-scan' is explicitly used in the daemon. An error will be reported if
the method is tried while standard udev monitoring is enabled (implicit if
auto scan isn't explicitly disabled in the daemon).

If mmcli is going to be used only to report 'real time' events, an optional
'--initial-kernel-events=[PATH]' may be given in the ModemManager call to
automatically process a set of port kernel events one by one on boot. The file
may e.g. contain:
  action=add,name=wwan0,subsystem=net
  action=add,name=cdc-wdm0,subsystem=usbmisc
2016-09-29 15:43:05 +02:00
Aleksander Morgado
1f813c4e96 core: allow identifying devices by a user-provided 'uid'
All ports of the same modem reported by the kernel will all be associated with
a common 'uid' (unique id), which uniquely identifies the physical device. This
logic was already in place, what we do now is avoid calling it  the 'sysfs
path' of the physical device, because we may not want to use that to identify
a device.

This logic now also enables the possibility of "naming" the modems in a unique
way by setting the "ID_MM_PHYSDEV_UID" property in the "usb_device" that owns
all the ports.

E.g. a custom device has 4 modems in 4 different USB ports. The device path of
each USB device will always be the same, so the naming rules could go like this:

    $ vim /usr/lib/udev/rules.d/78-mm-naming.rules

    ACTION!="add|change|move", GOTO="mm_naming_rules_end"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.1", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-1"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.2", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-2"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.3", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-3"
    DEVPATH=="/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.5/4-1.5.4", ENV{ID_MM_PHYSDEV_UID}="USB-MODEM-4"
    LABEL="mm_naming_rules_end"

Each of the modems found will have a unique UID retrieved from the previous list
of rules. Then, "mmcli" has also been updated to allow using the UID instead of
the modem DBus path or index, e.g.:

    $ sudo mmcli -m USB-MODEM-1
    /org/freedesktop/ModemManager1/Modem/0 (device id '988d83252c0598f670c2d69d5f41e077204a92fd')
      -------------------------
      Hardware |   manufacturer: 'ZTE CORPORATION'
               |          model: 'MF637'
               |       revision: 'BD_W7P673A3F3V1.0.0B04'
               |      supported: 'gsm-umts'
               |        current: 'gsm-umts'
               |   equipment id: '356516027657837'
      -------------------------
      System   |         device: 'USB-MODEM-1'
               |        drivers: 'option'
               |         plugin: 'ZTE'
               |   primary port: 'ttyUSB5'
               |          ports: 'ttyUSB5 (at)'
    ...

    $ sudo mmcli -m USB-MODEM-1 --enable
    ...
2016-09-29 15:41:21 +02:00
Aleksander Morgado
e5fa0233bb mmcli,ussd: don't rely on lock status to allow actions
Commit 001f35234e fixed this very same thing in
all the other interface actions, but 3GPP USSD actions were not fixed.

https://bugs.freedesktop.org/show_bug.cgi?id=97954
2016-09-28 09:27:17 +02:00
Aleksander Morgado
7b4bd888f0 build: updated copyright years up to 2016 2016-07-26 13:07:49 +02:00
Aleksander Morgado
f156ec06fb context: use G_OPTION_ARG_FILENAME when a file path is expected 2016-03-27 21:39:11 +02:00
Aleksander Morgado
eeb9e2bdcc build: end all multiline list variables with $(NULL)
So that appending a new item in the list only inserts one new line (i.e. the
last $(NULL) is the last item always).
2016-03-15 19:15:25 +01:00
Aleksander Morgado
138b3dabc2 cli: validate SUPL server before showing it 2015-12-19 14:09:03 +01:00
Aleksander Morgado
9123c7bd93 cli: allow enabling/disabling location signaling via DBus
Not making them '--location-enable|disable-signal' because that's the pattern
used to enable/disable location sources. Instead, use the '--location-set-*'
pattern, as that is what we're already using for the other location setup
update.
2015-12-19 14:07:45 +01:00
Aleksander Morgado
6c35878f12 location: support updating the GPS refresh time
The default setup uses a refresh time of 30s, which means that even if the GPS
location updates are received at a higher frequency, the DBus interface will
still expose at most one update every 30s.

This patch includes a new "SetGpsRefreshTime()" method in the Location
interface, which takes a single 'u' parameter, specifying the refresh rate to
use, in seconds. This method also allows 0 being passed, which will make the
implementation to publish the GPS location updates are soon as ModemManager
detects them.

Along with the new method, a "GpsRefreshTime" read-only property is exposed
to specify the refresh time in effect.

The new method and property will only be applicable if the device has GPS
capabilities.

https://bugs.freedesktop.org/show_bug.cgi?id=89924
2015-12-19 12:22:30 +01:00
Aleksander Morgado
810e52c6db cli: print stats if bearer reports them 2015-12-07 14:20:54 +01:00
Aleksander Morgado
ee85a463cf license: mmcli is GPLv2+, not GPLv3+
mmcli is GPLv2+; that's what --version has always said and that's what the
README in ModemManager sources specifies:
  License.
  The ModemManager and mmcli binaries are both GPLv2+.
  The libmm-glib library is LGPLv2+.
2015-12-07 13:16:24 +01:00
Aleksander Morgado
c55fcab3b3 mmcli,call: minor alignment and message fixes 2015-08-02 10:45:17 +02:00
Marco Bascetta
74325b547a core,libmm-glib,cli,voice: Replaced 'SendTone' method and 'ToneReceived' signal with 'SendDtmf' and 'DtmfReceived' 2015-08-02 10:39:48 +02:00
Marco Bascetta
2ac5d620c4 libmm-glib,cli: Replaced 'list call' with 'list calls' 2015-08-02 10:39:48 +02:00
Aleksander Morgado
b600e6c9ce mmcli,voice: align values of printed Call parameters 2015-08-02 10:39:48 +02:00
Aleksander Morgado
394bf91032 mmcli,voice: fix minor typo 2015-08-02 10:39:48 +02:00
Aleksander Morgado
c0e05dbd43 cli,voice: minor coding style fixes 2015-08-02 10:39:47 +02:00
Marco Bascetta
4a13bc8fec mmcli: added --send-tone option 2015-08-02 10:39:47 +02:00
Marco Bascetta
3b5e433241 mmcli: set call-start timeout to 2 minutes 2015-08-02 10:39:47 +02:00
Riccardo Vangelisti
c3bec1537b mmcli: added Modem.Voice and Call support 2015-08-02 10:39:12 +02:00
Aleksander Morgado
f9489a06be mmcli: add command completion 2015-01-25 21:49:01 +01:00
Aleksander Morgado
72f4aa75d7 cli,location: allow enabling/disabling A-GPS 2014-09-05 11:30:24 +02:00
Aleksander Morgado
9dc5cdf78e cli,location: allow getting/setting SUPL server address 2014-09-05 11:30:24 +02:00
Aleksander Morgado
ad67d68179 location: new 'unmanaged' GPS setup
Standard GPS setup (raw/nmea) will both enable the GPS module and take full
control of the GPS port. This prevents other processes from reading the NMEA
traces from e.g. a tty. In order to handle this, a new 'unmanaged' GPS location
source is introduced, which will just enable/disable the GPS module, without
reading anything from the GPS port. Of course, both raw/nmea and unmanaged
setups cannot be enabled at the same time.
2014-07-02 12:28:56 +02:00
Dan Williams
8017628353 cli: print IP details for all valid bearer types
Even DHCP or PPP may have some IP details, like the link-local
address for IPv6 bearers.
2014-06-13 11:30:49 -05:00
Ben Chan
f0542aa809 cli: show a nicer modem description if manufacturer or model is unknown 2014-05-29 10:05:28 +02:00
Ben Chan
d4177f554b cli: consistently use spaces for indentation 2014-05-20 09:32:15 +02:00
Ben Chan
c184c2f1be cli: print MTU in bearer IP config properties 2014-03-25 17:10:17 +01:00
Aleksander Morgado
fe9f3a6553 cli: new '--set-power-state-off' command 2014-02-20 11:15:03 +01:00
Ben Chan
759f13f693 cli: align printout of bearer IPv6 configuration properties 2014-02-15 18:10:59 +01:00
Aleksander Morgado
38501a06bf mmcli: allow passing SMS index in --messaging-delete-sms 2014-01-30 13:10:54 +01:00
Aleksander Morgado
513248a2b7 mmcli: allow passing bearer index in --delete-bearer 2014-01-30 12:51:20 +01:00
Ben Chan
9a72f90cf7 cli: fix source tag of GSimpleAsyncResult objects 2013-12-05 13:03:29 -06:00
Ben Chan
6d251daf47 cli: print 'Bearers' property in Modem interface 2013-11-22 08:35:53 +01:00