---
title: CBATTError.Code
framework: corebluetooth
role: symbol
role_heading: Enumeration
path: corebluetooth/cbatterror-swift.struct/code
---

# CBATTError.Code

The possible errors returned by a GATT server (a remote peripheral) during Bluetooth low energy ATT transactions.

## Declaration

```swift
enum Code
```

## Overview

Overview These error constants derive from the Bluetooth ATT error codes, defined in the Bluetooth 4.0 specification. For more information, see the Bluetooth 4.0 specification, Volume 3, Part F, Section 3.4.1.1.

## Topics

### Error Codes

- [CBATTError.Code.success](corebluetooth/cbatterror-swift.struct/code/success.md)
- [CBATTError.Code.invalidHandle](corebluetooth/cbatterror-swift.struct/code/invalidhandle.md)
- [CBATTError.Code.readNotPermitted](corebluetooth/cbatterror-swift.struct/code/readnotpermitted.md)
- [CBATTError.Code.writeNotPermitted](corebluetooth/cbatterror-swift.struct/code/writenotpermitted.md)
- [CBATTError.Code.invalidPdu](corebluetooth/cbatterror-swift.struct/code/invalidpdu.md)
- [CBATTError.Code.insufficientAuthentication](corebluetooth/cbatterror-swift.struct/code/insufficientauthentication.md)
- [CBATTError.Code.requestNotSupported](corebluetooth/cbatterror-swift.struct/code/requestnotsupported.md)
- [CBATTError.Code.invalidOffset](corebluetooth/cbatterror-swift.struct/code/invalidoffset.md)
- [CBATTError.Code.insufficientAuthorization](corebluetooth/cbatterror-swift.struct/code/insufficientauthorization.md)
- [CBATTError.Code.prepareQueueFull](corebluetooth/cbatterror-swift.struct/code/preparequeuefull.md)
- [CBATTError.Code.attributeNotFound](corebluetooth/cbatterror-swift.struct/code/attributenotfound.md)
- [CBATTError.Code.attributeNotLong](corebluetooth/cbatterror-swift.struct/code/attributenotlong.md)
- [CBATTError.Code.insufficientEncryptionKeySize](corebluetooth/cbatterror-swift.struct/code/insufficientencryptionkeysize.md)
- [CBATTError.Code.invalidAttributeValueLength](corebluetooth/cbatterror-swift.struct/code/invalidattributevaluelength.md)
- [CBATTError.Code.unlikelyError](corebluetooth/cbatterror-swift.struct/code/unlikelyerror.md)
- [CBATTError.Code.insufficientEncryption](corebluetooth/cbatterror-swift.struct/code/insufficientencryption.md)
- [CBATTError.Code.unsupportedGroupType](corebluetooth/cbatterror-swift.struct/code/unsupportedgrouptype.md)
- [CBATTError.Code.insufficientResources](corebluetooth/cbatterror-swift.struct/code/insufficientresources.md)

### Initializers

- [init(rawValue:)](corebluetooth/cbatterror-swift.struct/code/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Errors

- [CBError](corebluetooth/cberror-swift.struct.md)
- [CBErrorDomain](corebluetooth/cberrordomain.md)
- [CBError.Code](corebluetooth/cberror-swift.struct/code.md)
- [CBATTError](corebluetooth/cbatterror-swift.struct.md)
- [CBATTErrorDomain](corebluetooth/cbatterrordomain.md)
- [CBATTError](corebluetooth/cbatterror-swift.struct.md)
