Commit Graph

291 Commits

Author SHA1 Message Date
Aleksander Morgado
0cd76bf1c4 api: deprecate MM_MODEM_CAPABILITY_LTE_ADVANCED
It's not used anywhere.
2020-04-09 12:38:49 +00:00
Aleksander Morgado
1a67db047e cli: improve --help output for --modem and --sim options
Specify the full list of supported object lookup methods.
2020-04-09 05:38:07 +00:00
Aleksander Morgado
d72a9df041 cli: allow looking up for first available modem or SIM
When a system only has one single modem, it's convenient to just look
for the first available modem or SIM object, instead of needing to
provide the full path or the exact index number.

This improvement allows users to use the "any" keyword, or any of its
substrings (e.g. "an" or even "a") to match the first available object
of the requested type.

E.g.:

  $ mmcli -m a
    --------------------------------
    General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
             |            device id: 1a48f1180f1fb0166d91f7b139d027136b59ba63
    --------------------------------
    Hardware |         manufacturer: Sierra Wireless Inc.
             |                model: Sierra Wireless EM7345 4G LTE
    ...

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/196
2020-04-09 05:38:07 +00:00
Aleksander Morgado
cc99ab562b cli: consolidate logic to process user provided object lookup info
The user may specify DBus objects in several ways, e.g. with full
object paths, just with the object numeric ids, or in some other cases
with the full device UID.

Setup one single method to process this info for all object types, so
that it's also easier to add new lookup methods for all at the same
time.
2020-04-09 05:38:07 +00:00
Aleksander Morgado
3643c15133 cli: remove empty whiteline in --version
This also fixes the Copyright section in the troffit generated HTML
output.
2020-03-21 15:49:31 +01:00
Aleksander Morgado
f1e77cdbe6 cli: context: add ':' to the section titles
So that --help-all print all sections in the same way as the Help and
Application option groups.
2020-03-21 15:40:13 +01:00
Aleksander Morgado
1fa7e1260d cli: fix warnings with -Wshadow
mmcli-manager.c: In function ‘context_free’:
  mmcli-manager.c:167:24: error: declaration of ‘ctx’ shadows a global declaration [-Werror=shadow]
    167 | context_free (Context *ctx)
        |               ~~~~~~~~~^~~
  mmcli-manager.c:51:17: note: shadowed declaration is here
     51 | static Context *ctx;
        |                 ^~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
