UniPRT SDK v1.0.0.0
 
Loading...
Searching...
No Matches
UsbComm.h
1//
2// UsbComm.h
3// TSCPrinters SDK
4//
5// Created by Realbuber on 2024/3/12.
6//
7
11#import <Foundation/Foundation.h>
12#import <IOKit/usb/IOUSBLib.h>
13#import <UniPRT/UsbInterfaceInfo.h>
14#import <UniPRT/AComm.h>
15
30@interface UsbComm: AComm
31
32@property (nonatomic, strong, readonly) NSMutableArray<UsbInterfaceInfo *> *discoveredInterfaces;
33@property (readonly, nonatomic) NSMutableDictionary *deviceList;
34@property (nonatomic, readonly) UsbInterfaceInfo *matchedInterfaces;
35
37@property (nonatomic, readonly) BOOL shouldStopReadLoop;
60- (instancetype)initWithVendorId:(NSString *)vendorId productId:(NSString *)productId;
61
70- (void)open;
71
80- (void)close;
81
96- (void)write:(NSData *)text;
97
112- (NSData*)read;
113
140- (NSData*)writeAndWaitForResponse:(NSData *)text
141 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
142 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
143 completionToken:(NSString *)completionToken;
144
153- (void)asyncListenRead;
154
163- (void)stopListenRead;
164
165@end
166
A base class for communication interfaces, conforming to the IComm protocol.
Definition AComm.h:29