How to add a button for ModemManager on Ubuntu GUI
Dan Williams
dcbw at redhat.com
Tue Feb 26 14:55:30 UTC 2019
On Tue, 2019-02-26 at 14:23 +0800, ηιδΉ wrote:
> Hey
> Recently I am doing some test development on ModemManager.
> There is a requirement that add a button on the Ubuntu GUI to set IP
> family(ipv4 or ipv6) of the ModemManager.(Just for test now)
> Here are my questions:
> 1.The Ubuntu desktop GUI button should be a Dbus client? Or how the
> button
> communication with the ModemManager?
UIs typically communicate with NetworkManager (or if KDE, then KDE's
plasma-nm) and tell NetworkManager to update the connection details.
NetworkManager is what actually sends configuration to ModemManager
when the connection is requested.
> 2.After a Modem be created in ModemManager, we can find the menu for
> MM in
> the GUI. Is the menu as a Dbus client connect to NetworkManager or
> just
> connect with ModemManager?
The menu is a DBus client of NetworkManager and ModemManager. But the
bits that would do v4/v6 interact with NetworkManager.
> 3.How to judge the GUI setting has sent to ModemManager? I have no
> idea to
> read the what is going on in the ModemManager Dbus session.
The process that happens is usually this...
- ModemManager finds a new modem; NetworkManager listens to MM and
creates a new NMDevice object for the modem
- a UI applet listens to NetworkManager for the Device object and then
displays the modem in the menu.
- the UI applet listens to ModemManager for signal and carrier
information.
- when the user wants to connect WWAN the first time, the UI applet
will ask for some additional information like carrier name and plan so
that it can determine which APN to use
- when the UI knows what APN to use, it then asks NM to create a new
Connection for the modem (using that APN) and connect the device
- NM then handles connecting WWAN, including asking ModemManager to
start the packet data connection, and then performs IP address
configuration
If you need to modify the v4/v6 preference, the place to do that would
typically be in the UI that asks for the APN, since that's where the
Connection object details are requested from the user.
You need to be a bit careful though, since not all modems support v6 or
mixed v4v6 PDP contexts. ModemManager indicates what the modem supports
on D-Bus, so the UI you construct should also query ModemManager for
the modem's capability and only present choices that will actually
succeed.
Dan
> I have search the questions on Internet, but not get the
> answer.(Maybe the
> search info not exact) Thanks for your any help information!
>
> Quincy
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
More information about the ModemManager-devel
mailing list