Commit Graph

46 Commits

Author SHA1 Message Date
Aleksander Morgado
21c775703c libmm-glib: fix license in sources
The libmm-glib library is LGPLv2+, not GPLv2+.
2021-11-16 17:54:26 +01:00
lvmaorui
8e67d2375c docs,libmm-glib: add SAR user-level api 2021-10-13 13:14:10 +02:00
Aleksander Morgado
93a0476b4d libmm-glib,manager: fix warning with -Wdiscarded-qualifiers
In file included from /usr/include/glib-2.0/glib.h:50,
                   from ../libmm-glib/mm-common-helpers.h:18,
                   from ../libmm-glib/mm-manager.c:27:
  /usr/include/glib-2.0/glib/ghash.h:68:61: note: expected ‘gpointer’ {aka ‘void *’} but argument is of type ‘const char *’
     68 |                                             gpointer        key,
        |                                             ~~~~~~~~~~~~~~~~^~~
  ../libmm-glib/mm-manager.c:81:43: warning: passing argument 2 of ‘g_hash_table_insert’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     81 |         g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Simple",                   GSIZE_TO_POINTER (MM_TYPE_MODEM_SIMPLE));
        |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /usr/include/glib-2.0/glib.h:50,
                   from ../libmm-glib/mm-common-helpers.h:18,
                   from ../libmm-glib/mm-manager.c:27:
2021-09-07 10:55:43 +00:00
Aleksander Morgado
ff45d292ee libmm-glib: setup common helper to register DBus errors 2021-05-22 22:58:37 +00:00
Aleksander Morgado
2d43ea48e1 api,modem: new Modem3gpp.ProfileManager interface
This new interface allows modems to expose the list of available
connection profiles stored in the device and edit or delete them; as
long as the underlying device/protocol allows it.
2021-04-29 10:13:22 +00:00
Aleksander Morgado
08d23dd64d docs,libmm-glib: provide per-version indices 2019-10-28 10:28:31 +01:00
Aleksander Morgado
478a076d30 libmm-glib,manager: use g_async_initable_new_finish() explicitly
We're running g_async_initable_new_async() ourselves in
mm_manager_new(), so our finish() method should call
g_async_initable_new_finish() explicitly.

There's no change in the logic here, as the generated
mm_gdbus_object_manager_client_new_finish() was already doing this
implicitly.
2019-01-13 18:11:41 +01:00
Aleksander Morgado
495a466aaa libmm-glib,manager: simplify object creation
The G_OBJECT() casts accept NULL safely.
2019-01-13 18:02:22 +01:00
Aleksander Morgado
3eb3854fcb libmm-glib,manager: cleanup internal proxy on name owner updates
The MMManager object keeps an internal proxy object for the Manager
interface, and we must make sure we cleanup this object any time the MM
daemon is restarted. Otherwise, the MMManager may end up trying to use
a stale proxy associated to a previous run of the daemon, and e.g. not
showing properly the runtime version info.

E.g., in this sequence with the example python tester, the runtime
version of the daemon was valid only for the first time the daemon
runs, and if the daemon is restarted, mm_manager_get_version()
would keep returning NULL.

    $ ./modem-watcher-python
    [ModemWatcher] ModemManager service not available in bus
    [ModemWatcher] ModemManager 1.9.990 service is available in bus
    [ModemWatcher] Dell Inc. (DW5821e Snapdragon X20 LTE) modem managed by ModemManager [None]: /org/freedesktop/ModemManager1/Modem/0
    [ModemWatcher] ModemManager service not available in bus
    [ModemWatcher] ModemManager None service is available in bus
    [ModemWatcher] Dell Inc. (DW5821e Snapdragon X20 LTE) modem managed by ModemManager [None]: /org/freedesktop/ModemManager1/Modem/0
    [ModemWatcher] ModemManager service not available in bus
    [ModemWatcher] ModemManager None service is available in bus
    [ModemWatcher] Dell Inc. (DW5821e Snapdragon X20 LTE) modem managed by ModemManager [None]: /org/freedesktop/ModemManager1/Modem/0
2019-01-13 18:01:54 +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
46d627ff83 libmm-glib: fix mm_manager_scan() operation
The reporting of the operation result was reversed in the async method.
2018-12-07 17:00:36 +01:00
Aleksander Morgado
1ef58be792 libmm-glib: fix mm_manager_set_logging() operation
The reporting of the operation result was reversed in the async method.
2018-12-07 16:59:44 +01:00
Aleksander Morgado
c7af14cc80 api,manager: new 'Version' property
This string shows the runtime version of the ModemManager daemon.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/94
2018-12-04 17:26:59 +00:00
Aleksander Morgado
d0bb8d1d50 libmm-glib,manager: fix manager interface proxy creation
We were re-using the GDBusObjectManagerClientFlags set in the
MMManager object as GDBusProxyFlags for the Manager1 interface proxy
object, and that was completely broken.

