<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreBluetooth",
  "identifier" : "/documentation/CoreBluetooth/CBPeripheralManagerDelegate/peripheralManager(_:didOpen:error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "c:objc(pl)CBPeripheralManagerDelegate(im)peripheralManager:didOpenL2CAPChannel:error:"
  },
  "title" : "peripheralManager(_:didOpen:error:)"
}
-->

# peripheralManager(_:didOpen:error:)

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

```
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

The peripheral manager calls this method after you call [`publishL2CAPChannel(withEncryption:)`](/documentation/CoreBluetooth/CBPeripheralManager/publishL2CAPChannel(withEncryption:)).

---

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)