A class for Bluetooth communication, inheriting from AComm.
More...
#include <BtComm.h>
A class for Bluetooth communication, inheriting from AComm.
◆ accessoryDidConnect:
| - (void) accessoryDidConnect: |
|
(NSNotification *) | notification |
|
|
implementation |
◆ accessoryDidDisconnect:
| - (void) accessoryDidDisconnect: |
|
(NSNotification *) | notification |
|
|
implementation |
◆ close
Closes the connection to the Bluetooth device.
Reimplemented from AComm.
◆ closeInternal
◆ configureStreams
| - (void) configureStreams |
|
|
|
|
implementation |
◆ dealloc
◆ initWithDeviceAddress:
| - (instancetype) initWithDeviceAddress: |
|
(NSString *) | deviceAddress |
|
Initializes a new instance with the given device address.
- Parameters
-
| deviceAddress | The Bluetooth address of the device. |
- Returns
- An initialized instance of BtComm, or nil if the object could not be created.
◆ open
Opens the connection to the Bluetooth device.
Reimplemented from AComm.
◆ openInternal
◆ performSelectorOnCommunicationThread:withObject:
| - (void) performSelectorOnCommunicationThread: |
|
(SEL) | selector |
| withObject: |
|
(id) | object |
|
implementation |
◆ read
Reads data from the Bluetooth device.
- Returns
- The data read from the device.
Reimplemented from 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 |
Waits for data to be available within a specified timeout.
- Parameters
-
| msTimeOut | The timeout interval in milliseconds. |
Reimplemented from AComm.
◆ write:
| - (void) write: |
|
(NSData *) | text |
|
Writes data to the Bluetooth device.
- Parameters
-
| text | The data to write to the device. |
Reimplemented from AComm.
◆ writeAndWaitForResponse:responseStartTimeOut:responseEndTimeOut:completionToken:
| - (NSData *) writeAndWaitForResponse: |
|
(NSData *) | text |
| responseStartTimeOut: |
|
(NSTimeInterval) | responseStartTimeOut |
| responseEndTimeOut: |
|
(NSTimeInterval) | responseEndTimeOut |
| completionToken: |
|
(NSString *) | completionToken |
Writes data to the Bluetooth device and waits for a response.
- Parameters
-
| text | The data to write to the device. |
| responseStartTimeOut | The timeout interval for the start of the response. |
| responseEndTimeOut | The timeout interval for the end of the response. |
| completionToken | A token indicating the completion of the response. |
- Returns
- The data received in response from the device.
Reimplemented from 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 |
The documentation for this class was generated from the following files:
- /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