aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-manager.c
AgeCommit message (Collapse)Author
2022-11-04core,log: new 'MSG' log level between 'INFO' and 'WARN'Aleksander Morgado
We're bumping the current "INFO" level messages to the new "MSG" level, also making the new level the default. The old "INFO" level will be used to setup an intermediate level of logging which is not as verbose as "DEBUG" but still provides some capabilities to analyze the behavior of a modem.
2021-04-29mmcli,manager: add 'wwan' subsystem to kernel event auto scan reportFreedom Liu
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-11-20core: new 'rpmsg' subsystemAleksander Morgado
Most older Qualcomm SoCs (e.g. MSM8916, MSM8974, ...) communicate with the integrated modem via shared memory (SMD channels). This is similar to QRTR on newer SoCs, but without the "network" layer. In fact, the older SoCs also have QRTR, but the modem QMI services are not exposed there. The mainline Linux kernel exposes SMD channels via the "remote processor messaging bus" (rpmsg). Through special IOCTL calls it is possible to create a char device for a rpmsg/SMD channel. We can then use these to send QMI/AT messages to the modem, much like the ordinary serial char devices when using a Qualcomm modem through USB. This commit introduces support for the new 'rpmsg' subsystem, which allows exporting QMI-capable and AT-capable ports. By default NO rpmsg port is flagged as candidate, it is assumed that the plugin adding support for the rpmsg subsystem will add specific rules to do so (e.g. so that non-modem ports are explicitly not flagged as candidate). All rpmsg ports will be probed for AT or QMI capabilities, unless explicit port type hints (e.g. ID_MM_PORT_TYPE_QMI or ID_MM_PORT_TYPE_AT_PRIMARY) are set. These changes are highly based on the initial integration work done by Stephan Gerhold <stephan@gerhold.net> in postmarketOS, see: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/363
2020-03-21cli: context: add ':' to the section titlesAleksander Morgado
So that --help-all print all sections in the same way as the Help and Application option groups.
2020-01-31cli: fix warnings with -WshadowAleksander Morgado
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; | ^~~ ...
2019-01-03api,manager: new InhibitDevice() methodAleksander Morgado
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
2018-12-04api,manager: new 'Version' propertyAleksander Morgado
This string shows the runtime version of the ModemManager daemon. https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/94
2018-11-26cli: allow multiple output format typesAleksander Morgado
In addition to the standard human-friendly output, we now allow a machine-friendly key-value pair output, much easier to parse and use by programs that look at the mmcli output. This new key-value pair output should be treated as API from now on, so third-party programs can assume the output is compatible from one release to another.
2017-06-22build: WITH_UDEV is only defined when enabledAleksander Morgado
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-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 building and running without udevAleksander Morgado
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-29core: allow disabling auto-scan and notifying ports one by one via APIAleksander Morgado
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
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+.
2014-05-29cli: show a nicer modem description if manufacturer or model is unknownBen Chan
2014-05-20cli: consistently use spaces for indentationBen Chan
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-07-31cli,libmm-glib: provide mm_manager_(peek|get)_proxy()Aleksander Morgado
peek() doesn't increase the reference count of the proxy object, while get() does it.
2012-07-31cli,libmm-glib: set default timeout on manager DBus proxyBen Chan
This patch fixes mmcli to set the default timeout on the manager proxy interface (MmGdbusOrgFreedesktopModemManager1) instead of MMManager itself. The later is not a GDBusProxy object.
2012-07-25cli: allow modifying default DBus timeout with `--timeout'Aleksander Morgado
By default 30s will be used for every operation.
2012-03-15cli: use g_list_free_full() when possibleAleksander Morgado
2012-03-15cli: don't recheck group options if already doneAleksander Morgado
2012-03-15cli: allow option groups to force async/sync operationsAleksander Morgado
Some operations are clearly asynchronous (e.g. monitoring modem state), while others are clearly synchronous (e.g. printing modem info). So just allow option groups to force the operation to be async or sync based on the detected action.
2012-03-15cli: use the new libmm-glib API fixesAleksander Morgado
2012-03-15cli: logging improvementsAleksander Morgado
2012-03-15cli: start to port Modem actions to use the new libmm-glibAleksander Morgado
2012-03-15cli: port Manager actions to use the new libmm-glibAleksander Morgado
The original command line interface was written based on a hand-made libmm. This commit ports the Manager interface handling to the new gdbus-codegen-based libmm-glib.
2012-03-15cli: prefix error messages with 'error: 'Aleksander Morgado
2012-03-15cli: use capital letters for manager optionsAleksander Morgado
2012-03-15cli: split into different option groups, in different filesAleksander Morgado