实现USB特定通信并继承AComm类的类。
更多...
#include <UsbComm.h>
◆ asyncListenRead
◆ close
◆ initWithVendorId:productId:
| - (instancetype) initWithVendorId: |
|
(NSString *) | vendorId |
| productId: |
|
(NSString *) | productId |
使用给定的厂商ID和产品ID初始化一个新实例。
- 参数
-
| vendorId | 实例的厂商ID。 |
| productId | 实例的产品ID。 |
- 返回
- 初始化后的类实例,如果无法创建则返回nil。
◆ open
◆ read
从设备读取数据。
- 返回
- 从设备读取的数据。
重载 AComm .
◆ stopListenRead
◆ write:
| - (void) write: |
|
(NSData *) | text |
|
◆ writeAndWaitForResponse:responseStartTimeOut:responseEndTimeOut:completionToken:
| - (NSData *) writeAndWaitForResponse: |
|
(NSData *) | text |
| responseStartTimeOut: |
|
(NSTimeInterval) | responseStartTimeOut |
| responseEndTimeOut: |
|
(NSTimeInterval) | responseEndTimeOut |
| completionToken: |
|
(NSString *) | completionToken |
向设备写入数据并等待响应。
- 参数
-
| text | 要写入设备的数据。 |
| responseStartTimeOut | 响应开始的超时时间。 |
| responseEndTimeOut | 响应结束的超时时间。 |
| completionToken | 表示响应完成的标记。 |
- 返回
- 从设备收到的响应数据。
重载 AComm .
◆ writeAndWaitForResponseJson:responseStartTimeOut:responseEndTimeOut:completionToken:
| - (NSData *) writeAndWaitForResponseJson: |
|
(NSData *) | text |
| responseStartTimeOut: |
|
(NSTimeInterval) | responseStartTimeOut |
| responseEndTimeOut: |
|
(NSTimeInterval) | responseEndTimeOut |
| completionToken: |
|
(NSString *) | completionToken |
◆ deviceList
| - (NSMutableDictionary*) deviceList |
|
readnonatomicassign |
◆ discoveredInterfaces
| - (NSMutableArray<UsbInterfaceInfo *>*) discoveredInterfaces |
|
readnonatomicstrong |
◆ matchedInterfaces
| - (UsbInterfaceInfo*) matchedInterfaces |
|
readnonatomicassign |
该类的文档由以下文件生成:
- /Users/bob_huang/Documents/Project/sdk_json_Objective-C/AutoIdSDK/Comm/UsbComm.h