Merge branch 'pr/31'

This commit is contained in:
Christian Müller 2022-11-21 17:58:11 +01:00
commit 377c54056d

View file

@ -150,6 +150,9 @@ type Device interface {
// GetPropertyReal True if the device exists, or False for placeholder devices that do not yet exist but could be automatically created by NetworkManager if one of their AvailableConnections was activated. // GetPropertyReal True if the device exists, or False for placeholder devices that do not yet exist but could be automatically created by NetworkManager if one of their AvailableConnections was activated.
GetPropertyReal() (bool, error) GetPropertyReal() (bool, error)
// The result of the last IPv4 connectivity check.
GetPropertyIp4Connectivity() (NmConnectivity, error)
MarshalJSON() ([]byte, error) MarshalJSON() ([]byte, error)
} }
@ -309,6 +312,11 @@ func (d *device) GetPropertyReal() (bool, error) {
return d.getBoolProperty(DevicePropertyReal) return d.getBoolProperty(DevicePropertyReal)
} }
func (d *device) GetPropertyIp4Connectivity() (NmConnectivity, error) {
u, err := d.getUint32Property(DevicePropertyIp4Connectivity)
return NmConnectivity(u), err
}
func (d *device) marshalMap() (map[string]interface{}, error) { func (d *device) marshalMap() (map[string]interface{}, error) {
Interface, err := d.GetPropertyInterface() Interface, err := d.GetPropertyInterface()
if err != nil { if err != nil {