core_bluetooth
A clean Dart wrapper around Apple's CoreBluetooth framework for iOS and macOS.
Status
Early scaffold.
Apple CoreBluetooth symbol names are the primary public API. Helper wrapper
types exist where Dart needs them, but they intentionally do not use the CB
prefix.
Contract
Below is the CoreBluetooth API map we should treat as the contract.
Legend:
✅fully implemented⏳partially implemented⬜not implemented yet
Only mark a symbol ✅ when its public API is fully implemented to match the
Apple CoreBluetooth surface we intend to mirror.
Top-Level Framework
⬜CBManager⬜CBPeer⬜CBUUID⬜CBError⬜CBATTRequest⬜CBL2CAPChannel⬜CBL2CAPPSM
Central Role
⏳CBCentralManager⬜CBCentralManagerDelegate⬜CBCentral⬜CBConnectionEvent
CBCentralManager
⬜init()⬜init(delegate:queue:)⬜init(delegate:queue:options:)⬜var delegate⏳var isScanning⏳class func supports(_ feature: CBCentralManager.Feature) -> Bool⏳struct CBCentralManager.Feature⏳func scanForPeripherals(withServices:options:)⏳func stopScan()⏳func retrievePeripherals(withIdentifiers:)⏳func retrieveConnectedPeripherals(withServices:)⏳func connect(_:options:)⏳func cancelPeripheralConnection(_:)⬜func registerForConnectionEvents(options:)⏳class var authorization⏳inherited fromCBManager:var state
CBCentralManagerDelegate
⬜centralManagerDidUpdateState(_:)⬜centralManager(_:willRestoreState:)⬜centralManager(_:didDiscover:advertisementData:rssi:)⬜centralManager(_:didConnect:)⬜centralManager(_:didFailToConnect:error:)⬜centralManager(_:didDisconnectPeripheral:error:)⬜centralManager(_:didDisconnectPeripheral:timestamp:isReconnecting:error:)⬜centralManager(_:connectionEventDidOccur:for:)⬜centralManager(_:didUpdateANCSAuthorizationFor:)
CBCentral
⬜inheritsCBPeer⬜var maximumUpdateValueLength
Peripheral Role
⏳CBPeripheral⬜CBPeripheralDelegate⬜CBPeripheralManager⬜CBPeripheralManagerDelegate
CBPeripheral
⬜var delegate⬜var name⬜var identifier⏳var state⏳var services⬜var canSendWriteWithoutResponse⏳func readRSSI()⏳func discoverServices(_:)⬜func discoverIncludedServices(_:for:)⏳func discoverCharacteristics(_:for:)⬜func discoverDescriptors(for:)⏳func readValue(for: CBCharacteristic)⬜func readValue(for: CBDescriptor)⏳func writeValue(_:for: CBCharacteristic,type:)⬜func writeValue(_:for: CBDescriptor)⏳func setNotifyValue(_:for:)⬜func maximumWriteValueLength(for:)⬜func openL2CAPChannel(_:)
CBPeripheralDelegate
⬜peripheralDidUpdateName(_:)⬜peripheral(_:didModifyServices:)⬜peripheral(_:didReadRSSI:error:)⬜peripheral(_:didDiscoverServices:)⬜peripheral(_:didDiscoverIncludedServicesFor:error:)⬜peripheral(_:didDiscoverCharacteristicsFor:error:)⬜peripheral(_:didDiscoverDescriptorsFor:error:)⬜peripheral(_:didUpdateValueFor:error:)forCBCharacteristic⬜peripheral(_:didUpdateValueFor:error:)forCBDescriptor⬜peripheral(_:didWriteValueFor:error:)forCBCharacteristic⬜peripheral(_:didWriteValueFor:error:)forCBDescriptor⬜peripheral(_:didUpdateNotificationStateFor:error:)⬜peripheralIsReady(toSendWriteWithoutResponse:)⬜peripheral(_:didOpen:error:)
CBPeripheralManager
⬜init()⬜init(delegate:queue:)⬜init(delegate:queue:options:)⬜var delegate⬜var isAdvertising⬜func add(_:)⬜func remove(_:)⬜func removeAllServices()⬜func startAdvertising(_:)⬜func stopAdvertising()⬜func updateValue(_:for:onSubscribedCentrals:) -> Bool⬜func respond(to:withResult:)⬜func setDesiredConnectionLatency(_:for:)⬜func publishL2CAPChannel(withEncryption:)⬜func unpublishL2CAPChannel(_:)⬜class var authorization⬜inherited fromCBManager:var state
CBPeripheralManagerDelegate
⬜peripheralManagerDidUpdateState(_:)⬜peripheralManager(_:willRestoreState:)⬜peripheralManagerDidStartAdvertising(_:error:)⬜peripheralManager(_:didAdd:error:)⬜peripheralManager(_:central:didSubscribeTo:)⬜peripheralManager(_:central:didUnsubscribeFrom:)⬜peripheralManagerIsReady(toUpdateSubscribers:)⬜peripheralManager(_:didReceiveRead:)⬜peripheralManager(_:didReceiveWrite:)⬜peripheralManager(_:didPublishL2CAPChannel:error:)⬜peripheralManager(_:didUnpublishL2CAPChannel:error:)⬜peripheralManager(_:didOpen:error:)
GATT Model Types
⏳CBAttribute⏳CBService⬜CBMutableService⏳CBCharacteristic⬜CBMutableCharacteristic⬜CBDescriptor⬜CBMutableDescriptor
CBAttribute
⬜var uuid
CBService
⬜var peripheral⏳var isPrimary⬜var includedServices⏳var characteristics
CBMutableService
⬜writable versions of service properties
CBCharacteristic
⬜var service⏳var value⬜var descriptors⬜var properties⏳var isNotifying⬜var isBroadcasted
CBMutableCharacteristic
⬜init(type:properties:value:permissions:)
CBDescriptor
⬜var characteristic⬜var value
CBMutableDescriptor
⬜init(type:value:)
Supporting Enums / Option Sets / Constants
✅CBManagerState✅CBManagerAuthorization✅CBPeripheralState✅CBCharacteristicWriteType⏳CBCentralManager.Feature⬜CBCharacteristicProperties⬜CBAttributePermissions⬜CBPeripheralManagerConnectionLatency⬜CBATTError.Code⬜advertisement-data keys⬜peripheral-scanning option keys⬜peripheral-connection option keys⬜peripheral-manager initialization option keys⬜peripheral-manager restoration keys⬜central-manager restoration keys⬜connection-event matching option keys