Merge pull request #16 from Raqbit/add-wireless-enabled-setter

Implement SetPropertyWirelessEnabled
This commit is contained in:
Christian Müller 2021-03-26 08:54:56 +01:00 committed by GitHub
commit 6582e83911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,6 +151,7 @@ type NetworkManager interface {
// Indicates if wireless is currently enabled or not. // Indicates if wireless is currently enabled or not.
GetPropertyWirelessEnabled() (bool, error) GetPropertyWirelessEnabled() (bool, error)
SetPropertyWirelessEnabled(bool) error
// Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch. // Indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.
GetPropertyWirelessHardwareEnabled() (bool, error) GetPropertyWirelessHardwareEnabled() (bool, error)
@ -501,6 +502,10 @@ func (nm *networkManager) GetPropertyWirelessEnabled() (bool, error) {
return nm.getBoolProperty(NetworkManagerPropertyWirelessEnabled) return nm.getBoolProperty(NetworkManagerPropertyWirelessEnabled)
} }
func (nm *networkManager) SetPropertyWirelessEnabled(enabled bool) error {
return nm.setProperty(NetworkManagerPropertyWirelessEnabled, enabled)
}
func (nm *networkManager) GetPropertyWirelessHardwareEnabled() (bool, error) { func (nm *networkManager) GetPropertyWirelessHardwareEnabled() (bool, error) {
return nm.getBoolProperty(NetworkManagerPropertyWirelessHardwareEnabled) return nm.getBoolProperty(NetworkManagerPropertyWirelessHardwareEnabled)
} }