Class: NetworkManager::DBus::Device

Inherits:
Object
  • Object
show all
Includes:
DBusInterface::Object
Defined in:
lib/network_manager/dbus/device.rb

Constant Summary

NM_DEVICE_TYPE__PROPERTY =
'DeviceType'
NM_DEVICE_TYPE_UNKNOWN =

The device type is unknown.

0
NM_DEVICE_TYPE_ETHERNET =

The device is wired Ethernet device.

1
NM_DEVICE_TYPE_WIFI =

The device is an 802.11 WiFi device.

2
NM_DEVICE_TYPE_UNUSED1 =

Unused

3
NM_DEVICE_TYPE_UNUSED2 =

Unused

4
NM_DEVICE_TYPE_BT =

The device is Bluetooth device that provides PAN or DUN capabilities.

5
NM_DEVICE_TYPE_OLPC_MESH =

The device is an OLPC mesh networking device.

6
NM_DEVICE_TYPE_WIMAX =

The device is an 802.16e Mobile WiMAX device.

7
NM_DEVICE_TYPE_MODEM =

The device is a modem supporting one or more of analog telephone, CDMA/EVDO, GSM/UMTS/HSPA, or LTE standards to access a cellular or wireline data network.

8

Instance Method Summary (collapse)

Methods included from DBusInterface::Object

#[], #call, included, #initialize, #object_path, #object_path=, #properties, #to_s

Instance Method Details

- (NetworkManager::DBus::ActiveConnection) active_connection

Con



46
47
48
49
# File 'lib/network_manager/dbus/device.rb', line 46

def active_connection
  @active_connection ||=
    NetworkManager::DBus::ActiveConnection.new self['ActiveConnection']
end

- (Object) apply_settings(con)

activate the given connection settings on the device



74
75
76
# File 'lib/network_manager/dbus/device.rb', line 74

def apply_settings(con)
  NetworkManager::DBus::Root.activate_connection con, self
end

- (NetworkManager::DBus::Ip4Config) dhcp4_config

Conf

Returns:



41
42
43
# File 'lib/network_manager/dbus/device.rb', line 41

def dhcp4_config
  @dhcp4_config ||= NetworkManager::DBus::Dhcp4Config.new self['Dhcp4Config']
end

- (NetworkManager::DBus::EthernetDevice) ethernet

Dev



60
61
62
63
64
65
66
# File 'lib/network_manager/dbus/device.rb', line 60

def ethernet
  if ethernet?
    @ethernet ||= NetworkManager::DBus::EthernetDevice.new(self.object_path)
  else
    nil
  end
end

- (Boolean) ethernet?

ETHERNET

Returns:

  • (Boolean)


55
56
57
# File 'lib/network_manager/dbus/device.rb', line 55

def ethernet?
  properties[NM_DEVICE_TYPE__PROPERTY] == NM_DEVICE_TYPE_ETHERNET
end

- (Object) ip4_address



27
28
29
30
31
32
33
# File 'lib/network_manager/dbus/device.rb', line 27

def ip4_address
  @ip_addr ||= begin
    ip4_int = self['Ip4Address']
    i = NetworkManager::Ip4Config.from_nm_au ip4_int
    i.address
  end
end

- (NetworkManager::DBus::Ip4Config) ip4_config

Conf

Returns:



36
37
38
# File 'lib/network_manager/dbus/device.rb', line 36

def ip4_config
  @ip4_config ||= NetworkManager::DBus::Ip4Config.new self['Ip4Config']
end