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

# peripheralManager(_:didPublishL2CAPChannel:error:)

Tells the delegate that the peripheral manager created a listener for incoming L2CAP channel connections.

```
optional func peripheralManager(_ peripheral: CBPeripheralManager, didPublishL2CAPChannel PSM: CBL2CAPPSM, error: (any Error)?)
```

## Parameters

`peripheral`

The peripheral manager that published the channel.

`PSM`

The Protocol/Service Multiplexer (PSM) of the published channel.

`error`

The error that prevented publishing, or `nil` if no error occurred.

## Discussion

The peripheral manager calls this method after you call [`publishL2CAPChannel(withEncryption:)`](/documentation/CoreBluetooth/CBPeripheralManager/publishL2CAPChannel(withEncryption:)). The `PSM` parameter contains the PSM assigned for the published channel.

---

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)