1216e88716 cli: fix warnings with -Wswitch-default
mmcli-output.c: In function ‘output_item_free’:
  mmcli-output.c:321:5: error: switch missing default case [-Werror=switch-default]
    321 |     switch (item->type) {
        |     ^~~~~~
  mmcli-output.c: In function ‘mmcli_output_dump’:
  mmcli-output.c:1208:5: error: switch missing default case [-Werror=switch-default]
   1208 |     switch (selected_type) {
        |     ^~~~~~
  mmcli-output.c: In function ‘mmcli_output_list_dump’:
  mmcli-output.c:1231:5: error: switch missing default case [-Werror=switch-default]
   1231 |     switch (selected_type) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
c32fdcefef cli: fix warnings with -Wswitch-enum
mmcli.c: In function ‘log_handler’:
  mmcli.c:118:5: error: enumeration value ‘G_LOG_FLAG_RECURSION’ not handled in switch [-Werror=switch-enum]
    118 |     switch (log_level) {
        |     ^~~~~~
  mmcli.c:118:5: error: enumeration value ‘G_LOG_LEVEL_MESSAGE’ not handled in switch [-Werror=switch-enum]
  mmcli.c:118:5: error: enumeration value ‘G_LOG_LEVEL_INFO’ not handled in switch [-Werror=switch-enum]
  mmcli.c:118:5: error: enumeration value ‘G_LOG_LEVEL_MASK’ not handled in switch [-Werror=switch-enum]
2020-01-31 15:18:35 +01:00
Aleksander Morgado
1c078531a0 build: use AX_IS_RELEASE() and AX_COMPILER_FLAGS()
The autoconf macros AX_COMPILER_FLAGS_{CFLAGS|GIR|LDFLAGS} test
for compiler and linker support of various flags, and add the flags to
the generated output.

If the command-line option '--enable-compile-warnings' is specified to
'configure', a number of additional warning options is also added to the
output. This is the default.

This update requires the presence of the GNU autoconf-archive in the
system.
2020-01-30 11:59:14 +01:00
Aleksander Morgado
b774cbe658 build: bump copyright years to 2020 2020-01-03 20:43:45 +01:00
Aleksander Morgado
6c1991e930 cli,location: use new mm_location_gps_nmea_get_traces() 2020-01-01 09:13:45 +01:00
Aleksander Morgado
9e785e145f mmcli,output: skip printing empty value lists
E.g. we shouldn't print emergency numbers field if there is none available:

  $ mmcli -i 0
    -------------------------------
    General    |         dbus path: /org/freedesktop/ModemManager1/SIM/0
    -------------------------------
    Properties |              imsi: 901700000026890
               |             iccid: 8988211000000268907
               |       operator id: 90170
               |     operator name: 901 70
               | emergency numbers:
2019-12-02 11:29:26 +00:00
Aleksander Morgado
16f4039159 cli,modem: avoid using deprecated mm_pco_list_free() 2019-11-15 08:55:28 +00:00
Aleksander Morgado
f9ea0c1d9c cli,output: fix truncated array output when == 10 elements
The extra character size was only being applied when > 10 elements,
leaving the == 10 case out of it, so the output was being truncated.
Fix it, by using a more generic way to computing how many extra
characters we need in the size.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/151
2019-10-27 15:57:30 +01:00
Aleksander Morgado
1f6c006976 api,sim: new 'Emergency Numbers' property 2019-10-17 08:31:46 +00:00
Aleksander Morgado
657833a400 voice,api: new 'EmergencyOnly' boolean flag
This new flag allows users of the API to know whether general purpose
voice calls are allowed or otherwise only voice calls to the
registered emergency numbers should be performed.

ModemManager won't really do any distinction between emergency and
non-emergency calls at this point, this flag is just an early
indication for the user of the API that no normal voice call should be
attempted.
2019-10-17 08:31:46 +00:00
Aleksander Morgado
7971844318 iface-modem-voice: all methods available even if not enabled 2019-10-17 08:31:46 +00:00
Aleksander Morgado
227c290778 mmcli,firmware: don't use tabs when printing human-friendly list 2019-10-11 08:16:04 +00:00
Aleksander Morgado
0a85254d17 cli: fix typo when looking for a specific call fails
$ sudo mmcli --call 1 --hangup
error: couldn't find sms at '/org/freedesktop/ModemManager1/Call/1': 'no modems found'

(cherry picked from commit e71a4282db94f8f18b5884fe7966b95febc18a6d)
2019-09-25 14:42:31 +02:00
Aleksander Morgado
c8af22ab7a cli,messaging: trivial fix in comment 2019-09-23 10:41:36 +02:00
Maxim Anisimov
40521e315f mmcli: fix value escaping in new JSON output support
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2019-09-17 11:31:42 +03:00
Aleksander Morgado
ae55fbf964 mmcli: coding style fixes in the new JSON output support 2019-08-28 18:17:55 +02:00
Maxim Anisimov
d1ac5ca16b mmcli: add json output support
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
2019-08-28 18:17:55 +02:00
Aleksander Morgado
9263e79dc3 api,voice: new CallWaitingSetup() and CallWaitingQuery() methods
These new methods allow querying and updating the status of the call
waiting network service, as per 3GPP TS 22.083.

The status of the service is not a property because we don't want to
unconditionally load it on every boot, given that the process involves
talking to the network (i.e. it is not a device setting).
2019-07-19 17:47:51 +02:00
Aleksander Morgado
511b0ff244 api,call: new JoinMultiparty() and LeaveMultiparty() methods 2019-07-11 23:21:00 +02:00
Aleksander Morgado
213c60b76d api,call: new Multiparty boolean property
It will be set to TRUE if this call is part of a multiparty call.
2019-07-11 23:21:00 +02:00
Aleksander Morgado
222874299e api,call: new Deflect() method
This method allows deflecting an incoming or waiting call to a
different number.
2019-07-11 23:20:59 +02:00
Aleksander Morgado
8b01958cb4 api,voice: new Transfer() method
This method will join all active and held calls into a single
multiparty call, and then request the network to terminate the call on
the subscriber's end and transfer the control of the call to the
parties that are still in the call.
2019-07-11 23:20:59 +02:00
Aleksander Morgado
efcc4c60fe api,voice: new HangupAll() method
This method will terminate all ongoing calls.
2019-07-11 23:20:59 +02:00
Aleksander Morgado
c713c2c5f9 api,voice: new HoldAndAccept() method
This method will put the currently active call on hold, and right away
accept the next available call.

The user of the API does not need to specify explicitly which is the
next call to accept, because that is decided automatically:
  * If there is any waiting call, it will accept it right away.
  * If there is no waiting call but there is a held call, it will make
  the held call active again.
2019-07-11 23:20:59 +02:00
Aleksander Morgado
d56d1b2656 api,voice: new HangupAndAccept() method
This method will hangup the currently active call and right away
accept the next available call.

The user of the API does not need to specify explicitly which is the
next call to accept, because that is decided automatically:
  * If there is any waiting call, it will accept it right away.
  * If there is no waiting call but there is a held call, it will make
    the held call active again.
2019-07-11 23:20:59 +02:00
Johny Mattsson
8e364b72b9 mmcli: allow use of modem UID to specify SIM operation
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/107
2019-05-06 13:31:21 +02:00
Aleksander Morgado
d5dc9751b6 location,agps: include support for MSB A-GPS 2019-04-09 12:24:39 +00:00
Aleksander Morgado
b77aa7ab0e location,agps: explicitly specify that MSA A-GPS is implemented
The A-GPS based implementations we currently have assume MSA A-GPS, so
rename the MMModemLocationSource enum value to reflect that.
2019-04-09 12:24:39 +00:00
Aleksander Morgado
619d2ce5ac cli,location: minor refactor to handle the location setup flags 2019-04-09 12:24:39 +00:00
Aleksander Morgado
52b67dc7c3 api,modem: new 'CarrierConfigurationRevision' property
Which reports the version of the currently active carrier
configuration.

We also update the firmware 'version' reported in the firmware
settings so that carrier-specific upgrades can be performed (e.g. when
the firmware stays the same but the MCFG is updated).
2019-04-02 12:14:03 +02:00
Aleksander Morgado
94cf7f0ceb iface-modem: new carrier config support
During initialization phase we will allow querying the modem for the
details of which carrier-specific configuration is being used, and
will expose a description string in the API.

In addition to showing the current configuration, we will also allow
automatically switching the configuration based on the SIM card
detected in the device. In order to allow this, plugins/modems will
need to provide the expected mapping between carrier config
description and MCCMNC. This mapping cannot be generic, because
different manufacturers may use different description strings.
2019-04-02 12:11:25 +02:00
Aleksander Morgado
de81520c43 cli: report modem removal in --monitor-state
If the modem ends up not being managed by ModemManager, detect it
during the '--monitor-state' mmcli operation and report it.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/106
2019-02-11 15:08:09 +01:00
Aleksander Morgado
0f58888808 cli,firmware: fix reporting fastboot AT command
The update method is a bitmask, so check for the flag.
2019-01-12 16:09:24 +01:00
Aleksander Morgado
3ba89881cc cli,firmware: fix reporting firmware update methods in key-value output
It's a bitmask, so we report a list of strings.
2019-01-12 16:09:24 +01:00
Aleksander Morgado
251ca4a847 build: update copyright years to 2019 2019-01-11 15:57:36 +01:00
Aleksander Morgado
09c5ac061b mmcli,modem: new --inhibit action on the modem object
Modem device inhibition is really a manager action for which we
provide the full modem device 'uid'.

This new operation allows to perform device inhibition using the modem
object as reference, which is more handy than first looking at the
device 'uid' and then running the manager action.

    $ sudo mmcli -m 0 --inhibit
    successfully inhibited device with uid '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12.2'
    type Ctrl+C to abort this program and remove the inhibition
    ^C cancelling the operation...
    successfully uninhibited device with uid '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12.2'
2019-01-03 21:05:58 +01:00
Aleksander Morgado
2212d3e054 api,manager: new InhibitDevice() method
This new method allows users of the ModemManager API to take full
control of a given device.

Unlike other operations in the API, the inhibition is maintained as
long as the caller exists in the bus, or until the same caller
uninhibits the device.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/98
2019-01-03 21:05:58 +01:00
Aleksander Morgado
87712c27f5 api,firmware: MMModemFirmwareUpdateMethod as flags, not enum
Devices may require/support more than one update method, so instead of
reporting the method as a single enum value, use a set of flags
instead.
2019-01-03 18:53:52 +00:00
Aleksander Morgado
f35d64a899 api,firmware: expose firmware version 2019-01-03 18:53:52 +00:00
Aleksander Morgado
67b3b830c8 api,firmware: expose device ids 2019-01-03 18:53:52 +00:00
Aleksander Morgado
dcd49dee88 mmcli,firmware: avoid empty output if firmware status unsupported 2019-01-03 18:53:52 +00:00
Aleksander Morgado
8e342cf120 api,firmware: new UpdateSettings property 2019-01-03 18:53:52 +00:00
Aleksander Morgado
55c3026643 api: deprecate 'number' in bearer properties
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/99
2019-01-03 16:42:18 +00:00