Platforms to show: All Mac Windows Linux Cross-Platform
CBPeripheralMBS class
Super class: CBPeerMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Bluetooth | MBS Bluetooth Plugin | 18.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Peripherals are identified by universally unique identifiers (UUIDs), represented by NSUUID objects. Peripherals may contain one or more services or provide useful information about their connected signal strength.
You use this class to discover, explore, and interact with the services available on a remote peripheral that supports Bluetooth low energy. A service encapsulates the way part of the device behaves. For example, one service of a heart rate monitor may be to expose heart rate data from the monitor’s heart rate sensor. Services themselves are made up of characteristics or included services (references to other services). Characteristics provide further details about a peripheral’s service. For example, the heart rate service just described may contain one characteristic that describes the intended body location of the device’s heart rate sensor and another characteristic that transmits heart rate measurement data. Finally, characteristics contain any number of descriptors that provide more information about the characteristic’s value, such as a human-readable description and a way to format the value.
Subclass of the CBPeerMBS class.
- 15 events
- event DidDiscoverCharacteristicsForService(service as CBServiceMBS, error as NSErrorMBS)
- event DidDiscoverDescriptorsForCharacteristic(characteristic as CBCharacteristicMBS, error as NSErrorMBS)
- event DidDiscoverIncludedServicesForService(service as CBServiceMBS, error as NSErrorMBS)
- event DidDiscoverServices(error as NSErrorMBS)
- event DidModifyServices(invalidatedServices() as CBServiceMBS)
- event DidOpenL2CAPChannel(channel as CBL2CAPChannelMBS, error as NSErrorMBS)
- event DidReadRSSI(RSSI as String, error as NSErrorMBS)
- event DidUpdateName
- event DidUpdateNotificationStateForCharacteristic(characteristic as CBCharacteristicMBS, error as NSErrorMBS)
- event DidUpdateRSSI(error as NSErrorMBS)
- event DidUpdateValueForCharacteristic(characteristic as CBCharacteristicMBS, error as NSErrorMBS)
- event DidUpdateValueForDescriptor(descriptor as CBDescriptorMBS, error as NSErrorMBS)
- event DidWriteValueForCharacteristic(characteristic as CBCharacteristicMBS, error as NSErrorMBS)
- event DidWriteValueForDescriptor(descriptor as CBDescriptorMBS, error as NSErrorMBS)
- event IsReadyToSendWriteWithoutResponse
- 4 properties
- property CanSendWriteWithoutResponse as Boolean
- property Name as String
- property RSSI as String
- property State as Integer
- 14 methods
- method Constructor(Peripheral as CBPeripheralMBS)
- method Destructor
- method discoverCharacteristics(characteristicUUIDs() as CBUUIDMBS = nil, service as CBServiceMBS)
- method discoverDescriptorsForCharacteristic(Characteristic as CBCharacteristicMBS)
- method discoverIncludedServices(includedServiceUUIDs() as CBUUIDMBS = nil, service as CBServiceMBS)
- method discoverServices(serviceUUIDs() as CBUUIDMBS = nil)
- method maximumWriteValueLengthForType(Type as Integer) as Integer
- method readRSSI
- method readValueForCharacteristic(Characteristic as CBCharacteristicMBS)
- method readValueForDescriptor(descriptor as CBDescriptorMBS)
- method services as CBServiceMBS()
- method setNotifyValue(enabled as Boolean, Characteristic as CBCharacteristicMBS)
- method writeValue(data as MemoryBlock, Characteristic as CBCharacteristicMBS, Type as Integer)
- method writeValue(data as MemoryBlock, Descriptor as CBDescriptorMBS)
- shared method Available as boolean
- 6 constants
Constants
Constant | Value | Description |
---|---|---|
kWriteWithoutResponse | 1 |
One of the constants to specify which type of write is to be performed on a CBCharacteristic.
Writes without response. |
kWriteWithResponse | 0 |
One of the constants to specify which type of write is to be performed on a CBCharacteristic.
Write with Response. |
States
Constant | Value | Description |
---|---|---|
kStateConnected | 2 |
The peripheral is currently connected to the central manager. |
kStateConnecting | 1 |
The peripheral is currently in the process of connecting to the central manager. |
kStateDisconnected | 0 |
The peripheral is currently not connected to the central manager. |
kStateDisconnecting | 3 |
The peripheral is currently in the process of disconnecting from the central manager. |
Super class CBPeerMBS
- 2 properties
- property Handle as Integer
- property identifier as String
- 2 methods
- method Constructor Private
- method copy as CBPeerMBS
- shared method Available as boolean
This class has no sub classes.
Some methods using this class:
- CBCentralManagerMBS.cancelPeripheralConnection(Peripheral as CBPeripheralMBS)
- CBCentralManagerMBS.connectPeripheral(peripheral as CBPeripheralMBS, options as Dictionary = nil)
- CBCentralManagerMBS.retrieveConnectedPeripheralsWithServices(serviceUUIDs() as CBUUIDMBS) as CBPeripheralMBS()
- CBCentralManagerMBS.retrievePeripheralsWithIdentifiers(identifiers() as NSUUIDMBS) as CBPeripheralMBS()
Some properties using for this class:
- CBServiceMBS.peripheral as CBPeripheralMBS
Some events using this class:
- CBCentralManagerMBS.DidConnectPeripheral(peripheral as CBPeripheralMBS)
- CBCentralManagerMBS.DidDisconnectPeripheral(peripheral as CBPeripheralMBS, error as NSErrorMBS)
- CBCentralManagerMBS.DidDiscoverPeripheral(peripheral as CBPeripheralMBS, advertisementData as Dictionary, RSSI as String)
- CBCentralManagerMBS.DidFailToConnectPeripheral(peripheral as CBPeripheralMBS, error as NSErrorMBS)
Some examples using this class:
Blog Entries
The items on this page are in the following plugins: MBS Bluetooth Plugin.
CBPeripheralManagerMBS - CBServiceMBS