1#import <Foundation/Foundation.h>
2#import <CoreBluetooth/CoreBluetooth.h>
3#import <UniPRT/AComm.h>
34@interface BleComm :
AComm <CBCentralManagerDelegate, CBPeripheralDelegate>
105- (void)
open:(NSString *)deviceName;
120@property (nonatomic, copy)
void (^
_Nullable characteristicsReadyCallback)(void);
168- (void)write:(NSData *)text;
204- (void)waitForDataWithTimeout:(NSTimeInterval)msTimeOut;
234- (NSData *)writeAndWaitForResponse:(NSData *)text
235 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
236 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
237 completionToken:(NSString *)completionToken;
267- (NSData *)writeAndWaitForResponseJson:(NSData *)text
268 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
269 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
270 completionToken:(NSString *)completionToken;
A base class for communication interfaces, conforming to the IComm protocol.
Definition AComm.h:29
void open()
Opens the communication interface.
A communication class for handling Bluetooth Low Energy (BLE) connections.
Definition BleComm.h:34
NSData * read()
Reads the data received from the BLE device.
NSArray< NSString * > * availableDevices()
Retrieves a list of available BLE devices.
void close()
Disconnects the current BLE connection.
NSMutableArray< CBCharacteristic * > * readCharacteristics
Definition BleComm.h:64
NSMutableArray< CBPeripheral * > * foundPeripherals
Definition BleComm.h:49
void(^ _Nullable)(void)
Callback triggered after all required BLE characteristics are discovered and ready to use....
CBCentralManager * centralManager
Definition BleComm.h:39
NSMutableArray< CBCharacteristic * > * writeCharacteristics
Definition BleComm.h:59
bool isConnected()
Checks if the BLE connection is currently active.
NSMutableData * receivedData
Definition BleComm.h:69
CBPeripheral * connectedPeripheral
Definition BleComm.h:54
NSMutableArray< NSString * > * discoveredDevices
Definition BleComm.h:44