Crate objc2_core_bluetooth

Source
Expand description

§Bindings to the CoreBluetooth framework

See Apple’s docs and the general docs on framework crates for more information.

Structs§

CBATTErrorCBError
Apple’s documentation
CBATTRequestCBATTRequest
Represents a read or write request from a central.
CBAttributeCBAttribute
Apple’s documentation
CBAttributePermissionsCBCharacteristic
Read, write, and encryption permissions for an ATT attribute. Can be combined.
CBCentralCBCentral and CBPeer
Represents a remote central.
CBCentralManagerCBCentralManager and CBManager
Entry point to the central role. Commands should only be issued when its state is CBCentralManagerStatePoweredOn .
CBCentralManagerFeatureCBCentralManager
The set of device specific features.
CBCentralManagerStateDeprecatedCBCentralManager
Represents the current state of a CBCentralManager.
CBCharacteristicCBAttribute and CBCharacteristic
Represents a service’s characteristic.
CBCharacteristicPropertiesCBCharacteristic
Characteristic properties determine how the characteristic value can be used, or how the descriptor(s) can be accessed. Can be combined. Unless otherwise specified, properties are valid for local characteristics published via
CBCharacteristicWriteTypeCBPeripheral
Specifies which type of write is to be performed on a CBCharacteristic.
CBConnectionEventCBCentralManager
Represents the connection state of a peer.
CBDescriptorCBAttribute and CBDescriptor
Represents a characteristic’s descriptor.
CBErrorCBError
The possible errors returned during LE transactions.
CBL2CAPChannelCBL2CAPChannel
A CBL2CAPChannel represents a live L2CAP connection to a remote device
CBManagerCBManager
Apple’s documentation
CBManagerAuthorizationCBManager
Represents the current authorization state of a CBManager.
CBManagerStateCBManager
Represents the current state of a CBManager.
CBMutableCharacteristicCBAttribute and CBCharacteristic
Used to create a local characteristic, which can be added to the local database via CBPeripheralManager . Once a characteristic is published, it is cached and can no longer be changed. If a characteristic value is specified, it will be cached and marked CBCharacteristicPropertyRead and CBAttributePermissionsReadable . If a characteristic value needs to be writeable, or may change during the lifetime of the published CBService , it is considered a dynamic value and will be requested on-demand. Dynamic values are identified by a value of nil .
CBMutableDescriptorCBAttribute and CBDescriptor
Used to create a local characteristic descriptor, which can be added to the local database via CBPeripheralManager . Once a descriptor is published, it is cached and can no longer be changed. Descriptor types are detailed in
CBMutableServiceCBAttribute and CBService
Used to create a local service or included service, which can be added to the local database via CBPeripheralManager . Once a service is published, it is cached and can no longer be changed. This class adds write access to all properties in the
CBPeerCBPeer
Apple’s documentation
CBPeripheralCBPeer and CBPeripheral
Represents a peripheral.
CBPeripheralManagerCBManager and CBPeripheralManager
The CBPeripheralManager class is an abstraction of the Peripheral and Broadcaster GAP roles, and the GATT Server role. Its primary function is to allow you to manage published services within the GATT database, and to advertise these services to other devices. Each application has sandboxed access to the shared GATT database. You can add services to the database by calling {
CBPeripheralManagerAuthorizationStatusDeprecatedCBPeripheralManager
Represents the current state of a CBPeripheralManager.
CBPeripheralManagerConnectionLatencyCBPeripheralManager
The latency of a peripheral-central connection controls how frequently messages can be exchanged.
CBPeripheralManagerStateDeprecatedCBPeripheralManager
Represents the current state of a CBPeripheralManager.
CBPeripheralStateCBPeripheral
Represents the current connection state of a CBPeripheral.
CBServiceCBAttribute and CBService
Represents a peripheral’s service or a service’s included service.
CBUUIDCBUUID
A 16-bit, 32-bit, or 128-bit Bluetooth UUID. 16-bit and 32-bit UUIDs are implicitly pre-filled with the Bluetooth Base UUID.

Statics§

CBATTErrorDomainCBError
Apple’s documentation
CBAdvertisementDataIsConnectableCBAdvertisementData
An NSNumber (Boolean) indicating whether or not the advertising event type was connectable. This can be used to determine whether or not a peripheral is connectable in that instant.
CBAdvertisementDataLocalNameKeyCBAdvertisementData
A NSString containing the local name of a peripheral.
CBAdvertisementDataManufacturerDataKeyCBAdvertisementData
A NSData object containing the manufacturer data of a peripheral.
CBAdvertisementDataOverflowServiceUUIDsKeyCBAdvertisementData
A list of one or more CBUUID objects, representing CBService UUIDs that were found in the “overflow” area of the advertising data. Due to the nature of the data stored in this area, UUIDs listed here are “best effort” and may not always be accurate.
CBAdvertisementDataServiceDataKeyCBAdvertisementData
A dictionary containing service-specific advertisement data. Keys are CBUUID objects, representing CBService UUIDs. Values are NSData objects.
CBAdvertisementDataServiceUUIDsKeyCBAdvertisementData
A list of one or more CBUUID objects, representing CBService UUIDs.
CBAdvertisementDataSolicitedServiceUUIDsKeyCBAdvertisementData
A list of one or more CBUUID objects, representing CBService UUIDs.
CBAdvertisementDataTxPowerLevelKeyCBAdvertisementData
A NSNumber containing the transmit power of a peripheral.
CBCentralManagerOptionDeviceAccessForMediaCBCentralManagerConstants
A Boolean representing the CBCentralManager init purpose is for DeviceAccess for media only. This will limit the functionality of this manager and only allow media device access without prompting the user for Bluetooth generic TCC.
CBCentralManagerOptionRestoreIdentifierKeyCBCentralManagerConstants
An NSString containing a unique identifier (UID) for the CBCentralManager that is being instantiated. This UID is used by the system to identify a specific CBCentralManager instance for restoration and, therefore, must remain the same for subsequent application executions in order for the manager to be restored.
CBCentralManagerOptionShowPowerAlertKeyCBCentralManagerConstants
An NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when CBCentralManager is instantiated, display a warning dialog to the user.
CBCentralManagerRestoredStatePeripheralsKeyCBCentralManagerConstants
An NSArray of CBPeripheral objects containing all peripherals that were connected or pending connection at the time the application was terminated by the system. When possible, all known information for each peripheral will be restored, including any discovered services, characteristics and descriptors, as well as characteristic notification states.
CBCentralManagerRestoredStateScanOptionsKeyCBCentralManagerConstants
An NSDictionary containing the scan options at the time the application was terminated by the system.
CBCentralManagerRestoredStateScanServicesKeyCBCentralManagerConstants
An NSArray of CBUUID objects containing the service(s) being scanned for at the time the application was terminated by the system.
CBCentralManagerScanOptionAllowDuplicatesKeyCBCentralManagerConstants
An NSNumber (Boolean) indicating that the scan should run without duplicate filtering. By default, multiple discoveries of the same peripheral are coalesced into a single discovery event. Specifying this option will cause a discovery event to be generated every time the peripheral is seen, which may be many times per second. This can be useful in specific situations, such as making a connection based on a peripheral’s RSSI, but may have an adverse affect on battery-life and application performance.
CBCentralManagerScanOptionSolicitedServiceUUIDsKeyCBCentralManagerConstants
An NSArray of CBUUID objects respresenting service UUIDs. Causes the scan to also look for peripherals soliciting any of the services contained in the list.
CBConnectPeripheralOptionEnableAutoReconnectCBCentralManagerConstants
An NSNumber (Boolean) indicating that the AutoReconnect is enabled for the peripheral is connected. After peripheral device is connected, this will allow the system to initiate connect to the peer device automatically when link is dropped. Caller will get notified about the disconnection with potential delay via {
CBConnectPeripheralOptionEnableTransportBridgingKeyCBCentralManagerConstants
An NSNumber (Boolean) indicating that the system will bring up classic transport profiles when low energy transport for peripheral is connected.
CBConnectPeripheralOptionNotifyOnConnectionKeyCBCentralManagerConstants
An NSNumber (Boolean) indicating that the system should display a connection alert for a given peripheral, if the application is suspended when a successful connection is made. This is useful for applications that have not specified the bluetooth-central background mode and cannot display their own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground will receive the alert.
CBConnectPeripheralOptionNotifyOnDisconnectionKeyCBCentralManagerConstants
An NSNumber (Boolean) indicating that the system should display a disconnection alert for a given peripheral, if the application is suspended at the time of the disconnection. This is useful for applications that have not specified the bluetooth-central background mode and cannot display their own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground will receive the alert.
CBConnectPeripheralOptionNotifyOnNotificationKeyCBCentralManagerConstants
An NSNumber (Boolean) indicating that the system should display an alert for all notifications received from a given peripheral, if the application is suspended at the time. This is useful for applications that have not specified the bluetooth-central background mode and cannot display their own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground will receive the alert.
CBConnectPeripheralOptionRequiresANCSCBCentralManagerConstants
An NSNumber (Boolean) indicating that the ANCS (Apple Notification Center Service) is required for the peripheral is connected.
CBConnectPeripheralOptionStartDelayKeyCBCentralManagerConstants
An NSNumber indicating the number of seconds for the system to wait before starting a connection.
CBConnectionEventMatchingOptionPeripheralUUIDsCBCentralManagerConstants
An NSArray of NSUUID objects respresenting peripheral identifiers. A connected peer with any matching identifier(s) will result in a call to {
CBConnectionEventMatchingOptionServiceUUIDsCBCentralManagerConstants
An NSArray of CBUUID objects respresenting service UUIDs. A connected peer with any matching service UUIDs will result in a call to {
CBErrorDomainCBError
Apple’s documentation
CBPeripheralManagerOptionRestoreIdentifierKeyCBPeripheralManagerConstants
An NSString containing a unique identifier (UID) for the CBPeripheralManager that is being instantiated. This UID is used by the system to identify a specific CBPeripheralManager instance for restoration and, therefore, must remain the same for subsequent application executions in order for the manager to be restored.
CBPeripheralManagerOptionShowPowerAlertKeyCBPeripheralManagerConstants
An NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when CBPeripheralManager is instantiated, display a warning dialog to the user.
CBPeripheralManagerRestoredStateAdvertisementDataKeyCBPeripheralManagerConstants
An NSDictionary containing the data being advertised at the time the application was terminated by the system.
CBPeripheralManagerRestoredStateServicesKeyCBPeripheralManagerConstants
An NSArray of CBMutableService objects containing all services that were published to the local database at the time the application was terminated by the system. All information for each service will be restored, including all discovered services, characteristics and descriptors, as well as characteristic notification states.
CBUUIDCharacteristicAggregateFormatStringCBUUID
The string representation of the UUID for the aggregate descriptor.
CBUUIDCharacteristicExtendedPropertiesStringCBUUID
The string representation of the UUID for the extended properties descriptor. The corresponding value for this descriptor is an NSNumber object.
CBUUIDCharacteristicFormatStringCBUUID
The string representation of the UUID for the presentation format descriptor. The corresponding value for this descriptor is an NSData object.
CBUUIDCharacteristicObservationScheduleStringCBUUID
Data representing the observation schedule for a characteristic.
CBUUIDCharacteristicUserDescriptionStringCBUUID
The string representation of the UUID for the user description descriptor. The corresponding value for this descriptor is an NSString object.
CBUUIDCharacteristicValidRangeStringCBUUID
Data representing the valid min/max values accepted for a characteristic.
CBUUIDClientCharacteristicConfigurationStringCBUUID
The string representation of the UUID for the client configuration descriptor. The corresponding value for this descriptor is an NSNumber object.
CBUUIDL2CAPPSMCharacteristicStringCBUUID
The PSM (a little endian uint16_t) of an L2CAP Channel associated with the GATT service containing this characteristic. Servers can publish this characteristic with the UUID ABDD3056-28FA-441D-A470-55A75A52553A
CBUUIDServerCharacteristicConfigurationStringCBUUID
The string representation of the UUID for the server configuration descriptor. The corresponding value for this descriptor is an NSNumber object.

Traits§

CBCentralManagerDelegateCBCentralManager
The delegate of a {
CBPeripheralDelegateCBPeripheral
Delegate for CBPeripheral.
CBPeripheralManagerDelegateCBPeripheralManager
The delegate of a

Type Aliases§

CBConnectionEventMatchingOptionCBCentralManagerConstants
Apple’s documentation
CBL2CAPPSMCBL2CAPChannel
Apple’s documentation