10#import <Foundation/Foundation.h>
11#import <IOKit/usb/IOUSBLib.h>
12#import <UniPRT/UsbInterfaceInfo.h>
13#import <UniPRT/AComm.h>
32@property (readonly, nonatomic) NSMutableDictionary *
deviceList;
36@property (nonatomic, readonly) BOOL shouldStopReadLoop;
59- (instancetype)initWithVendorId:(NSString *)vendorId productId:(NSString *)productId;
95- (void)write:(NSData *)text;
139- (NSData*)writeAndWaitForResponse:(NSData *)text
140 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
141 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
142 completionToken:(NSString *)completionToken;
144- (NSData*)writeAndWaitForResponseJson:(NSData *)text
145 responseStartTimeOut:(NSTimeInterval)responseStartTimeOut
146 responseEndTimeOut:(NSTimeInterval)responseEndTimeOut
147 completionToken:(NSString *)completionToken;
一个用于通信接口的基类,符合 IComm 协议。
定义 AComm.h:29
实现USB特定通信并继承AComm类的类。
定义 UsbComm.h:30
void stopListenRead()
停止从设备的异步读取。
UsbInterfaceInfo * matchedInterfaces
定义 UsbComm.h:33
NSMutableArray< UsbInterfaceInfo * > * discoveredInterfaces
定义 UsbComm.h:31
NSMutableDictionary * deviceList
定义 UsbComm.h:32
void asyncListenRead()
异步监听并读取设备数据。