---
title: "peripheralManager(_:didOpen:error:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheralmanagerdelegate/peripheralmanager(_:didopen:error:)"
---

# peripheralManager(_:didOpen:error:)

Tells the delegate that the peripheral manager opened an L2CAP channel.

## Declaration

```swift
optional func peripheralManager(_ peripheral: CBPeripheralManager, didOpen channel: CBL2CAPChannel?, error: (any Error)?)
```

## Parameters

- `peripheral`: The peripheral manager that opened the channel.
- `channel`: The channel opened by the manager.
- `error`: The error that occurred, or nil if no error occurred.

## Discussion

Discussion The peripheral manager calls this method after you call publishL2CAPChannel(withEncryption:).

## See Also

### Using L2CAP Channels

- [peripheralManager(_:didPublishL2CAPChannel:error:)](corebluetooth/cbperipheralmanagerdelegate/peripheralmanager(_:didpublishl2capchannel:error:).md)
- [peripheralManager(_:didUnpublishL2CAPChannel:error:)](corebluetooth/cbperipheralmanagerdelegate/peripheralmanager(_:didunpublishl2capchannel:error:).md)
