<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreBluetooth",
  "identifier" : "/documentation/CoreBluetooth/CBError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Bluetooth"
    ],
    "preciseIdentifier" : "c:@E@CBError"
  },
  "title" : "CBError.Code"
}
-->

# CBError.Code

The codes for errors that Core Bluetooth returns during Bluetooth transactions.

```
enum Code
```

## Topics

### Error Codes

[`CBError.Code.unknown`](/documentation/CoreBluetooth/CBError-swift.struct/Code/unknown)

An unknown error occurred.

[`CBError.Code.invalidParameters`](/documentation/CoreBluetooth/CBError-swift.struct/Code/invalidParameters)

The specified parameters are invalid.

[`CBError.Code.invalidHandle`](/documentation/CoreBluetooth/CBError-swift.struct/Code/invalidHandle)

The specified attribute handle is invalid.

[`CBError.Code.notConnected`](/documentation/CoreBluetooth/CBError-swift.struct/Code/notConnected)

The device isn’t currently connected.

[`CBError.Code.outOfSpace`](/documentation/CoreBluetooth/CBError-swift.struct/Code/outOfSpace)

The device has run out of space to complete the intended operation.

[`CBError.Code.operationCancelled`](/documentation/CoreBluetooth/CBError-swift.struct/Code/operationCancelled)

The error represents a canceled operation.

[`CBError.Code.connectionTimeout`](/documentation/CoreBluetooth/CBError-swift.struct/Code/connectionTimeout)

The connection timed out.

[`CBError.Code.peripheralDisconnected`](/documentation/CoreBluetooth/CBError-swift.struct/Code/peripheralDisconnected)

The peripheral disconnected.

[`CBError.Code.uuidNotAllowed`](/documentation/CoreBluetooth/CBError-swift.struct/Code/uuidNotAllowed)

The specified UUID isn’t permitted.

[`CBError.Code.alreadyAdvertising`](/documentation/CoreBluetooth/CBError-swift.struct/Code/alreadyAdvertising)

The peripheral is already advertising.

[`CBError.Code.connectionFailed`](/documentation/CoreBluetooth/CBError-swift.struct/Code/connectionFailed)

The connection failed.

[`CBError.Code.connectionLimitReached`](/documentation/CoreBluetooth/CBError-swift.struct/Code/connectionLimitReached)

The device already has the maximum number of connections.

[`CBError.Code.operationNotSupported`](/documentation/CoreBluetooth/CBError-swift.struct/Code/operationNotSupported)

The operation isn’t supported.

[`unknownDevice`](/documentation/CoreBluetooth/CBError-swift.struct/Code/unknownDevice)

The device is unknown.

[`CBErrorUnknownDevice`](/documentation/CoreBluetooth/CBError-c.enum/CBErrorUnknownDevice)

The device is unknown.

[`CBError.Code.unkownDevice`](/documentation/CoreBluetooth/CBError-swift.struct/Code/unkownDevice)

A misspelled version of the unknown device error code.



---

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)