aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-common.c
AgeCommit message (Collapse)Author
2023-09-18api,modem: new 'Physdev' propertyLukas Voegl
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2020-12-21mmcli: don't assume that mm_object_peek_modem or mm_object_get_modem return ↵Frederic Martinsons
non null This very peculiar case can happen when an intermediate initiliazition step of a modem fails. The ModemManager daemon should always expose the modem interface but let not assume that in mmcli and protect these calls. Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-08-28mmcli: also lookup SIM objects in the 'SimSlots' propertyAleksander Morgado
If the device supports multiple SIM slots, when the user provides a PATH or INDEX of a SIM card to use, don't look for the SIM object only in the 'Sim' property, also look for it in the 'SimSlots' property.
2020-04-09cli: improve --help output for --modem and --sim optionsAleksander Morgado
Specify the full list of supported object lookup methods.
2020-04-09cli: allow looking up for first available modem or SIMAleksander Morgado
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-09cli: consolidate logic to process user provided object lookup infoAleksander Morgado
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-01-31cli: fix warnings with -Wswitch-defaultAleksander Morgado
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) { | ^~~~~~
2019-09-25cli: fix typo when looking for a specific call failsAleksander Morgado
$ 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-05-06mmcli: allow use of modem UID to specify SIM operationJohny Mattsson
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/107
2018-12-07api,modem-3gpp: new 'InitialEpsBearer' propertyAleksander Morgado
This property contains the DBus path of a Bearer object of type MM_BEARER_TYPE_DEFAULT_ATTACH, which is automatically exposed by the modem when registered in the LTE network. Unlike standard bearer objects created by the user, this bearer won't allow any connection/disconnection request, as its status is bound to the LTE registration exclusively. The bearer settings exposed by the object include the APN details that have been used during the initial packet network attach, which may be defined by modem settings (e.g. if previously configured in the firmware which APN to use for the given SIM card operator) or by the network itself (e.g. if none configured, or if a network override is required as when roaming). The bearer object will be created as soon as the LTE attach status details are known, and only while the modem is enabled. The implementation allows modems to update the LTE attach status details during runtime, so the bearer object with the settings may be recreated during runtime as well.
2017-11-03cli: port mmcli_get_call to GTaskAleksander Morgado
2017-11-03cli: port mmcli_get_sim to GTaskAleksander Morgado
2017-11-03cli: port mmcli_get_sms to GTaskAleksander Morgado
2017-11-03cli: port mmcli_get_bearer to GTaskAleksander Morgado
2017-11-03cli: port mmcli_get_modem to GTaskAleksander Morgado
2017-11-03cli: port mmcli_get_manager to GTaskAleksander Morgado
2017-03-29cli: remove explicit GDestroyNotify cast on g_object_unrefBen Chan
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.
2016-09-29core: allow identifying devices by a user-provided 'uid'Aleksander Morgado
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 ...
2015-12-07license: mmcli is GPLv2+, not GPLv3+Aleksander Morgado
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-08-02libmm-glib,cli: Replaced 'list call' with 'list calls'Marco Bascetta
2015-08-02cli,voice: minor coding style fixesAleksander Morgado
2015-08-02mmcli: added Modem.Voice and Call supportRiccardo Vangelisti
2014-05-20cli: consistently use spaces for indentationBen Chan
2013-12-05cli: fix source tag of GSimpleAsyncResult objectsBen Chan
2013-05-23mmcli: fix newline prefixingAleksander Morgado
The last line in a multi-line string was getting lost if it wasn't '\n' terminated.
2013-02-22api: notify in the interface about the reason why the modem is FAILEDAleksander Morgado
We currently implement 'SIM missing' and 'SIM error', which are probably the most common ones.
2013-02-06cli: don't autostart the ModemManager serviceAleksander Morgado
2012-10-22cli: don't abort when looking for bearers in failed modemsAleksander Morgado
2012-10-04libmm-glib: remove the `libmm-common.h' headerAleksander Morgado
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-06-29cli: fix showing revision when not multilineAleksander Morgado
2012-03-29mmcli: prefix all NMEA traces in order to get a pretty printAleksander Morgado
2012-03-16mmcli: fix looking for unexisting SMSAleksander Morgado
We need to ensure we iterate over all modems available.
2012-03-16mmcli: fix looking for unexisting bearersAleksander Morgado
We need to ensure we iterate over all modems available.
2012-03-16cli: don't assume every modem exposes the Messaging interfaceAleksander Morgado
2012-03-15cli: avoid unneeded refs when synchronously looking for bearer/sms/simAleksander Morgado
2012-03-15cli: setup to work with SMS objectsAleksander Morgado
2012-03-15cli: fix help, bearers and SIMs can be specified also by indexAleksander Morgado
2012-03-15cli: allow specifying bearers and SIMs by indexAleksander Morgado
So, these two are equivalent: $> mmcli -b 0 $> mmcli -b /org/freedesktop/ModemManager1/Bearer/0 and also this two: $> mmcli -s 0 $> mmcli -s /org/freedesktop/ModemManager1/SIM/0
2012-03-15cli: use new enums/flags string getters/buildersAleksander Morgado
2012-03-15cli: new helper to get the CDMA registration state stringAleksander Morgado
2012-03-15cli: print Rm protocol in bearer infoAleksander Morgado
2012-03-15cli: fix invalid write when completing async operationAleksander Morgado
Don't use the same context to pass the results to finalize().
2012-03-15cli: use g_list_free_full() when possibleAleksander Morgado
2012-03-15cli: implement SIM related actionsAleksander Morgado
2012-03-15cli: include 3GPP related stuff when printing modem infoAleksander Morgado
2012-03-15cli: implement 3GPP related actionsAleksander Morgado
2012-03-15cli: specify common options in a new groupAleksander Morgado
Actions on modems from specific interfaces, like 3GPP, will also need the modem to be specified. The new 'Common' option group will handle all options to specify objects.
2012-03-15cli: always keep a MMManager aroundAleksander Morgado
In order to receive signals in the GDBusObjects retrieved from the GDBusObjectManagerClient, we need to keep a reference of the client around.
2012-03-15cli: new helper to look for specific MMBearer objectsAleksander Morgado
2012-03-15cli: new helper to get name of MMBearerIpMethodAleksander Morgado