CBCentralManagerConstants

字数 193阅读 2467

字典key 对应布尔值
CBCentralManagerOptionShowPowerAlertKey NS_AVAILABLE(NA, 7_0);
CBCentralManagerOptionRestoreIdentifierKey NS_AVAILABLE(NA, 7_0);

CBCentralManagerScanOptionAllowDuplicatesKey
//key值是NSNumber,默认值为NO表示不会重复扫描已经发现的设备,如需要不断获取最新的信号强度RSSI所以一般设为YES了
scanForPeripheralsWithServices:options:方法中的options参数

CBCentralManagerScanOptionSolicitedServiceUUIDsKey NS_AVAILABLE(NA, 7_0);
你想扫描的serviceUUID数组

2

CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnConnectionKey
OnConnectionKey在程序被挂起时,连接成功显示Alert提醒框
CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnDisconnectionKey;
OnDisconnectionKey在程序被挂起时,断开连接显示Alert提醒框
CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnNotificationKey
OnNotificationKey在程序被挂起时,显示所有的提醒消息
NSDictionary *options = @{CBConnectPeripheralOptionNotifyOnDisconnectionKey: @TRUE};
[_centralmanager connectPeripheral:device options:options];

3

CB_EXTERN NSString * const CBCentralManagerRestoredStatePeripheralsKey NS_AVAILABLE(NA, 7_0);
CB_EXTERN NSString * const CBCentralManagerRestoredStateScanServicesKey NS_AVAILABLE(NA, 7_0);
CB_EXTERN NSString * const CBCentralManagerRestoredStateScanOptionsKey NS_AVAILABLE(NA, 7_0);

蓝牙博客

推荐阅读更多精彩内容