|
ZSDK_API
1.4.948
|
A connection to a Zebra printer. More...
#import <ZebraPrinterConnection.h>
Instance Methods | |
| (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. | |
| (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. | |
| (NSData *) | - read: |
| Reads all the available data from 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. | |
A connection to a Zebra printer.
| - (void) close |
Closes this connection and releases any system resources associated with the connection.
If the connection is already closed then invoking this method has no effect.
| - (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.
| - (BOOL) hasBytesAvailable |
Returns YES if at least one byte is available for reading from this connection.
YES if there is data avaiilable. | - (BOOL) isConnected |
Returns YES if the connection is open.
YES if this connection is open. | - (BOOL) open |
| - (NSData *) read: | (NSError **) | error |
Reads all the available data from the connection.
This call is non-blocking.
| error | Will be set to the error that occured. |
nil if an error occurred. | - (NSString *) toString |
See the classes which implement this method for the format of the description string.
| - (void) waitForData: | (NSInteger) | maxTimeout |
Causes the currently executing thread to sleep until hasBytesAvailable equals YES, or for a maximum of maxTimeout milliseconds.
| maxTimeout | Maximum time in milliseconds to wait for an initial response from the printer. |
| - (NSInteger) write: | (NSData *) | data | |
| error: | (NSError **) | error | |
Writes the number of bytes from data to the connection.
The connection must be open before this method is called. If write:error: is called when a connection is closed, -1 is returned.
| data | The data. |
| error | Will be set to the error that occured. |