Add NetworkManager.ActivateConnection
This commit is contained in:
parent
43dec4c754
commit
bfdf42806c
1 changed files with 15 additions and 0 deletions
|
@ -72,6 +72,9 @@ type NetworkManager interface {
|
|||
// GetActiveConnections returns the active connection of network devices.
|
||||
GetActiveConnections() []ActiveConnection
|
||||
|
||||
// Activate a connection using the supplied device.
|
||||
ActivateConnection(connection Connection, device Device) ActiveConnection
|
||||
|
||||
// ActivateWirelessConnection requests activating access point to network device
|
||||
ActivateWirelessConnection(connection Connection, device Device, accessPoint AccessPoint) ActiveConnection
|
||||
|
||||
|
@ -157,6 +160,18 @@ func (n *networkManager) GetActiveConnections() []ActiveConnection {
|
|||
return ac
|
||||
}
|
||||
|
||||
func (n *networkManager) ActivateConnection(c Connection, d Device) ActiveConnection {
|
||||
var opath dbus.ObjectPath
|
||||
n.callWithReturnAndPanic(&opath, NetworkManagerActivateConnection, c.GetPath(), d.GetPath(), dbus.ObjectPath("/"))
|
||||
|
||||
activeConnection, err := NewActiveConnection(opath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return activeConnection
|
||||
}
|
||||
|
||||
func (n *networkManager) ActivateWirelessConnection(c Connection, d Device, ap AccessPoint) ActiveConnection {
|
||||
var opath dbus.ObjectPath
|
||||
n.callWithReturnAndPanic(&opath, NetworkManagerActivateConnection, c.GetPath(), d.GetPath(), ap.GetPath())
|
||||
|
|
Reference in a new issue