UniPRT SDK v2.0.0.0
 
Loading...
Searching...
No Matches
BtComm.h
1//
2// BtComm.h
3// TSCPrinters SDK
4//
5// Created by Realbuber on 2024/3/26.
6//
7
8#import <Foundation/Foundation.h>
9#import <IOBluetooth/IOBluetooth.h>
10#import <UniPRT/AComm.h>
11
26@interface BtComm : AComm
27
36@property (nonatomic, strong) NSMutableData *receivedData;
37
55- (instancetype)initWithDeviceAddress:(NSString *)deviceAddress;
56
65- (void)open;
66
75- (void)close;
76
91- (void)write:(NSData *)text;
92
107- (NSData *)read;
108
135- (NSData *)writeAndWaitForResponse:(NSData *)text
136 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
137 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
138 completionToken:(NSString *)completionToken;
139
140- (NSData *)writeAndWaitForResponseJson:(NSData *)text
141 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
142 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
143 completionToken:(NSString *)completionToken;
144@end
145
A base class for communication interfaces, conforming to the IComm protocol.
Definition AComm.h:29
A class for Bluetooth communication, inheriting from AComm.
Definition BtComm.h:27
void open()
Opens the connection to the Bluetooth device.
NSMutableData * receivedData
The data received from the device.
Definition BtComm.h:36
NSData * read()
Reads data from the Bluetooth device.
void close()
Closes the connection to the Bluetooth device.