<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreWLAN",
  "identifier" : "/documentation/CoreWLAN/CWInterface",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core WLAN"
    ],
    "preciseIdentifier" : "c:objc(cs)CWInterface"
  },
  "title" : "CWInterface"
}
-->

# CWInterface

Encapsulates an IEEE 802.11 interface.

```
class CWInterface
```

## Overview

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

> Important:
> Do not instantiate interface objects directly. Instead, use interface objects vended by a ``doc://com.apple.corewlan/documentation/CoreWLAN/CWWiFiClient`` instance via the ``doc://com.apple.corewlan/documentation/CoreWLAN/CWWiFiClient/interface()`` method or one of its relatives. This enables your app to adopt App Sandbox even when it uses CoreWLAN without the need for any special exceptions. Directly instantiating interface objects causes low level access to system sockets, which by default is not allowed in a sandboxed environment.

## Topics

### Setting interface parameters

[`setPairwiseMasterKey(_:)`](/documentation/CoreWLAN/CWInterface/setPairwiseMasterKey(_:))

Sets the interface pairwise primary key (PMK).

[`setPower(_:)`](/documentation/CoreWLAN/CWInterface/setPower(_:))

Sets the interface power state.

[`setWEPKey(_:flags:index:)`](/documentation/CoreWLAN/CWInterface/setWEPKey(_:flags:index:))

Sets the interface WEP key.

[`setWLANChannel(_:)`](/documentation/CoreWLAN/CWInterface/setWLANChannel(_:))

Sets the interface channel.

### Scanning for networks

[`scanForNetworks(withName:)`](/documentation/CoreWLAN/CWInterface/scanForNetworks(withName:))

Scans for networks.

[`scanForNetworks(withSSID:)`](/documentation/CoreWLAN/CWInterface/scanForNetworks(withSSID:))

Scans for networks.

### Getting an interface

[`init(interfaceName:)`](/documentation/CoreWLAN/CWInterface/init(interfaceName:))

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

[`interface`](/documentation/CoreWLAN/CWInterface/interface)

Convenience method for getting an CWInterface object for the default WLAN interface.

[`init(name:)`](/documentation/CoreWLAN/CWInterface/init(name:))

An instance method for obtaining an CWInterface object.

### Getting all attached interfaces

[`interfaceNames()`](/documentation/CoreWLAN/CWInterface/interfaceNames())

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

### Disassociating from a network

[`disassociate()`](/documentation/CoreWLAN/CWInterface/disassociate())

Disassociates from the current network.

### Creating computer-to-computer networks

[`startIBSSMode(withSSID:security:channel:password:)`](/documentation/CoreWLAN/CWInterface/startIBSSMode(withSSID:security:channel:password:))

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

### Committing a configuration

[`commitConfiguration(_:authorization:)`](/documentation/CoreWLAN/CWInterface/commitConfiguration(_:authorization:))

Commit a configuration for the given WLAN interface.

### Associating to a network

[`associate(toEnterpriseNetwork:identity:username:password:)`](/documentation/CoreWLAN/CWInterface/associate(toEnterpriseNetwork:identity:username:password:))

Connects to the given enterprise network.

[`associate(to:password:)`](/documentation/CoreWLAN/CWInterface/associate(to:password:))

Associates to a given network using the given network passphrase.

### Instance Properties

[`interfaceName`](/documentation/CoreWLAN/CWInterface/interfaceName)

The BSD name of the interface.

### Instance Methods

[`activePHYMode()`](/documentation/CoreWLAN/CWInterface/activePHYMode())

The current active PHY modes for the interface.

[`bssid()`](/documentation/CoreWLAN/CWInterface/bssid())

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

[`cachedScanResults()`](/documentation/CoreWLAN/CWInterface/cachedScanResults())

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

[`configuration()`](/documentation/CoreWLAN/CWInterface/configuration())

The current configuration for the given WLAN interface.

[`countryCode()`](/documentation/CoreWLAN/CWInterface/countryCode())

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

[`hardwareAddress()`](/documentation/CoreWLAN/CWInterface/hardwareAddress())

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

[`interfaceMode()`](/documentation/CoreWLAN/CWInterface/interfaceMode())

The current mode for the interface.

[`noiseMeasurement()`](/documentation/CoreWLAN/CWInterface/noiseMeasurement())

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

[`powerOn()`](/documentation/CoreWLAN/CWInterface/powerOn())

The interface power state is set to “ON”.

[`rssiValue()`](/documentation/CoreWLAN/CWInterface/rssiValue())

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

[`scanForNetworks(withName:includeHidden:)`](/documentation/CoreWLAN/CWInterface/scanForNetworks(withName:includeHidden:))

Scans for networks with the name you specify, optionally including hidden networks.

[`scanForNetworks(withSSID:includeHidden:)`](/documentation/CoreWLAN/CWInterface/scanForNetworks(withSSID:includeHidden:))

Scans for networks with the SSID you specify, optionally including hidden networks.

[`security()`](/documentation/CoreWLAN/CWInterface/security())

The current security mode for the interface.

[`serviceActive()`](/documentation/CoreWLAN/CWInterface/serviceActive())

The interface has its corresponding network service enabled.

[`ssid()`](/documentation/CoreWLAN/CWInterface/ssid())

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

[`ssidData()`](/documentation/CoreWLAN/CWInterface/ssidData())

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

[`supportedWLANChannels()`](/documentation/CoreWLAN/CWInterface/supportedWLANChannels())

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

[`transmitPower()`](/documentation/CoreWLAN/CWInterface/transmitPower())

The current transmit power (mW) for the interface.

[`transmitRate()`](/documentation/CoreWLAN/CWInterface/transmitRate())

The current transmit rate (Mbps) for the interface.

[`wlanChannel()`](/documentation/CoreWLAN/CWInterface/wlanChannel())

The current channel for the interface.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)