add_and_activate_connection_async


Description:

public async ActiveConnection add_and_activate_connection_async (Connection? @partial, Device? device, string? specific_object, Cancellable? cancellable) throws Error

Adds a new connection using the given details (if any) as a template, automatically filling in missing settings with the capabilities of the given device and specific object.

The new connection is then asynchronously activated as with activate_connection_async. Cannot be used for VPN connections at this time.

Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can used the returned ActiveConnection object (in particular, state) to track the activation to its completion.

Parameters:

this

a Client

device

the Device

specific_object

the object path of a connection-type-specific object this activation should use. This parameter is currently ignored for wired and mobile broadband connections, and the value of null should be used (ie, no specific object). For Wi-Fi or WiMAX connections, pass the object path of a AccessPoint or WimaxNsp owned by device, which you can get using get_path, and which will be used to complete the details of the newly added connection. If the variant is floating, it will be consumed.

cancellable

a Cancellable, or null

callback

callback to be called when the activation has started

partial

an Connection to add; the connection may be partially filled (or even null) and will be completed by NetworkManager using the given device and specific_object before being added

user_data

caller-specific data passed to callback