| CustomiOSApi 1.09

CommPortBLE.h
1//
2// CommPortBLE.h
3// CustomiOSApi
4//
5// Created by CUSTOM on 03/07/13.
6// Copyright (c) 2013 CUSTOM. All rights reserved.
7//
8
9#import "CommPort.h"
10#import <CoreBluetooth/CoreBluetooth.h>
11
12//Hide it in the documentation
13// @cond PRIVATE
14@interface CommPortBLE : CommPort
15{
16@public
17
18
19
20@protected
21
22@private
23
24
25
26 enum CommPortStatus commPortStatusBLE;
27
28 //CBPeripheralManager *peripheralManager;
29 //CBPeripheral *blePeripheral;
30 //CBUUID *deviceUUID;
31
32
33
34 //CBService *functionalityServiceLayer;
35 //CBCharacteristic *characteristic;
36
37 NSMutableArray *iplistArrayBLE;
38 NSMutableData* dataRXBLE;
39
40 Boolean bConnected;
41 Boolean bDisconnected;
42 Boolean bDiscServices;
43 Boolean bDiscCharacteristicsForService;
44 Boolean bWriteFinish;
45 Boolean bNotification;
46 Boolean bMtuSet;
47
48 CBCentralManager *centralManager;
49 CBPeripheralManager *peripheralManager;
50 CBPeripheral *blePeripheral;
51 CBUUID *deviceUUID;
52
53 CBCharacteristic *bleTx;
54 CBCharacteristic *bleRx;
55
56 int iMTUSize;
57}
58
59//***********************************************
60// PRIVATE FUNCTIONS
61//***********************************************
62- (NSArray *) EnumBLEDevices:(NSInteger)searchTimeout :(NSError**)error;
63- (int) BluetoothLowEnergyConnect:(CBPeripheral *)bleperipheral :(NSError**)error;
64- (Boolean)InitBLE;
65- (void) BleConnect:(CBPeripheral *)bleperipheral :(NSError**)error;
66
67- (void) BLEDisconnect:(NSError**)error;
68- (void) BLEWrite:(NSData *)data :(NSError**)error;
69- (void) BLEWrite:(const uint8_t *)buf :(int)length :(NSError**)error;
70- (NSData *) BLERead:(NSInteger)rxBufferSize :(NSError**)error;
71
72@end