Closed jpnurmi closed 2 years ago
Test code in Python:
import dbus
bus = dbus.SystemBus()
client = dbus.Interface(bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager"), "org.freedesktop.NetworkManager")
connection = dbus.Dictionary({
"connection": dbus.Dictionary({
"id": "<name>",
"type": "802-11-wireless",
}),
"802-11-wireless": dbus.Dictionary({
"ssid": dbus.ByteArray("<ssid>".encode("utf-8")),
}),
"802-11-wireless-security": dbus.Dictionary({
"key-mgmt": "wpa-psk",
"psk": "<password>"
}),
})
device = dbus.ObjectPath("/org/freedesktop/NetworkManager/Devices/<num>")
ap = dbus.ObjectPath("/") # <== the AP is not known, "/" is fine
print(client.AddAndActivateConnection(connection, device, ap))
@robert-ancell, could you publish this, please? It's needed for https://github.com/canonical/ubuntu-desktop-installer/pull/630.
Published as nm 0.4.3
NetworkManager does not require specifying an access point when adding and activating a hidden Wi-Fi connection. The access point is not known at that point anyway.