Zebra LinkOS Multiplatform SDK for Xamarin
1.1
Link-OS Portable Class Library Plugin for Xamarin
|
The OS specific implementation of an IConnection More...
Public Member Functions | |
int | BytesAvailable () |
Returns an estimate of the number of bytes that can be read from this connection without blocking. More... | |
void | Close () |
Closes this connection and releases any system resources associated with the connection. More... | |
void | Initialize (string connectionString) |
Create a new connection. More... | |
void | Open () |
Opens the connection to a device. More... | |
byte[] | Read () |
Reads all the available data from the connection. More... | |
byte[] | SendAndWaitForResponse (byte[] dataToSend, int initialResponseTimeout, int responseCompletionTimeout, string terminator=null) |
Sends dataToSend and returns the response data. The software returns immediately if the data received contains terminator. The connection must be open before this method is called. If sendAndWaitForResponse is called when a connection is closed, a ConnectionException is thrown. More... | |
void | WaitForData (int maxTimeout) |
Causes the currently executing thread to sleep until bytesAvailable() > 0, or for a maximum of maxTimeout milliseconds. More... | |
void | Write (byte[] data) |
Writes data.length bytes from the specified byte array to this output stream. More... | |
Additional Inherited Members | |
Properties inherited from LinkOS.Plugin.Abstractions.IConnection | |
bool | IsConnected [get] |
Returns true if the connection is open. More... | |
int | MaxTimeoutForRead [get, set] |
Gets or sets the maximum time, in milliseconds, to wait for any data to be received. Recommended setting before opening the connection. More... | |
int | TimeToWaitForMoreData [get, set] |
Gets or sets the maximum time, in milliseconds, to wait in-between reads after the initial read. Recommended setting before opening the connection. More... | |
int | TimeToWaitAfterWrite [get, set] |
Ignored in Android. In iOS Bluetooth -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 issues writing bytes, try increasing this time. More... | |
int | TimeToWaitAfterRead [get, set] |
Ignored in Android. In iOS Bluetooth -overrides the time the read() method will wait after reading data from the stream. The default time is 10ms. This method is used to adapt to different Bluetooth radio performance requirements. If you notice an issues writing bytes, try increasing this time. More... | |
The OS specific implementation of an IConnection
|
inline |
Returns an estimate of the number of bytes that can be read from this connection without blocking.
Implements LinkOS.Plugin.Abstractions.IConnection.
|
inline |
Closes this connection and releases any system resources associated with the connection.
Implements LinkOS.Plugin.Abstractions.IConnection.
|
inline |
Create a new connection.
connectionString | The format of the input string is: [prefix:] address [: port_number(s)] Prefix is either TCP_MULTI, TCP, TCP_STATUS, BT_MULTI, BT, or BT_STATUS The format of address depends on the prefix and OS: BT : Android - address is the printer's BT MAC address. iOS - address is the printer's serial number. TCP : Android - address is either a DNS name or an IPv4 address. iOS - address is an IPv4 address. port_number(s) is optional, and only applicable for TCP connections. iOS Considerations:TCP_MULTI, BT_MULTI, and BT_STATUS are not availible. TCP IPv4 address only, DNS name not supported. Examples : TCP:ZBR3054027:9100
TCP_STATUS:10.1.2.3
BT:11:22:33:44:55:66
BT:XXQLJ112000026
10.1.2.3
|
Implements LinkOS.Plugin.Abstractions.IConnection.
|
inline |
Opens the connection to a device.
Implements LinkOS.Plugin.Abstractions.IConnection.
|
inline |
Reads all the available data from the connection.
Implements LinkOS.Plugin.Abstractions.IConnection.
|
inline |
Sends dataToSend and returns the response data. The software returns immediately if the data received contains terminator. The connection must be open before this method is called. If sendAndWaitForResponse is called when a connection is closed, a ConnectionException is thrown.
dataToSend | byte array of data to send |
initialResponseTimeout | The maximum time, in milliseconds, to wait for the initial response to be received. If no data is received during this time, the function returns a zero length array |
responseCompletionTimeout | After the initial response, if no data is received for this period of time, the input is considered complete and the method returns |
terminator | If the response contains this string, the input is considered complete and the method returns. May be used to avoid waiting for more data when the response is always terminated with a known string. Use null if no terminator is desired. |
Implements LinkOS.Plugin.Abstractions.IConnection.
|
inline |
Causes the currently executing thread to sleep until bytesAvailable() > 0, or for a maximum of maxTimeout milliseconds.
maxTimeout | maximum time in milliseconds to wait for an initial response from the printer. |
Implements LinkOS.Plugin.Abstractions.IConnection.
|
inline |
Writes data.length bytes from the specified byte array to this output stream.
data | the data. |
Implements LinkOS.Plugin.Abstractions.IConnection.