ZSDK_API
1.5.1049
|
Establishes a Bluetooth connection to a printer. More...
#import <MfiBtPrinterConnection.h>
Instance Methods | |
(id) | - initWithSerialNumber: |
Initializes a new instance of the MfiBtPrinterConnection class. | |
(id) | - initWithSerialNumber:withMaxTimeoutForRead:andWithTimeToWaitForMoreData: |
Initializes a new instance of the MfiBtPrinterConnection class. | |
(void) | - setTimeToWaitAfterWriteInMilliseconds: |
Overrides the time the write: method will wait after writing data to the stream. | |
(void) | - setTimeToWaitAfterReadInMilliseconds: |
Overrides the time the read: method will wait after writing data to the stream. | |
(void) | - setTimeToWaitBeforeCloseInMilliseconds: |
Overrides the time the close: method will wait before closing the connection. | |
Instance Methods inherited from <ZebraPrinterConnection> | |
(NSString *) | - toString |
See the classes which implement this method for the format of the description string. | |
(NSInteger) | - getMaxTimeoutForRead |
Returns the maximum time, in milliseconds, to wait for any data to be received. | |
(NSInteger) | - getTimeToWaitForMoreData |
Returns the maximum time, in milliseconds, to wait between reads after the initial read. | |
(void) | - setMaxTimeoutForRead: |
Set the maximum time, in milliseconds, to wait for any data to be received. | |
(void) | - setTimeToWaitForMoreData: |
Set the maximum time, in milliseconds, to wait in-between reads after the initial read. | |
(BOOL) | - isConnected |
Returns YES if the connection is open. | |
(BOOL) | - open |
Opens the connection to a device. | |
(void) | - close |
Closes this connection and releases any system resources associated with the connection. | |
(NSInteger) | - write:error: |
Writes the number of bytes from data to the connection. | |
(NSInteger) | - write:withOffset:andWithLength:error: |
Writes length bytes from data starting at offset . | |
(NSInteger) | - writeStream:error: |
Writes all available bytes from the data source to the connection. | |
(NSData *) | - read: |
Reads all the available data from the connection. | |
(void) | - read:error: |
Reads all the available data from the connection and write it to destinationStream . | |
(NSString *) | - getSimpleConnectionName |
Return a human-readable description of the connection. | |
(BOOL) | - hasBytesAvailable |
Returns YES if at least one byte is available for reading from this connection. | |
(void) | - waitForData: |
Causes the currently executing thread to sleep until hasBytesAvailable equals YES , or for a maximum of maxTimeout milliseconds. | |
(NSData *) | - sendAndWaitForResponse:withResponseValidator:withError: |
Sends data and returns the response data. | |
(NSData *) | - sendAndWaitForResponse:withMaxTimeoutForRead:andWithTimeToWaitForMoreData:withResponseValidator:andWithError: |
Sends data and returns the response data. | |
Establishes a Bluetooth connection to a printer.
- (id) initWithSerialNumber: | (NSString *) | aSerialNumber |
Initializes a new instance of the MfiBtPrinterConnection class.
This constructor will use the default timeouts for read: (ZebraPrinterConnection-p). The default timeout is a maximum of 10 seconds for any data to be received. If no more data is available after 500 milliseconds the read operation is assumed to be complete.
To specify timeouts other than the defaults, use:
initWithSerialNumber:withMaxTimeoutForRead:andWithTimeToWaitForMoreData:
aSerialNumber | The device's serial number. serialNumber is a property of EAAccessory. |
- (id) initWithSerialNumber: | (NSString *) | aSerialNumber | |
withMaxTimeoutForRead: | (NSInteger) | aMaxTimeoutForRead | |
andWithTimeToWaitForMoreData: | (NSInteger) | aTimeToWaitForMoreData | |
Initializes a new instance of the MfiBtPrinterConnection class.
This constructor will use the specified timeouts for read: (ZebraPrinterConnection-p). The timeout is a maximum of maxTimeoutForRead
milliseconds for any data to be received. If no more data is available after timeToWaitForMoreData
milliseconds the read operation is assumed to be complete.
aSerialNumber | The device's serial number. serialNumber is a property of EAAccessory. |
aMaxTimeoutForRead | The maximum time, in milliseconds, to wait for any data to be received. |
aTimeToWaitForMoreData | The maximum time, in milliseconds, to wait in-between reads after the initial read. |
- (void) setTimeToWaitAfterReadInMilliseconds: | (NSInteger) | aTimeInMs |
Overrides the time the read: method will wait after writing data to the stream.
The default time is 10ms. This method is used to adapt to different Bluetooth radio performance requirements. If you notice an issue writing bytes, try increasing this time.
aTimeInMs | Time in milliseconds to wait between reads. |
- (void) setTimeToWaitAfterWriteInMilliseconds: | (NSInteger) | aTimeInMs |
Overrides the time the write: method will wait after writing data to the stream.
The default time is 60ms. This method is used to adapt to different Bluetooth radio performance requirements. If you notice an issue writing bytes, try increasing this time.
aTimeInMs | Time in milliseconds to wait between writes. |
- (void) setTimeToWaitBeforeCloseInMilliseconds: | (NSInteger) | aTimeInMs |
Overrides the time the close: method will wait before closing the connection.
The default time is 5000ms. This method is used to adapt to different Bluetooth radio performance requirements. If you notice an issue writing bytes, try increasing this time.
aTimeInMs | Time in milliseconds to wait between writes. |