Class

CWInterface

Encapsulates an IEEE 802.11 interface.

Declaration

class CWInterface : NSObject

Overview

Provides access to various WLAN interface parameters, and operations such as scanning for networks, association, and creating computer-to-computer (ad-hoc) networks.

Topics

Setting interface parameters

func setPairwiseMasterKey(Data?)

Sets the interface pairwise master key (PMK).

func setPower(Bool)

Sets the interface power state.

func setWLANChannel(CWChannel)

Sets the interface channel.

Getting an interface

init(interfaceName: String?)

Convenience method for getting an CWInterface object with the specified name.

Deprecated
init(name: String?)

An instance method for obtaining an CWInterface object.

Deprecated

Getting all attached interfaces

class func interfaceNames() -> Set<String>?

Returns the list of BSD names for WLAN interfaces available on the current system.

Deprecated

Disassociating from a network

func disassociate()

Disassociates from the current network.

Creating computer-to-computer networks

func startIBSSMode(withSSID: Data, security: CWIBSSModeSecurity, channel: Int, password: String?)

Creates a computer-to-computer (ad-hoc) network with the given network name, security type, and password on the specified channel.

Committing a configuration

func commitConfiguration(CWConfiguration, authorization: SFAuthorization?)

Commit a configuration for the given WLAN interface.

Associating to a network

func associate(to: CWNetwork, password: String?)

Associates to a given network using the given network passphrase.

Instance Properties

var interfaceName: String?

The BSD name of the interface.

Instance Methods

func activePHYMode() -> CWPHYMode

The current active PHY modes for the interface.

func bssid() -> String?

The current basic service set identifier (BSSID) for the interface, returned as a UTF-8 string.

func cachedScanResults() -> Set<CWNetwork>?

The networks currently in the scan cache for the WLAN interface.

func configuration() -> CWConfiguration?

The current configuration for the given WLAN interface.

func countryCode() -> String?

The current country code (ISO/IEC 3166-1:1997) for the interface.

func hardwareAddress() -> String?

The hardware media access control (MAC) address for the interface, returned as a UTF-8 string.

func interfaceMode() -> CWInterfaceMode

The current mode for the interface.

func noiseMeasurement() -> Int

The current aggregate noise measurement (dBm) for the interface.

func powerOn() -> Bool

The interface power state is set to "ON".

func rssiValue() -> Int

The current aggregate received signal strength indication (RSSI) measurement (dBm) for the interface.

func security() -> CWSecurity

The current security mode for the interface.

func serviceActive() -> Bool

The interface has its corresponding network service enabled.

func ssid() -> String?

The current service set identifier (SSID) for the interface, encoded as a string.

func ssidData() -> Data?

The current service set identifier (SSID) for the interface, returned as data.

func supportedWLANChannels() -> Set<CWChannel>?

An array of channels supported by the interface for the active country code.

func transmitPower() -> Int

The current transmit power (mW) for the interface.

func transmitRate() -> Double

The current transmit rate (Mbps) for the interface.

func wlanChannel() -> CWChannel?

The current channel for the interface.

Relationships

Inherits From

Conforms To