6#ifndef SGBleCentralManagerDelegate_h
7#define SGBleCentralManagerDelegate_h
9#import <Foundation/Foundation.h>
10#import <CoreBluetooth/CoreBluetooth.h>
13NS_ASSUME_NONNULL_BEGIN
32 NSObject *_startScanSync;
33 void (^_stateUpdateHandler)(CBManagerState state);
34 CBCentralManager *_centralManager;
35 NSMutableDictionary<NSUUID *,CBPeripheral *> *_peripherals;
36 NSMutableDictionary<CBPeripheral *, SGBleConnectionEventHandler> *_peripheralsConnectionEventHandlers;
40- (CBCentralManager *)centralManager;
41- (NSArray<CBPeripheral *> *)peripherals;
58@property(readonly, getter=
peripherals) NSArray<CBPeripheral *> *peripherals;
63@property(nonatomic, readonly, getter=isBluetoothOn)
bool isBluetoothOn;
74- (instancetype)initWithStateUpdateHandler:(nullable
void (^)(CBManagerState state))stateUpdateHandler;
79- (void)clearPeripherals;
87- (nullable CBPeripheral *)peripheralForIdentifier:(NSUUID *)identifier;
98 forPeripheral:(CBPeripheral *)peripheral;
Definition of SGBleConnectionEvent and SGBleConnectionEventReason enumerations.
void(^ SGBleConnectionEventHandler)(CBPeripheral *_Nonnull peripheral, SGBleConnectionEvent connectionEvent, NSError *_Nullable error)
Peripheral connection event handler.
Definition SGBleTypes.h:136
void(^ SGBlePeripheralDiscoveryHandler)(CBPeripheral *_Nonnull peripheral, NSDictionary< NSString *, id > *_Nonnull advertisementData, NSNumber *_Nonnull rssi)
Peripheral discovery handler.
Definition SGBleTypes.h:130
Implementation of CBCentralManagerDelegate protocol. Stores and notifies of discovered Bluetooth Low ...
Definition SGBleCentralManagerDelegate.h:29
NSArray< CBPeripheral * > * peripherals
Gets the list of discovered peripherals.
Definition SGBleCentralManagerDelegate.h:58
CBCentralManager * centralManager
Gets the central manager associated with this instance.
Definition SGBleCentralManagerDelegate.h:48