NM.DeviceWifi

g GObject.Object GObject.Object NM.Object NM.Object GObject.Object->NM.Object NM.Device NM.Device NM.DeviceWifi NM.DeviceWifi NM.Device->NM.DeviceWifi NM.Object->NM.Device

Subclasses:

None

Methods

Inherited:

NM.Device (54), NM.Object (2), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_access_point_by_path (path)

get_access_points ()

get_active_access_point ()

get_bitrate ()

get_capabilities ()

get_last_scan ()

get_mode ()

get_permanent_hw_address ()

request_scan (cancellable)

request_scan_async (cancellable, callback, *user_data)

request_scan_finish (result)

request_scan_options (options, cancellable)

request_scan_options_async (options, cancellable, callback, *user_data)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Device (32), NM.Object (2)

Name

Type

Flags

Short Description

access-points

GLib.PtrArray

r

active-access-point

NM.AccessPoint

r

bitrate

int

r

last-scan

int

r

mode

NM.80211Mode

r

perm-hw-address

str

r

wireless-capabilities

NM.DeviceWifiCapabilities

r

Signals

Inherited:

NM.Device (1), GObject.Object (1)

Name

Short Description

access-point-added

Notifies that a NM.AccessPoint is added to the Wi-Fi device.

access-point-removed

Notifies that a NM.AccessPoint is removed from the Wi-Fi device.

Fields

Inherited:

NM.Device (1), GObject.Object (1)

Class Details

class NM.DeviceWifi(**kwargs)
Bases:

NM.Device

Abstract:

No

Structure:

NM.DeviceWifiClass

get_access_point_by_path(path)
Parameters:

path (str) – the object path of the access point

Returns:

the access point or None if none is found.

Return type:

NM.AccessPoint

Gets a NM.AccessPoint by path.

get_access_points()
Returns:

a GLib.PtrArray containing all the scanned NM.AccessPoints. The returned array is owned by the client and should not be modified.

Return type:

[NM.AccessPoint]

Gets all the scanned access points of the NM.DeviceWifi.

get_active_access_point()
Returns:

the access point or None if none is active

Return type:

NM.AccessPoint

Gets the active NM.AccessPoint.

get_bitrate()
Returns:

the bit rate (kbit/s)

Return type:

int

Gets the bit rate of the NM.DeviceWifi in kbit/s.

get_capabilities()
Returns:

the capabilities

Return type:

NM.DeviceWifiCapabilities

Gets the Wi-Fi capabilities of the NM.DeviceWifi.

get_last_scan()
Returns:

the last scan time in milliseconds (in clock_gettime(CLOCK_BOOTTIME) scale).

Return type:

int

Returns the timestamp (in CLOCK_BOOTTIME milliseconds) for the last finished network scan. A value of -1 means the device never scanned for access points.

Use NM.utils_get_timestamp_msec() to obtain current time value suitable for comparing to this value.

New in version 1.12.

get_mode()
Returns:

the mode

Return type:

NM.80211Mode

Gets the NM.DeviceWifi mode.

get_permanent_hw_address()
Returns:

the permanent hardware address. This is the internal string used by the device, and must not be modified.

Return type:

str

Gets the permanent hardware (MAC) address of the NM.DeviceWifi

request_scan(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

Raises:

GLib.Error

Returns:

True on success, False on error, in which case error will be set.

Return type:

bool

Request NM to scan for access points on self. Note that the function returns immediately after requesting the scan, and it may take some time after that for the scan to complete.

Deprecated since version 1.22: Use NM.DeviceWifi.request_scan_async() or Gio.DBusConnection.

request_scan_async(cancellable, callback, *user_data)
Parameters:

Request NM to scan for access points on self. Note that callback will be called immediately after requesting the scan, and it may take some time after that for the scan to complete.

request_scan_finish(result)
Parameters:

result (Gio.AsyncResult) – the result passed to the Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True on success, False on error, in which case error will be set.

Return type:

bool

Gets the result of a call to NM.DeviceWifi.request_scan_async() and NM.DeviceWifi.request_scan_options_async().

request_scan_options(options, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on error, in which case error will be set.

Return type:

bool

Request NM to scan for access points on self. Note that the function returns immediately after requesting the scan, and it may take some time after that for the scan to complete. This is the same as nm_device_wifi_request_scan except it accepts options for the scanning. The argument is the dictionary passed to RequestScan() D-Bus call. Valid options inside the dictionary are: ‘ssids’ => array of SSIDs (saay)

New in version 1.2.

Deprecated since version 1.22: Use NM.DeviceWifi.request_scan_options_async() or Gio.DBusConnection.

request_scan_options_async(options, cancellable, callback, *user_data)
Parameters:

Request NM to scan for access points on self. Note that callback will be called immediately after requesting the scan, and it may take some time after that for the scan to complete. This is the same as nm_device_wifi_request_scan_async except it accepts options for the scanning. The argument is the dictionary passed to RequestScan() D-Bus call. Valid options inside the dictionary are: ‘ssids’ => array of SSIDs (saay)

To complete the request call NM.DeviceWifi.request_scan_finish().

New in version 1.2.

Signal Details

NM.DeviceWifi.signals.access_point_added(device_wifi, ap)
Signal Name:

access-point-added

Flags:

RUN_FIRST

Parameters:

Notifies that a NM.AccessPoint is added to the Wi-Fi device.

NM.DeviceWifi.signals.access_point_removed(device_wifi, ap)
Signal Name:

access-point-removed

Flags:

RUN_FIRST

Parameters:

Notifies that a NM.AccessPoint is removed from the Wi-Fi device.

Property Details

NM.DeviceWifi.props.access_points
Name:

access-points

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE

List of all Wi-Fi access points the device can see.

NM.DeviceWifi.props.active_access_point
Name:

active-access-point

Type:

NM.AccessPoint

Default Value:

None

Flags:

READABLE

The active NM.AccessPoint of the device.

NM.DeviceWifi.props.bitrate
Name:

bitrate

Type:

int

Default Value:

0

Flags:

READABLE

The bit rate of the device in kbit/s.

NM.DeviceWifi.props.last_scan
Name:

last-scan

Type:

int

Default Value:

-1

Flags:

READABLE

The timestamp (in CLOCK_BOOTTIME seconds) for the last finished network scan. A value of -1 means the device never scanned for access points.

New in version 1.12.

NM.DeviceWifi.props.mode
Name:

mode

Type:

NM.80211Mode

Default Value:

NM.80211Mode.UNKNOWN

Flags:

READABLE

The mode of the device.

NM.DeviceWifi.props.perm_hw_address
Name:

perm-hw-address

Type:

str

Default Value:

None

Flags:

READABLE

The hardware (MAC) address of the device.

NM.DeviceWifi.props.wireless_capabilities
Name:

wireless-capabilities

Type:

NM.DeviceWifiCapabilities

Default Value:

NM.DeviceWifiCapabilities.NONE

Flags:

READABLE

The wireless capabilities of the device.