Instead of setting "DO_NOT_AUTO_START" in the proxy, we were actually
setting "DO_NOT_LOAD_PROPERTIES"...
2018-12-04 17:26:59 +00:00
Ville Skyttä
90b89bb9f4 *: Spelling fixes 2018-01-25 09:52:12 +01:00
Ben Chan
19794d0846 libmm-glib,manager: port mm_manager_scan_devices to use GTask 2017-06-23 10:26:53 +02:00
Ben Chan
2f3d9642f6 libmm-glib,manager: port mm_manager_set_logging to use GTask 2017-06-23 10:26:52 +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
Riccardo Vangelisti
ecbd146d5a fixes: added voice support in libmm-glib MMManager, also fixed wrong number of parameters in mm-call-list class init 2015-08-02 10:39:12 +02:00
Aleksander Morgado
8ab38ae968 libmm-glib: support for the 'OMA' interface 2013-09-09 10:15:18 +02:00
Aleksander Morgado
fcdbefa519 libmm-glib: handle the new 'Signal' interface 2013-08-21 12:33:09 +02:00
Aleksander Morgado
b582ba58e8 api,introspection: avoid exposing the Contacts interface
There is no implementation of the Contacts interface yet, just avoid exposing it
for now.

https://bugzilla.gnome.org/show_bug.cgi?id=701989
2013-06-18 16:19:19 +02:00
Yunlian Jiang
9dcbf33c88 mm-glib: use correct enum type 2013-04-29 11:53:26 -05:00
Aleksander Morgado
d44eb83ac4 libmm-glib,manager: add missing logic to ensure the proxy is created 2013-02-06 22:20:19 +01:00
Aleksander Morgado
a85fd0ab4f libmm-glib,manager: don't fail creation if the ModemManager process is not found
A 'GDBusObjectManagerClient' for a service for which there is no current
name-owner is a perfectly valid and useful object. For example, we could then
connect to the 'notify::name-owner' property to follow the life cycle of the
ModemManager process.

So, don't tie the successful creation of a 'MMManager' to the successful
creation of the internal GDBusProxy for the 'Manager1' interface. If there is
no current name owner, the GDBusProxy wouldn't be created, and instead we
would completely fail the 'MMManager' creation.
2013-02-06 19:56:18 +01:00
Aleksander Morgado
2ad6e0627d libmm-glib: fix error reporting when 'MMManager' is created 2013-02-06 19:10:13 +01:00
Aleksander Morgado
562055b53b libmm-glib,manager: client creation may fail, avoid explicit MM_MANAGER() cast 2012-11-27 16:25:51 +01:00
Aleksander Morgado
cf46ed4238 libmm-glib,manager: register DBus error associations in advance
In order to have a proper conversion between DBus error names and GErrors for
our known domains, the associations need to be registered before any DBus
call attempt.

Given that the high-level API of libmm-glib has its entry point always in the
MMManager, just register them as soon as the first such object is created.
2012-11-15 09:39:26 +01:00
Aleksander Morgado
94d62146e3 libmm-glib,manager: avoid unref of unset cancellables 2012-11-07 11:10:32 +01:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
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-10-04 10:17:12 +02:00
Aleksander Morgado
8bdcdeecb6 libmm-glib,manager: minor indentation fixes 2012-10-04 10:17:05 +02:00
Aleksander Morgado
715a775949 libmm-glib,firmware: new `MMModemFirmware' type to handle the Firmware interface 2012-10-04 10:17:05 +02:00
Aleksander Morgado
730f69a6d4 libmm-glib,time: `MMModemTime' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModemTime'.
2012-10-02 14:45:37 +02:00
Aleksander Morgado
653582ce17 libmm-glib,simple: `MMModemSimple' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModemSimple'.
2012-10-02 14:45:37 +02:00
Aleksander Morgado
6ac9460543 libmm-glib,messaging: `MMModemMessaging' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModemMessaging'.
2012-10-02 14:45:37 +02:00
Aleksander Morgado
45172e39b4 libmm-glib,location: `MMModemLocation' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModemLocation'.
2012-10-02 14:45:37 +02:00
Aleksander Morgado
2d6bca4b8b libmm-glib,cdma: `MMModemCdma' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModemCdma'.
2012-10-02 14:45:36 +02:00
Aleksander Morgado
9a722de6bb libmm-glib,3gpp-ussd: `MMModem3gppUssd' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModem3gppUssd'.
2012-10-02 14:45:36 +02:00
Aleksander Morgado
f5be23757d libmm-glib,3gpp: `MMModem3gpp' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModem3gpp'.
2012-10-02 14:45:36 +02:00
Aleksander Morgado
8ae0c36ab9 libmm-glib,modem: `MMModem' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusModem'.
2012-10-01 23:44:48 +02:00
Aleksander Morgado
d07a138d37 libmm-glib,object: `MMObject' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusObject'.
2012-10-01 23:44:47 +02:00
Aleksander Morgado
2f16ef2278 libmm-glib,manager: cleanup object implementation 2012-10-01 23:44:47 +02:00
Aleksander Morgado
acf2e6d1e0 libmm-glib,manager: allow specifying the generated proxy types ourselves 2012-10-01 23:44:47 +02:00
Aleksander Morgado
737b6c2fc5 cli,libmm-glib: provide mm_manager_(peek|get)_proxy()
peek() doesn't increase the reference count of the proxy object, while get()
does it.
2012-07-31 09:02:58 +02:00
Ben Chan
60405ce4ff cli,libmm-glib: set default timeout on manager DBus proxy
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-31 08:54:45 +02:00
Aleksander Morgado
ba0e4ca88e libmm-glib: setup build of the libmm-glib library
The library will contain a small layer of code on top of the proxies and object
manager client generated by gdbus-codegen. Therefore, the headers auto-generated
from the DBus introspection XMLs need to be distributed along with the
libmm-glib specific headers.
2012-03-15 14:14:25 +01:00