LETransceiver.h 1012 Bytes
//
//  LETransceiver.h
//  ActsBluetoothSpeed
//
//  Created by inidhu on 2019/3/15.
//  Copyright © 2019 Actions. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

NS_ASSUME_NONNULL_BEGIN

#define KeyWriteServiceUUID             @"kWriteServiceUUID"
#define KeyIndicateServiceUUID          @"kIndicateServiceUUID"
#define KeyWriteCharacteristicUUID      @"kWriteCharacteristicUUID"
#define KeyIndicateCharacteristicUUID   @"kIndicateCharacteristicUUID"

@protocol LEConnctionDelegate <NSObject>
- (void)onConnectedPeripheral:(CBPeripheral *) peripheral;
@end

@interface LETransceiver : NSObject
@property (weak, nonatomic) id<LEConnctionDelegate> connectionDelegate;
- (void)write:(NSData *) data;
- (void)write:(NSData *) data index:(int) i;

// for BluetoothManager to call
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(nullable NSError *)error;
- (void)closeOTA;
@end

NS_ASSUME_NONNULL_END