UniPRT SDK v2.0.0.0
 
載入中...
搜尋中...
無符合項目
BtComm 類別 參考文件

一個用於藍牙通信的類別,繼承自 AComm。 更多...

#include <BtComm.h>

類別BtComm的繼承圖:
AComm <IComm>

實體方法

(instancetype) - initWithDeviceAddress:
 使用給定的設備地址初始化一個新實例。
 
(void) - open
 打開與藍牙設備的連接。
 
(void) - close
 關閉與藍牙設備的連接。
 
(void) - write:
 將數據寫入藍牙設備。
 
(NSData *) - read
 從藍牙設備讀取數據。
 
(NSData *) - writeAndWaitForResponse:responseStartTimeOut:responseEndTimeOut:completionToken:
 將數據寫入藍牙設備並等待響應。
 
(NSData *) - writeAndWaitForResponseJson:responseStartTimeOut:responseEndTimeOut:completionToken:
 
(void) - startCommunicationThread [implementation]
 
(void) - runCommunicationThread [implementation]
 
(void) - stopCommunicationThread [implementation]
 
(void) - performSelectorOnCommunicationThread:withObject: [implementation]
 
(void) - openInternal [implementation]
 
(void) - configureStreams [implementation]
 
(void) - closeInternal [implementation]
 
(void) - accessoryDidConnect: [implementation]
 
(void) - accessoryDidDisconnect: [implementation]
 
(void) - reloadConnectedAccessories [implementation]
 
(void) - dealloc [implementation]
 
(void) - tryWriteData [implementation]
 
(void) - stream:handleEvent: [implementation]
 
(void) - waitForDataWithTimeout: [implementation]
 等待數據在指定的超時內可用。
 
- 實體方法 繼承自 AComm
(void) - readToBinaryWriter:
 將數據讀入二進制寫入器(輸出流)。
 
(void) - writeFromBinaryReader:
 將數據從二進制讀取器(輸入流)寫入通信接口。
 
(void) - writeAndWaitForResponseToBinaryWriter:fromBinaryReader:responseStartTimeout:responseEndTimeout:completionToken:
 將數據寫入通信接口並等待響應,使用二進制流。
 

屬性(properties)

BOOL connected
 
NSString * deviceAddress [implementation]
 
EASession * session [implementation]
 
EAAccessory * accessory [implementation]
 
NSMutableArray< NSData * > * writeQueue [implementation]
 
BOOL isReadyToWrite [implementation]
 
NSMutableData * receivedData [implementation]
 
NSThread * communicationThread [implementation]
 
CFRunLoopRef communicationRunLoop [implementation]
 
- 屬性(properties) 繼承自 AComm
int maxPacketSize
 通信的最大數據包大小。
 
NSString * descriptor
 通信接口的描述符。
 
int bytesAvailable
 可讀取的字節數。
 
BOOL isConnected
 指示連接是否建立的標誌。
 
- 屬性(properties) 繼承自 <IComm>
NSString * descriptor
 通信接口的描述符。
 
int bytesAvailable
 可讀取的字節數。
 
BOOL isConnected
 指示連接是否已建立的標誌。
 

詳細描述

一個用於藍牙通信的類別,繼承自 AComm。

方法文件

◆ accessoryDidConnect:

- (void) accessoryDidConnect: (NSNotification *) notification
implementation

◆ accessoryDidDisconnect:

- (void) accessoryDidDisconnect: (NSNotification *) notification
implementation

◆ close

- (void) close

關閉與藍牙設備的連接。

依據AComm重新實作.

◆ closeInternal

- (void) closeInternal
implementation

◆ configureStreams

- (void) configureStreams
implementation

◆ dealloc

- (void) dealloc
implementation

◆ initWithDeviceAddress:

- (instancetype) initWithDeviceAddress: (NSString *) deviceAddress

使用給定的設備地址初始化一個新實例。

參數
deviceAddress設備的藍牙地址。
傳回值
一個初始化的 BtComm 實例,如果無法創建對象,則返回 nil。

◆ open

- (void) open

打開與藍牙設備的連接。

依據AComm重新實作.

◆ openInternal

- (void) openInternal
implementation

◆ performSelectorOnCommunicationThread:withObject:

- (void) performSelectorOnCommunicationThread: (SEL) selector
withObject: (id) object 
implementation

◆ read

- (NSData *) 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

- (void) tryWriteData
implementation

◆ waitForDataWithTimeout:

- (void) waitForDataWithTimeout: (NSTimeInterval) msTimeOut
implementation

等待數據在指定的超時內可用。

參數
msTimeOut超時間隔(毫秒)。

依據AComm重新實作.

◆ write:

- (void) write: (NSData *) text

將數據寫入藍牙設備。

參數
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 

屬性(property)說明文件

◆ accessory

- (EAAccessory*) accessory
readwritenonatomicstrongimplementation

◆ communicationRunLoop

- (CFRunLoopRef) communicationRunLoop
readwritenonatomicassignimplementation

◆ communicationThread

- (NSThread*) communicationThread
readwritenonatomicstrongimplementation

◆ connected

- (BOOL) connected
readwritenonatomicassign

◆ deviceAddress

- (NSString*) deviceAddress
readwritenonatomicstrongimplementation

◆ isReadyToWrite

- (BOOL) isReadyToWrite
readwritenonatomicassignimplementation

◆ receivedData

- (NSMutableData*) receivedData
readwritenonatomicstrongimplementation

◆ session

- (EASession*) session
readwritenonatomicstrongimplementation

◆ writeQueue

- (NSMutableArray<NSData *>*) writeQueue
readwritenonatomicstrongimplementation

此類別(class) 文件是由下列檔案中產生: