首页 > 代码库 > CBCentralManager
CBCentralManager
Initializing a Central Manager
- (instancetype)initWithDelegate:(id<CBCentralManagerDelegate>)delegate queue:(dispatch_queue_t)queue- (instancetype)initWithDelegate:(id<CBCentralManagerDelegate>)delegate queue:(dispatch_queue_t)queue options:(NSDictionary *)options
Establishing or Canceling Connections with Peripherals
- (void)connectPeripheral:(CBPeripheral *)peripheral options:(NSDictionary *)options- (void)cancelPeripheralConnection:(CBPeripheral *)peripheral
Retrieving Lists of Peripherals
- (void)retrieveConnectedPeripherals- (NSArray *)retrieveConnectedPeripheralsWithServices:(NSArray *)serviceUUIDs- (void)retrievePeripherals:(NSArray *)peripheralUUIDs- (NSArray *)retrievePeripheralsWithIdentifiers:(NSArray *)identifiers
Scanning or Stopping Scans of Peripherals
- (void)scanForPeripheralsWithServices:(NSArray *)serviceUUIDs options:(NSDictionary *)options- (void)stopScan
Monitoring Properties
@property(readonly) CBCentralManagerState state@property(weak, nonatomic) id< CBCentralManagerDelegate > delegate
Constants
Central Manager Initialization Options
NSString *const CBCentralManagerOptionShowPowerAlertKey ;NSString *const CBCentralManagerOptionRestoreIdentifierKey;
Peripheral Scanning Options
NSString *const CBCentralManagerScanOptionAllowDuplicatesKey ;NSString *const CBCentralManagerScanOptionSolicitedServiceUUIDsKey;
Peripheral Connection Options
NSString *const CBConnectPeripheralOptionNotifyOnConnectionKey ;NSString *const CBConnectPeripheralOptionNotifyOnDisconnectionKey ;NSString *const CBConnectPeripheralOptionNotifyOnNotificationKey;
Central Manager State
typedef enum { CBCentralManagerStateUnknown = 0, CBCentralManagerStateResetting , CBCentralManagerStateUnsupported , CBCentralManagerStateUnauthorized , CBCentralManagerStatePoweredOff , CBCentralManagerStatePoweredOn ,} CBCentralManagerState;
CBCentralManager
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。