一个用于蓝牙通信的类,继承自 AComm。
更多...
#include <BtComm.h>
◆ accessoryDidConnect:
| - (void) accessoryDidConnect: |
|
(NSNotification *) | notification |
|
|
implementation |
◆ accessoryDidDisconnect:
| - (void) accessoryDidDisconnect: |
|
(NSNotification *) | notification |
|
|
implementation |
◆ close
◆ closeInternal
◆ configureStreams
| - (void) configureStreams |
|
|
|
|
implementation |
◆ dealloc
◆ initWithDeviceAddress:
| - (instancetype) initWithDeviceAddress: |
|
(NSString *) | deviceAddress |
|
使用给定的设备地址初始化一个新实例。
- 参数
-
- 返回
- 一个初始化的 BtComm 实例,如果无法创建对象,则返回 nil。
◆ open
◆ openInternal
◆ performSelectorOnCommunicationThread:withObject:
| - (void) performSelectorOnCommunicationThread: |
|
(SEL) | selector |
| withObject: |
|
(id) | object |
|
implementation |
◆ read
从蓝牙设备读取数据。
- 返回
- 从设备读取的数据。
重载 AComm .
◆ reloadConnectedAccessories
| - (void) reloadConnectedAccessories |
|
|
|
|
implementation |
◆ runCommunicationThread
| - (void) runCommunicationThread |
|
|
|
|
implementation |
◆ startCommunicationThread
| - (void) startCommunicationThread |
|
|
|
|
implementation |
◆ stopCommunicationThread
| - (void) stopCommunicationThread |
|
|
|
|
implementation |
◆ stream:handleEvent:
| - (void) stream: |
|
(NSStream *) | aStream |
| handleEvent: |
|
(NSStreamEvent) | eventCode |
|
implementation |
◆ tryWriteData
◆ waitForDataWithTimeout:
| - (void) waitForDataWithTimeout: |
|
(NSTimeInterval) | msTimeOut |
|
|
implementation |
等待数据在指定的超时内可用。
- 参数
-
重载 AComm .
◆ 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 |
◆ accessory
| - (EAAccessory*) accessory |
|
readwritenonatomicstrongimplementation |
◆ communicationRunLoop
| - (CFRunLoopRef) communicationRunLoop |
|
readwritenonatomicassignimplementation |
◆ communicationThread
| - (NSThread*) communicationThread |
|
readwritenonatomicstrongimplementation |
◆ connected
◆ deviceAddress
| - (NSString*) deviceAddress |
|
readwritenonatomicstrongimplementation |
◆ isReadyToWrite
|
|
readwritenonatomicassignimplementation |
◆ receivedData
| - (NSMutableData*) receivedData |
|
readwritenonatomicstrongimplementation |
◆ session
|
|
readwritenonatomicstrongimplementation |
◆ writeQueue
| - (NSMutableArray<NSData *>*) writeQueue |
|
readwritenonatomicstrongimplementation |
该类的文档由以下文件生成:
- /Users/bob_huang/Documents/Project/sdk_json_Objective-C_IOS/sdk_json_Objective-C_IOS/Comm/BtComm.h
- /Users/bob_huang/Documents/Project/sdk_json_Objective-C_IOS/sdk_json_Objective-C_IOS/Comm/BtComm.m