一個用於藍牙通信的類別,繼承自 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 |
|
將數據寫入藍牙設備。
- 參數
-
依據AComm重新實作.
◆ 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 |
此類別(class) 文件是由下列檔案中產生:
- /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