Platforms to show: All Mac Windows Linux Cross-Platform

CBCentralManagerMBS class

Super class: CBManagerMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Bluetooth MBS Bluetooth Plugin 18.1 ✅ Yes ❌ No ❌ No ✅ Yes All
CBCentralManager objects are used to manage discovered or connected remote peripheral devices (represented by CBPeripheral objects), including scanning for, discovering, and connecting to advertising peripherals.

Before you call CBCentralManager methods, the state of the central manager object must be powered on, as indicated by the CBCentralManagerStatePoweredOn constant. This state indicates that the central device (your iPhone or iPad, for instance) supports Bluetooth low energy and that Bluetooth is on and available to use.

Please build as 64-bit as 32-bit is no longer supported well by Apple.
Subclass of the CBManagerMBS class.

Att Errors

Constant Value Description
CBATTErrorAttributeNotFound &h0A The attribute is not found within the specified attribute handle range.
CBATTErrorAttributeNotLong &h0B The attribute cannot be read or written using the ATT read blob request.
CBATTErrorInsufficientAuthentication 5 The attribute requires authentication before its value can be read or written.
CBATTErrorInsufficientAuthorization 8 The attribute requires authorization before its value can be read or written.
CBATTErrorInsufficientEncryption &h0F The attribute requires encryption before its value can be read or written.
CBATTErrorInsufficientEncryptionKeySize &h0C The encryption key size used for encrypting this link is insufficient.
CBATTErrorInsufficientResources &h11 Resources are insufficient to complete the ATT request.
CBATTErrorInvalidAttributeValueLength &h0D The length of the attribute’s value is invalid for the intended operation.
CBATTErrorInvalidHandle 1 The attribute handle is invalid on this peripheral.
CBATTErrorInvalidOffset 7 The specified offset value was past the end of the attribute’s value.
CBATTErrorInvalidPdu 4 The attribute Protocol Data Unit (PDU) or “message” is invalid.
CBATTErrorPrepareQueueFull 9 The prepare queue is full, because too many prepare write requests have been queued.
CBATTErrorReadNotPermitted 2 The attribute’s value cannot be read.
CBATTErrorRequestNotSupported 6 The attribute server does not support the request received by the client.
CBATTErrorSuccess 0 The ATT command or request successfully completed.
CBATTErrorUnlikelyError &h0E The ATT request has encountered an unlikely error and therefore could not be completed.
CBATTErrorUnsupportedGroupType &h10 The attribute type is not a supported grouping attribute as defined by a higher-layer specification.
CBATTErrorWriteNotPermitted 3 The attribute’s value cannot be written.

States

Constant Value Description
CBCentralManagerStatePoweredOff 4 Bluetooth is currently powered off.
CBCentralManagerStatePoweredOn 5 Bluetooth is currently powered on and is available to use.
CBCentralManagerStateResetting 1 The connection with the system service was momentarily lost; an update is imminent.
CBCentralManagerStateUnauthorized 3 The app is not authorized to use the Bluetooth low energy peripheral/server role.
CBCentralManagerStateUnknown 0 The current state of the peripheral manager is unknown; an update is imminent.
CBCentralManagerStateUnsupported 2 The platform doesn't support the Bluetooth low energy peripheral/server role.

Errors

Constant Value Description
CBErrorAlreadyAdvertising 9 The peripheral is already advertising.
CBErrorConnectionFailed 10 The connection failed.
CBErrorConnectionLimitReached 11 The device already has the maximum number of connections.
CBErrorConnectionTimeout 6 The connection timed out.
CBErrorEncryptionTimedOut 15 Timeout in encryption.
CBErrorInvalidHandle 2 The specified attribute handle is invalid.
CBErrorInvalidParameters 1 The specified parameters are invalid.
CBErrorNotConnected 3 The device is not currently connected.
CBErrorOperationCancelled 5 The operation is canceled.
CBErrorOperationNotSupported 13 Operation not supported.
CBErrorOutOfSpace 4 The device has run out of space to complete the intended operation.
CBErrorPeerRemovedPairingInformation 14 Peer removed pairing information, e.g. pairing was reset on the other device.
CBErrorPeripheralDisconnected 7 The peripheral disconnected.
CBErrorTooManyLEPairedDevices 16 Too many paired devices for Bluetooth LE.
CBErrorUnknown 0 An unknown error occurred.
CBErrorUnkownDevice 12 Unknown device.
CBErrorUUIDNotAllowed 8 The specified UUID is not permitted.

Super class CBManagerMBS

Authorization States

Constant Value Description
kAuthorizationStatusAuthorized 3 This app is authorized to share data using Bluetooth services while in the background state.
kAuthorizationStatusDenied 2 The user explicitly denied this app from sharing data using Bluetooth services while in the background state.
kAuthorizationStatusNotDetermined 0 The user has not yet made a choice regarding whether this app can share data using Bluetooth services while in the background state.
kAuthorizationStatusRestricted 1 This app is not authorized to share data using Bluetooth services while in the background state. The user cannot change this app’s status, possibly due to active restrictions such as parental controls being in place.

States

Constant Value Description
kStatePoweredOff 4 Bluetooth is currently powered off.
kStatePoweredOn 5 Bluetooth is currently powered on and available to use.
kStateResetting 1 The connection with the system service was momentarily lost, update imminent.
kStateUnauthorized 3 The application is not authorized to use the Bluetooth Low Energy role.
kStateUnknown 0 State unknown, update imminent.
kStateUnsupported 2 The platform doesn't support the Bluetooth Low Energy Central/Client role.

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes


The items on this page are in the following plugins: MBS Bluetooth Plugin.


CBAttributeMBS   -   CBCentralMBS


The biggest plugin in space...