---
title: "setPower(_:)"
framework: corewlan
role: symbol
role_heading: Instance Method
path: "corewlan/cwinterface/setpower(_:)"
---

# setPower(_:)

Sets the interface power state.

## Declaration

```swift
func setPower(_ power: Bool) throws
```

## Parameters

- `power`: A Boolean value corresponding to the power state. NO indicates the “OFF” state.

## Discussion

Discussion This operation may require an administrator password. note: In Swift, this method returns Void and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Setting interface parameters

- [setPairwiseMasterKey(_:)](corewlan/cwinterface/setpairwisemasterkey(_:).md)
- [setWEPKey(_:flags:index:)](corewlan/cwinterface/setwepkey(_:flags:index:).md)
- [setWLANChannel(_:)](corewlan/cwinterface/setwlanchannel(_:).md)
