Zebra LinkOS Multiplatform SDK for Xamarin
1.1
Link-OS Portable Class Library Plugin for Xamarin
|
A connection to a device. More...
Public Member Functions | |
void | Initialize (string connectionString) |
Create a new connection. More... | |
void | Open () |
Opens the connection to a device. More... | |
void | Close () |
Closes this connection and releases any system resources associated with the connection. More... | |
void | Write (byte[] data) |
Writes data.length bytes from the specified byte array to this output stream. 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... | |
int | BytesAvailable () |
Returns an estimate of the number of bytes that can be read from this connection without blocking. More... | |
Properties | |
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... | |
A connection to a device.
See IPrinterStatus for PreCheckPrinterStatus() and PostPrintCheckStatus() code.
int LinkOS.Plugin.Abstractions.IConnection.BytesAvailable | ( | ) |
Returns an estimate of the number of bytes that can be read from this connection without blocking.
Implemented in LinkOS.Plugin.ConnectionImplementation.
void LinkOS.Plugin.Abstractions.IConnection.Close | ( | ) |
Closes this connection and releases any system resources associated with the connection.
Implemented in LinkOS.Plugin.ConnectionImplementation.
void LinkOS.Plugin.Abstractions.IConnection.Initialize | ( | string | connectionString | ) |
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 |
Implemented in LinkOS.Plugin.ConnectionImplementation.
void LinkOS.Plugin.Abstractions.IConnection.Open | ( | ) |
Opens the connection to a device.
Implemented in LinkOS.Plugin.ConnectionImplementation.
byte [] LinkOS.Plugin.Abstractions.IConnection.Read | ( | ) |
Reads all the available data from the connection.
Implemented in LinkOS.Plugin.ConnectionImplementation.
byte [] LinkOS.Plugin.Abstractions.IConnection.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.
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. |
Implemented in LinkOS.Plugin.ConnectionImplementation.
void LinkOS.Plugin.Abstractions.IConnection.WaitForData | ( | int | maxTimeout | ) |
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. |
Implemented in LinkOS.Plugin.ConnectionImplementation.
void LinkOS.Plugin.Abstractions.IConnection.Write | ( | byte [] | data | ) |
Writes data.length bytes from the specified byte array to this output stream.
data | the data. |
Implemented in LinkOS.Plugin.ConnectionImplementation.
|
get |
Returns true if the connection is open.
|
getset |
Gets or sets the maximum time, in milliseconds, to wait for any data to be received. Recommended setting before opening the connection.
|
getset |
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.
|
getset |
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.
|
getset |
Gets or sets the maximum time, in milliseconds, to wait in-between reads after the initial read. Recommended setting before opening the connection.