Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
|
Implementation of CBCentralManagerDelegate protocol. Stores and notifies of discovered Bluetooth Low Energy (BLE) peripherals, also notifies of peripherals connection events and of the host device Bluetooth radio state changes. More...
#include <SGBleCentralManagerDelegate.h>
Instance Methods | |
(instancetype) | - initWithStateUpdateHandler: |
Initializes a SGBleCentralManagerDelegate instance with a Bluetooth state update handler. | |
(void) | - clearPeripherals |
Clear the list of discovered peripherals. | |
(nullable CBPeripheral *) | - peripheralForIdentifier: |
Gets the discovered CBPeripheral for the given UUID. | |
(void) | - setConnectionEventHandler:forPeripheral: |
Sets the handler for notifying of the given peripheral's connection events. | |
Properties | |
CBCentralManager * | centralManager |
Gets the central manager associated with this instance. | |
SGBlePeripheralDiscoveryHandler | peripheralDiscoveryHandler |
Gets or set the handler for notifying of discovered peripherals. | |
NSArray< CBPeripheral * > * | peripherals |
Gets the list of discovered peripherals. | |
bool | isBluetoothOn |
Indicates whether the host device Bluetooth radio is turned on and accessible. | |
Implementation of CBCentralManagerDelegate protocol. Stores and notifies of discovered Bluetooth Low Energy (BLE) peripherals, also notifies of peripherals connection events and of the host device Bluetooth radio state changes.
Upon SGBleCentralManagerDelegate initialization, an instance of this class creates a CBCentralManager object and set itself as the manager's delegate. The central manager is available through the centralManager property.
- (instancetype) initWithStateUpdateHandler: | (nullable void(^)(CBManagerState state)) | stateUpdateHandler |
Initializes a SGBleCentralManagerDelegate instance with a Bluetooth state update handler.
Creates a CBCentralManager object and set itself as the manager's delegate. The manager is available through the centralManager property.
stateUpdateHandler | The handler for notifying of the host device Bluetooth state changes. |
- (CBPeripheral *) peripheralForIdentifier: | (NSUUID *) | identifier |
Gets the discovered CBPeripheral for the given UUID.
identifier | The UUID assigned by the system to a BLE peripheral. |
- (void) setConnectionEventHandler: | (nullable SGBleConnectionEventHandler) | peripheralConnectionEventHandler | |
forPeripheral: | (CBPeripheral *) | peripheral | |
Sets the handler for notifying of the given peripheral's connection events.
Replace any handler previously set for this peripheral.
peripheralConnectionEventHandler | The handler for notifying connection events. |
peripheral | The peripheral to watch for connection events. |