react-native-bt-device/ios/RNBTDevice/Device/ENNativeDevice.h

45 lines
1.5 KiB
C
Raw Normal View History

2024-03-24 09:45:44 +00:00
//
// ENNativeDevice.h
// ENBLEProject
//
// Created by lvwang2002 on 16/4/7.
// Copyright © 2016年 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "BLEDevice.h"
@class BLEDevice;
@protocol ENNativeDeviceProtocal;
@interface ENNativeDevice : NSObject{
@public
__weak CBPeripheral *_peripheral;
__weak CBCentralManager *_centralManager;
__weak BLEDevice *_device;
}
@property(nonatomic,weak)id<ENNativeDeviceProtocal>deviceDelegate;
-(instancetype)initWithPeripheral:(CBPeripheral *)peripheral WithCentralManager:(CBCentralManager *)centerManager WithDevice:(BLEDevice *)device;
+(ENNativeDevice *)getNativeDeviceWithDevice:(BLEDevice *)device
WithPeripheral:(CBPeripheral *)peripheral
CentralManager:(CBCentralManager *)centerManager;
-(NSString *)getConnectedStatus;
/** 得到设备显示名字 */
-(NSString *)getDeviceDisplayName;
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error;
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error;
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error;
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForReceiveData:(NSData *)data UUID:(CBUUID *)uuid error:(NSError *)error;
@end
@protocol ENNativeDeviceProtocal <NSObject>
@end