Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
f731daa637
6 changed files with 307 additions and 89 deletions
|
@ -86,8 +86,11 @@ func (a *accessPoint) GetPropertyRSNFlags() (uint32, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *accessPoint) GetPropertySSID() (string, error) {
|
func (a *accessPoint) GetPropertySSID() (string, error) {
|
||||||
v, err := a.getSliceByteProperty(AccessPointPropertySsid)
|
r, err := a.getSliceByteProperty(AccessPointPropertySsid)
|
||||||
return string(v), err
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return string(r), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *accessPoint) GetPropertyFrequency() (uint32, error) {
|
func (a *accessPoint) GetPropertyFrequency() (uint32, error) {
|
||||||
|
@ -99,8 +102,11 @@ func (a *accessPoint) GetPropertyHWAddress() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *accessPoint) GetPropertyMode() (Nm80211Mode, error) {
|
func (a *accessPoint) GetPropertyMode() (Nm80211Mode, error) {
|
||||||
v, err := a.getUint32Property(AccessPointPropertyMode)
|
r, err := a.getUint32Property(AccessPointPropertyMode)
|
||||||
return Nm80211Mode(v), err
|
if err != nil {
|
||||||
|
return Nm80211ModeUnknown, err
|
||||||
|
}
|
||||||
|
return Nm80211Mode(r), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *accessPoint) GetPropertyMaxBitrate() (uint32, error) {
|
func (a *accessPoint) GetPropertyMaxBitrate() (uint32, error) {
|
||||||
|
@ -112,19 +118,52 @@ func (a *accessPoint) GetPropertyStrength() (uint8, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *accessPoint) MarshalJSON() ([]byte, error) {
|
func (a *accessPoint) MarshalJSON() ([]byte, error) {
|
||||||
m := make(map[string]interface{})
|
Flags, err := a.GetPropertyFlags()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
WPAFlags, err := a.GetPropertyWPAFlags()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
RSNFlags, err := a.GetPropertyRSNFlags()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
SSID, err := a.GetPropertySSID()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
Frequency, err := a.GetPropertyFrequency()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
HWAddress, err := a.GetPropertyHWAddress()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
Mode, err := a.GetPropertyMode()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
MaxBitrate, err := a.GetPropertyMaxBitrate()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
Strength, err := a.GetPropertyStrength()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
m["Flags"], _ = a.GetPropertyFlags()
|
return json.Marshal(map[string]interface{}{
|
||||||
m["WPAFlags"], _ = a.GetPropertyWPAFlags()
|
"Flags": Flags,
|
||||||
m["RSNFlags"], _ = a.GetPropertyRSNFlags()
|
"WPAFlags": WPAFlags,
|
||||||
m["SSID"], _ = a.GetPropertySSID()
|
"RSNFlags": RSNFlags,
|
||||||
m["Frequency"], _ = a.GetPropertyFrequency()
|
"SSID": SSID,
|
||||||
m["HWAddress"], _ = a.GetPropertyHWAddress()
|
"Frequency": Frequency,
|
||||||
m["MaxBitrate"], _ = a.GetPropertyMaxBitrate()
|
"HWAddress": HWAddress,
|
||||||
m["Strength"], _ = a.GetPropertyStrength()
|
"Mode": Mode.String(),
|
||||||
|
"MaxBitrate": MaxBitrate,
|
||||||
mode, _ := a.GetPropertyMode()
|
"Strength": Strength,
|
||||||
m["Mode"] = mode.String()
|
})
|
||||||
|
|
||||||
return json.Marshal(m)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,8 +96,11 @@ func (a *activeConnection) GetPropertyConnection() (Connection, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
con, err := NewConnection(path)
|
||||||
return NewConnection(path)
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return con, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertySpecificObject() (AccessPoint, error) {
|
func (a *activeConnection) GetPropertySpecificObject() (AccessPoint, error) {
|
||||||
|
@ -105,8 +108,11 @@ func (a *activeConnection) GetPropertySpecificObject() (AccessPoint, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
ap, err := NewAccessPoint(path)
|
||||||
return NewAccessPoint(path)
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return ap, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyID() (string, error) {
|
func (a *activeConnection) GetPropertyID() (string, error) {
|
||||||
|
@ -126,17 +132,15 @@ func (a *activeConnection) GetPropertyDevices() ([]Device, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
devices := make([]Device, len(paths))
|
devices := make([]Device, len(paths))
|
||||||
for i, path := range paths {
|
for i, path := range paths {
|
||||||
devices[i], err = DeviceFactory(path)
|
devices[i], err = DeviceFactory(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return devices, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return devices, nil
|
return devices, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyState() (NmActiveConnectionState, error) {
|
func (a *activeConnection) GetPropertyState() (NmActiveConnectionState, error) {
|
||||||
v, err := a.getUint32Property(ActiveConnectionPropertyState)
|
v, err := a.getUint32Property(ActiveConnectionPropertyState)
|
||||||
return NmActiveConnectionState(v), err
|
return NmActiveConnectionState(v), err
|
||||||
|
@ -147,25 +151,35 @@ func (a *activeConnection) GetPropertyStateFlags() (uint32, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyDefault() (bool, error) {
|
func (a *activeConnection) GetPropertyDefault() (bool, error) {
|
||||||
return a.getBoolProperty(ActiveConnectionPropertyDefault)
|
b, err := a.getProperty(ActiveConnectionPropertyDefault)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return b.(bool), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyIP4Config() (IP4Config, error) {
|
func (a *activeConnection) GetPropertyIP4Config() (IP4Config, error) {
|
||||||
path, err := a.getObjectProperty(ActiveConnectionPropertyIp4Config)
|
path, err := a.getObjectProperty(ActiveConnectionPropertyIp4Config)
|
||||||
if err != nil || path == "/" {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
r, err := NewIP4Config(path)
|
||||||
return NewIP4Config(path)
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyDHCP4Config() (DHCP4Config, error) {
|
func (a *activeConnection) GetPropertyDHCP4Config() (DHCP4Config, error) {
|
||||||
path, err := a.getObjectProperty(ActiveConnectionPropertyDhcp4Config)
|
path, err := a.getObjectProperty(ActiveConnectionPropertyDhcp4Config)
|
||||||
if err != nil || path == "/" {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
r, err := NewDHCP4Config(path)
|
||||||
return NewDHCP4Config(path)
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyDefault6() (bool, error) {
|
func (a *activeConnection) GetPropertyDefault6() (bool, error) {
|
||||||
|
@ -191,7 +205,11 @@ func (a *activeConnection) GetPropertyDHCP6Config() (DHCP6Config, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyVPN() (bool, error) {
|
func (a *activeConnection) GetPropertyVPN() (bool, error) {
|
||||||
return a.getBoolProperty(ActiveConnectionPropertyVpn)
|
ret, err := a.getProperty(ActiveConnectionPropertyVpn)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return ret.(bool), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *activeConnection) GetPropertyMaster() (Device, error) {
|
func (a *activeConnection) GetPropertyMaster() (Device, error) {
|
||||||
|
@ -199,6 +217,9 @@ func (a *activeConnection) GetPropertyMaster() (Device, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
r, err := DeviceFactory(path)
|
||||||
return DeviceFactory(path)
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,11 @@ func (c *dhcp4Config) GetPropertyOptions() (DHCP4Options, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *dhcp4Config) MarshalJSON() ([]byte, error) {
|
func (c *dhcp4Config) MarshalJSON() ([]byte, error) {
|
||||||
m := make(map[string]interface{})
|
Options, err := c.GetOptions()
|
||||||
m["Options"], _ = c.GetPropertyOptions()
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
return json.Marshal(m)
|
}
|
||||||
|
return json.Marshal(map[string]interface{}{
|
||||||
|
"Options": Options,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
67
Device.go
67
Device.go
|
@ -2,6 +2,7 @@ package gonetworkmanager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
|
||||||
"github.com/godbus/dbus"
|
"github.com/godbus/dbus"
|
||||||
)
|
)
|
||||||
|
@ -192,8 +193,11 @@ func (d *device) GetPropertyFirmwareVersion() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *device) GetPropertyState() (NmDeviceState, error) {
|
func (d *device) GetPropertyState() (NmDeviceState, error) {
|
||||||
v, err := d.getUint32Property(DevicePropertyState)
|
r, err := d.getUint32Property(DevicePropertyState)
|
||||||
return NmDeviceState(v), err
|
if err != nil {
|
||||||
|
return NmDeviceStateFailed, err
|
||||||
|
}
|
||||||
|
return NmDeviceState(r), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *device) GetPropertyActiveConnection() (ActiveConnection, error) {
|
func (d *device) GetPropertyActiveConnection() (ActiveConnection, error) {
|
||||||
|
@ -291,24 +295,51 @@ func (d *device) GetPropertyReal() (bool, error) {
|
||||||
return d.getBoolProperty(DevicePropertyReal)
|
return d.getBoolProperty(DevicePropertyReal)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *device) marshalMap() map[string]interface{} {
|
func (d *device) marshalMap() (map[string]interface{}, error) {
|
||||||
m := make(map[string]interface{})
|
Interface, err := d.GetInterface()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
IPinterface, err := d.GetPropertyIpInterface()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
State, err := d.GetPropertyState()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
IP4Config, err := d.GetPropertyIP4Config()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
DHCP4Config, err := d.GetPropertyDHCP4Config()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
DeviceType, err := d.GetPropertyDeviceType()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
AvailableConnections, err := d.GetPropertyAvailableConnections()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
m["Interface"], _ = d.GetPropertyInterface()
|
return map[string]interface{}{
|
||||||
m["IPInterface"], _ = d.GetPropertyIpInterface()
|
"Interface": Interface,
|
||||||
m["IP4Config"], _ = d.GetPropertyIP4Config()
|
"IP interface": IPinterface,
|
||||||
m["DHCP4Config"], _ = d.GetPropertyDHCP4Config()
|
"State": State.String(),
|
||||||
m["AvailableConnections"], _ = d.GetPropertyAvailableConnections()
|
"IP4Config": IP4Config,
|
||||||
|
"DHCP4Config": DHCP4Config,
|
||||||
state, _ := d.GetPropertyState()
|
"DeviceType": DeviceType.String(),
|
||||||
m["State"] = state.String()
|
"AvailableConnections": AvailableConnections,
|
||||||
|
}, nil
|
||||||
deviceType, _ := d.GetPropertyDeviceType()
|
|
||||||
m["DeviceType"] = deviceType.String()
|
|
||||||
|
|
||||||
return m
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *device) MarshalJSON() ([]byte, error) {
|
func (d *device) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(d.marshalMap())
|
m, err := d.marshalMap()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return json.Marshal(m)
|
||||||
}
|
}
|
||||||
|
|
31
IP4Config.go
31
IP4Config.go
|
@ -292,12 +292,27 @@ func (c *ip4Config) GetPropertyWinsServerData() ([]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ip4Config) MarshalJSON() ([]byte, error) {
|
func (c *ip4Config) MarshalJSON() ([]byte, error) {
|
||||||
m := make(map[string]interface{})
|
Addresses, err := c.GetPropertyAddressData()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
Routes, err := c.GetPropertyRouteData()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
Nameservers, err := c.GetPropertyNameserverData()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
Domains, err := c.GetPropertyDomains()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
m["Addresses"], _ = c.GetPropertyAddressData()
|
return json.Marshal(map[string]interface{}{
|
||||||
m["Routes"], _ = c.GetPropertyRouteData()
|
"Addresses": Addresses,
|
||||||
m["Nameservers"], _ = c.GetPropertyNameserverData()
|
"Routes": Routes,
|
||||||
m["Domains"], _ = c.GetPropertyDomains()
|
"Nameservers": Nameservers,
|
||||||
|
"Domains": Domains,
|
||||||
return json.Marshal(m)
|
})
|
||||||
}
|
}
|
|
@ -557,30 +557,139 @@ func (nm *networkManager) Unsubscribe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (nm *networkManager) MarshalJSON() ([]byte, error) {
|
func (nm *networkManager) MarshalJSON() ([]byte, error) {
|
||||||
m := make(map[string]interface{})
|
|
||||||
|
|
||||||
m["Devices"], _ = nm.GetPropertyDevices()
|
Devices, err := n.GetPropertyDevices()
|
||||||
m["AllDevices"], _ = nm.GetPropertyAllDevices()
|
if err != nil {
|
||||||
m["Checkpoints"], _ = nm.GetPropertyCheckpoints()
|
return nil, err
|
||||||
m["NetworkingEnabled"], _ = nm.GetPropertyNetworkingEnabled()
|
}
|
||||||
m["WirelessEnabled"], _ = nm.GetPropertyWirelessEnabled()
|
|
||||||
m["WirelessHardwareEnabled"], _ = nm.GetPropertyWirelessHardwareEnabled()
|
|
||||||
m["WwanEnabled"], _ = nm.GetPropertyWwanEnabled()
|
|
||||||
m["WwanHardwareEnabled"], _ = nm.GetPropertyWwanHardwareEnabled()
|
|
||||||
m["WimaxEnabled"], _ = nm.GetPropertyWimaxEnabled()
|
|
||||||
m["WimaxHardwareEnabled"], _ = nm.GetPropertyWimaxHardwareEnabled()
|
|
||||||
m["ActiveConnections"], _ = nm.GetPropertyActiveConnections()
|
|
||||||
m["PrimaryConnection"], _ = nm.GetPropertyPrimaryConnection()
|
|
||||||
m["PrimaryConnectionType"], _ = nm.GetPropertyPrimaryConnectionType()
|
|
||||||
m["Metered"], _ = nm.GetPropertyMetered()
|
|
||||||
m["ActivatingConnection"], _ = nm.GetPropertyActivatingConnection()
|
|
||||||
m["Startup"], _ = nm.GetPropertyStartup()
|
|
||||||
m["Version"], _ = nm.GetPropertyVersion()
|
|
||||||
m["Capabilities"], _ = nm.GetPropertyCapabilities()
|
|
||||||
m["State"], _ = nm.GetPropertyState()
|
|
||||||
m["Connectivity"], _ = nm.GetPropertyConnectivity()
|
|
||||||
m["ConnectivityCheckAvailable"], _ = nm.GetPropertyConnectivityCheckAvailable()
|
|
||||||
m["ConnectivityCheckEnabled"], _ = nm.GetPropertyConnectivityCheckEnabled()
|
|
||||||
|
|
||||||
return json.Marshal(m)
|
AllDevices, err := n.GetPropertyAllDevices()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
Checkpoints, err := n.GetPropertyCheckpoints()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
NetworkingEnabled, err := n.GetPropertyNetworkingEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
WirelessEnabled, err := n.GetPropertyWirelessEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
WirelessHardwareEnabled, err := n.GetPropertyWirelessHardwareEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
WwanEnabled, err := n.GetPropertyWwanEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
WwanHardwareEnabled, err := n.GetPropertyWwanHardwareEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
WimaxEnabled, err := n.GetPropertyWimaxEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
WimaxHardwareEnabled, err := n.GetPropertyWimaxHardwareEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ActiveConnections, err := n.GetPropertyActiveConnections()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
PrimaryConnection, err := n.GetPropertyPrimaryConnection()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
PrimaryConnectionType, err := n.GetPropertyPrimaryConnectionType()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
Metered, err := n.GetPropertyMetered()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ActivatingConnection, err := n.GetPropertyActivatingConnection()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
Startup, err := n.GetPropertyStartup()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
Version, err := n.GetPropertyVersion()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
Capabilities, err := n.GetPropertyCapabilities()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
State, err := n.GetPropertyState()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
Connectivity, err := n.GetPropertyConnectivity()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectivityCheckAvailable, err := n.GetPropertyConnectivityCheckAvailable()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectivityCheckEnabled, err := n.GetPropertyConnectivityCheckEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.Marshal(map[string]interface{}{
|
||||||
|
"Devices": Devices,
|
||||||
|
"AllDevices": AllDevices,
|
||||||
|
"Checkpoints": Checkpoints,
|
||||||
|
"NetworkingEnabled": NetworkingEnabled,
|
||||||
|
"WirelessEnabled": WirelessEnabled,
|
||||||
|
"WirelessHardwareEnabled": WirelessHardwareEnabled,
|
||||||
|
"WwanEnabled": WwanEnabled,
|
||||||
|
"WwanHardwareEnabled": WwanHardwareEnabled,
|
||||||
|
"WimaxEnabled": WimaxEnabled,
|
||||||
|
"WimaxHardwareEnabled": WimaxHardwareEnabled,
|
||||||
|
"ActiveConnections": ActiveConnections,
|
||||||
|
"PrimaryConnection": PrimaryConnection,
|
||||||
|
"PrimaryConnectionType": PrimaryConnectionType,
|
||||||
|
"Metered": Metered,
|
||||||
|
"ActivatingConnection": ActivatingConnection,
|
||||||
|
"Startup": Startup,
|
||||||
|
"Version": Version,
|
||||||
|
"Capabilities": Capabilities,
|
||||||
|
"State": State,
|
||||||
|
"Connectivity": Connectivity,
|
||||||
|
"ConnectivityCheckAvailable": ConnectivityCheckAvailable,
|
||||||
|
"ConnectivityCheckEnabled": ConnectivityCheckEnabled,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue