10#import <CoreBluetooth/CoreBluetooth.h>
12extern NSString*
const CU_SERVICE_UUID;
13extern NSString*
const CU_CARACHTERISTIC_UUID_TX;
14extern NSString*
const CU_CARACHTERISTIC_UUID_RX;
15extern NSInteger
const CU_BLE_WRITE_PACKETSIZE;
19@interface CommPortBLE : CommPort
31 enum CommPortStatus commPortStatusBLE;
33 NSMutableArray *iplistArrayBLE;
34 NSMutableData* dataRXBLE;
37 Boolean bDisconnected;
38 Boolean bDiscServices;
39 Boolean bDiscCharacteristicsForService;
41 Boolean bNotification;
45 CBPeripheralManager *peripheralManager;
46 CBPeripheral *blePeripheral;
49 CBCharacteristic *bleTx;
50 CBCharacteristic *bleRx;
52 NSString *strServiceUUID;
53 NSString *strCharacteristicTxUUID;
54 NSString *strCharacteristicRxUUID;
55 NSString *strServiceUUIDToFind;
59 int iWriteWithoutWaitSleepms;
65- (NSArray *) EnumBLEDevices:(NSInteger)searchTimeout :(NSString *)strBleGattServiceUUIDToFind :(NSError**)error;
66- (int) BluetoothLowEnergyConnect:(CBPeripheral *)bleperipheral :(NSInteger)iBleTxMaxSize :(NSInteger)iBleTxSleep :(NSString *)strBleGattServiceUUID :(NSString *)strGattCarTx :(NSString *)strGattCarRx :(NSError**)error;
68- (void) BleConnect:(CBPeripheral *)bleperipheral :(NSInteger)iBleTxMaxSize :(NSInteger)iBleTxSleep :(NSString *)strBleGattServiceUUID :(NSString *)strGattCarTx :(NSString *)strGattCarRx :(NSError**)error;
70- (void) BLEDisconnect:(NSError**)error;
71- (void) BLEWrite:(NSData *)data :(NSError**)error;
72- (void) BLEWrite:(const uint8_t *)buf :(
int)length :(NSError**)error;
73- (NSData *) BLERead:(NSInteger)rxBufferSize :(NSError**)error;