Core Bluetooth Constants Reference

Framework
/System/Library/Frameworks/CoreBluetooth.framework
Companion guide
Declared in
CBError.h

Overview

This document describes the constants found in the Core Bluetooth framework.

Constants

Core Bluetooth Error Domain

The domain for Core Bluetooth errors.

NSString *const CBErrorDomain;
Constants
CBErrorDomain

The domain for Core Bluetooth errors. This value is used in the NSError class.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBError Constants

The possible errors returned during Bluetooth low energy transactions.

typedef enum {
   CBErrorUnknown = 0,
   CBErrorInvalidParameters = 1,
   CBErrorInvalidHandle = 2,
   CBErrorNotConnected = 3,
   CBErrorOutOfSpace = 4,
   CBErrorOperationCancelled = 5,
   CBErrorConnectionTimeout = 6,
   CBErrorPeripheralDisconnected = 7,
   CBErrorUUIDNotAllowed = 8,
   CBErrorAlreadyAdvertising = 9,
   CBErrorConnectionFailed = 10
} CBError;
Constants
CBErrorUnknown

An unknown error occurred.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBErrorInvalidParameters

The specified parameters are invalid.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorInvalidHandle

The specified attribute handle is invalid.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorNotConnected

The device is not currently connected.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorOutOfSpace

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

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorOperationCancelled

The operation is canceled.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorConnectionTimeout

The connection timed out.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorPeripheralDisconnected

The peripheral disconnected.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorUUIDNotAllowed

The specified UUID is not permitted.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorAlreadyAdvertising

The peripheral is already advertising.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBErrorConnectionFailed

The connection failed.

Available in iOS 7.1 and later.

Declared in CBError.h.

Core Bluetooth Attribute Protocol (ATT) Error Domain

The domain for Core Bluetooth ATT errors.

NSString *const CBATTErrorDomain;
Constants
CBATTErrorDomain

The domain for Core Bluetooth ATT errors. This value is used in the NSError class.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTError Constants

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

typedef enum {
   CBATTErrorSuccess = 0x00,
   CBATTErrorInvalidHandle = 0x01,
   CBATTErrorReadNotPermitted = 0x02,
   CBATTErrorWriteNotPermitted = 0x03,
   CBATTErrorInvalidPdu = 0x04,
   CBATTErrorInsufficientAuthentication = 0x05,
   CBATTErrorRequestNotSupported = 0x06,
   CBATTErrorInvalidOffset = 0x07,
   CBATTErrorInsufficientAuthorization = 0x08,
   CBATTErrorPrepareQueueFull = 0x09,
   CBATTErrorAttributeNotFound = 0x0A,
   CBATTErrorAttributeNotLong = 0x0B,
   CBATTErrorInsufficientEncryptionKeySize = 0x0C,
   CBATTErrorInvalidAttributeValueLength = 0x0D,
   CBATTErrorUnlikelyError = 0x0E,
   CBATTErrorInsufficientEncryption = 0x0F,
   CBATTErrorUnsupportedGroupType = 0x10,
   CBATTErrorInsufficientResources = 0x11,
} CBATTError;
Constants
CBATTErrorSuccess

The ATT command or request successfully completed.

Available in iOS 6.0 and later.

Declared in CBError.h.

CBATTErrorInvalidHandle

The attribute handle is invalid on this peripheral.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorReadNotPermitted

The attribute’s value cannot be read.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorWriteNotPermitted

The attribute’s value cannot be written.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInvalidPdu

The attribute Protocol Data Unit (PDU) or “message” is invalid.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInsufficientAuthentication

The attribute requires authentication before its value can be read or written.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorRequestNotSupported

The attribute server does not support the request received by the client.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInvalidOffset

The specified offset value was past the end of the attribute’s value.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInsufficientAuthorization

The attribute requires authorization before its value can be read or written.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorPrepareQueueFull

The prepare queue is full, because too many prepare write requests have been queued.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorAttributeNotFound

The attribute is not found within the specified attribute handle range.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorAttributeNotLong

The attribute cannot be read or written using the ATT read blob request.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInsufficientEncryptionKeySize

The encryption key size used for encrypting this link is insufficient.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInvalidAttributeValueLength

The length of the attribute’s value is invalid for the intended operation.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorUnlikelyError

The ATT request has encountered an unlikely error and therefore could not be completed.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInsufficientEncryption

The attribute requires encryption before its value can be read or written.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorUnsupportedGroupType

The attribute type is not a supported grouping attribute as defined by a higher-layer specification.

Available in iOS 5.0 and later.

Declared in CBError.h.

CBATTErrorInsufficientResources

Resources are insufficient to complete the ATT request.

Available in iOS 5.0 and later.

Declared in CBError.h.

Discussion

These error constants are based on the Bluetooth ATT error codes, defined in the Bluetooth 4.0 specification. For more information about these errors, see the Bluetooth 4.0 specification, Volume 3, Part F, Section 3.4.1.1.