// // LETransceiver.h // ActsBluetoothSpeed // // Created by inidhu on 2019/3/15. // Copyright © 2019 Actions. All rights reserved. // #import #import NS_ASSUME_NONNULL_BEGIN #define KeyWriteServiceUUID @"kWriteServiceUUID" #define KeyIndicateServiceUUID @"kIndicateServiceUUID" #define KeyWriteCharacteristicUUID @"kWriteCharacteristicUUID" #define KeyIndicateCharacteristicUUID @"kIndicateCharacteristicUUID" @protocol LEConnctionDelegate @required - (void)onFoundPeripheral:(CBPeripheral *) peripheral advertisementData:(NSDictionary *) advertisementData; @optional - (void)onConnectedPeripheral:(CBPeripheral *) peripheral; - (void)onDisconnectedPeripheral:(CBPeripheral *) peripheral; @end @protocol LEDataDelegate @optional - (void)onDataReceive:(NSData *) data; @end @interface LETransceiver : NSObject @property (weak, nonatomic) id connectionDelegate; @property (weak, nonatomic) id dataDelegate; - (void)setUUIDs:(NSDictionary *) uuids; - (void)scanStart; - (void)scanStop; - (void)connect:(CBPeripheral *)peripheral; - (void)disconnect:(CBPeripheral *)peripheral; - (void)write:(NSData *) data; - (void)write:(NSData *) data index:(int) i; @end NS_ASSUME_NONNULL_END