Re: Question on using NM to connect to wifi AP



On 28.07.2021 19:29, Michael Uman wrote:
Hello,
This is my 1st post to the list so please be forgiving if I am not asking
the question correctly. I am trying to use NM to connect to a wifi SSID and
I have the SSID and password, but I cannot figure out which interfaces and
which objects need to be accessed.

My application is using Qt QtDbus to access NM, and I am already using it
to detect whether we are connected to the net, and am listening to the
state change signal. So I understand how to interface with the Dbus
component. But I have not found a clear example of how to connect to an AP
using the interface. I am currently forced to manually set the wifi on our
target device using the nmcli command (which is using NM to do the
connection anyway).

Any suggestions on where to find some example of how to do this? If no
example then maybe a clear explanation of the steps needed to be taken to
support this. I need this to allow the device to connect to the network. I
appreciate any and all comments.



You need to implement org.freedesktop.NetworkManager.SecretAgent
interface and register your provider using
org.freedesktop.NetworkManager.AgentManager interface. NetworkManager
will call you back and request secrets when it needs it.

Example can be found e.g. in ./src/core/tests/test-secret-agent.py in NM
sources. Or nmcli of course (src/nmcli/agent.c).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]