Zebra LinkOS Multiplatform SDK for Xamarin  1.1
Link-OS Portable Class Library Plugin for Xamarin
LinkOS.Plugin.ConnectionImplementation Class Reference

The OS specific implementation of an IConnection More...

Inheritance diagram for LinkOS.Plugin.ConnectionImplementation:
LinkOS.Plugin.Abstractions.IConnection

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

Detailed Description

The OS specific implementation of an IConnection

Member Function Documentation

int LinkOS.Plugin.ConnectionImplementation.BytesAvailable ( )
inline

Returns an estimate of the number of bytes that can be read from this connection without blocking.

Returns

Implements LinkOS.Plugin.Abstractions.IConnection.

void LinkOS.Plugin.ConnectionImplementation.Close ( )
inline

Closes this connection and releases any system resources associated with the connection.

Implements LinkOS.Plugin.Abstractions.IConnection.

void LinkOS.Plugin.ConnectionImplementation.Initialize ( string  connectionString)
inline

Create a new connection.

Parameters
connectionStringThe 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.

void LinkOS.Plugin.ConnectionImplementation.Open ( )
inline

Opens the connection to a device.

Implements LinkOS.Plugin.Abstractions.IConnection.

byte [] LinkOS.Plugin.ConnectionImplementation.Read ( )
inline

Reads all the available data from the connection.

Returns
received data

Implements LinkOS.Plugin.Abstractions.IConnection.

byte [] LinkOS.Plugin.ConnectionImplementation.SendAndWaitForResponse ( byte[]  dataToSend,
int  initialResponseTimeout,
int  responseCompletionTimeout,
string  terminator = null 
)
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.

Parameters
dataToSendbyte array of data to send
initialResponseTimeoutThe 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
responseCompletionTimeoutAfter the initial response, if no data is received for this period of time, the input is considered complete and the method returns
terminatorIf 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.
Returns
received data

Implements LinkOS.Plugin.Abstractions.IConnection.

void LinkOS.Plugin.ConnectionImplementation.WaitForData ( int  maxTimeout)
inline

Causes the currently executing thread to sleep until bytesAvailable() > 0, or for a maximum of maxTimeout milliseconds.

Parameters
maxTimeoutmaximum time in milliseconds to wait for an initial response from the printer.

Implements LinkOS.Plugin.Abstractions.IConnection.

void LinkOS.Plugin.ConnectionImplementation.Write ( byte[]  data)
inline

Writes data.length bytes from the specified byte array to this output stream.

Parameters
datathe data.

Implements LinkOS.Plugin.Abstractions.IConnection.


The documentation for this class was generated from the following file: