typedef NS_ENUM(NSInteger, CBPeripheralManagerAuthorizationStatus) {
CBPeripheralManagerAuthorizationStatusNotDetermined = 0,
CBPeripheralManagerAuthorizationStatusRestricted,
CBPeripheralManagerAuthorizationStatusDenied,
CBPeripheralManagerAuthorizationStatusAuthorized,
} NS_ENUM_AVAILABLE(NA, 7_0);
typedef NS_ENUM(NSInteger, CBPeripheralManagerState) {
CBPeripheralManagerStateUnknown = CBManagerStateUnknown,
CBPeripheralManagerStateResetting = CBManagerStateResetting,
CBPeripheralManagerStateUnsupported = CBManagerStateUnsupported,
CBPeripheralManagerStateUnauthorized = CBManagerStateUnauthorized,
CBPeripheralManagerStatePoweredOff = CBManagerStatePoweredOff,
CBPeripheralManagerStatePoweredOn = CBManagerStatePoweredOn,
} NS_DEPRECATED(NA, NA, 6_0, 10_0, "Use CBManagerState instead");
typedef NS_ENUM(NSInteger, CBPeripheralManagerConnectionLatency) {
CBPeripheralManagerConnectionLatencyLow = 0,
CBPeripheralManagerConnectionLatencyMedium,
CBPeripheralManagerConnectionLatencyHigh
} NS_ENUM_AVAILABLE(NA, 6_0);
@property(nonatomic, weak, nullable) id<CBPeripheralManagerDelegate> delegate;
@property(nonatomic, assign, readonly) BOOL isAdvertising;
+ (CBPeripheralManagerAuthorizationStatus)authorizationStatus NS_AVAILABLE(NA, 7_0);
- (instancetype)init;
- (instancetype)initWithDelegate:(nullable id<CBPeripheralManagerDelegate>)delegate
queue:(nullable dispatch_queue_t)queue __TVOS_PROHIBITED;
- (instancetype)initWithDelegate:(nullable id<CBPeripheralManagerDelegate>)delegate
queue:(nullable dispatch_queue_t)queue
options:(nullable NSDictionary<NSString *, id> *)options NS_AVAILABLE(NA, 7_0) NS_DESIGNATED_INITIALIZER __TVOS_PROHIBITED;
- (void)startAdvertising:(nullable NSDictionary<NSString *, id> *)advertisementData;
- (void)stopAdvertising;
- (void)setDesiredConnectionLatency:(CBPeripheralManagerConnectionLatency)latency forCentral:(CBCentral *)central;
- (void)addService:(CBMutableService *)service;
- (void)removeService:(CBMutableService *)service;
- (void)removeAllServices;
- (void)respondToRequest:(CBATTRequest *)request withResult:(CBATTError)result;
- (BOOL)updateValue:(NSData *)value forCharacteristic:(CBMutableCharacteristic *)characteristic onSubscribedCentrals:(nullable NSArray<CBCentral *> *)centrals;
- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral;
- (void)peripheralManager:(CBPeripheralManager *)peripheral willRestoreState:(NSDictionary<NSString *, id> *)dict;
- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral error:(nullable NSError *)error;
- (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(nullable NSError *)error;
- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didSubscribeToCharacteristic:(CBCharacteristic *)characteristic;
- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didUnsubscribeFromCharacteristic:(CBCharacteristic *)characteristic;
- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveReadRequest:(CBATTRequest *)request;
- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray<CBATTRequest *> *)requests;
- (void)peripheralManagerIsReadyToUpdateSubscribers:(CBPeripheralManager *)peripheral;
CBPeripheralManager
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...