Add Device.Delete

This commit is contained in:
Christian Müller 2019-05-28 14:33:21 +02:00
parent 875ed76c55
commit 3f7449c467

View file

@ -65,6 +65,9 @@ type Device interface {
// Disconnects a device and prevents the device from automatically activating further connections without user intervention.
Disconnect() error
// Deletes a software device from NetworkManager and removes the interface from the system. The method returns an error when called for a hardware device.
Delete() error
// Operating-system specific transient device hardware identifier. This is an opaque string representing the underlying hardware for the device, and shouldn't be used to keep track of individual devices. For some device types (Bluetooth, Modems) it is an identifier used by the hardware service (ie bluez or ModemManager) to refer to that device, and client programs use it get additional information from those services which NM does not provide. The Udi is not guaranteed to be consistent across reboots or hotplugs of the hardware. If you're looking for a way to uniquely track each device in your application, use the object path. If you're looking for a way to track a specific piece of hardware across reboot or hotplug, use a MAC address or USB serial number.
GetUdi() string
@ -121,6 +124,10 @@ func (d *device) Disconnect() error {
return d.call(DeviceDisconnect)
}
func (d *device) Delete() error {
return d.call(DeviceDelete)
}
func (d *device) GetUdi() string {
return d.getStringProperty(DevicePropertyUdi)
}