2010-01-26 1.2.0

org.eclipse.soda.dk.barcode.reader.transport
Class BarcodeReaderTransport

java.lang.Object
  extended by ConnectionTransport
      extended by org.eclipse.soda.dk.barcode.reader.transport.BarcodeReaderTransport
All Implemented Interfaces:
BarcodeReaderTransportService
Direct Known Subclasses:
BarcodeReaderExtendedTransport

public class BarcodeReaderTransport
extends ConnectionTransport
implements BarcodeReaderTransportService

Standard Barcode Reader.

The Device Kit properties CONNECTION_KEYS and default values.

barcodereadertransport.parity none
barcodereadertransport.readintervaltimeout 50
barcodereadertransport.readtotaltimeout 1000
barcodereadertransport.hardwareflowcontrol 0
barcodereadertransport.stopbits 1
barcodereadertransport.databits 8
barcodereadertransport.comport 1
barcodereadertransport.writetotaltimeout 100
barcodereadertransport.softwareflowcontrol 0
barcodereadertransport.baudrate 9600
barcodereadertransport.writesize -1
barcodereadertransport.host localhost
barcodereadertransport.linger -1
barcodereadertransport.readsize -1
barcodereadertransport.remoteport 8901
barcodereadertransport.readtimeout 1000
barcodereadertransport.localport -1
barcodereadertransport.connection serial
barcodereadertransport.delimiterChar -1
barcodereadertransport.endChar -1
barcodereadertransport.messageMinimumSize 1
barcodereadertransport.beginChar -1
barcodereadertransport.parity=none barcodereadertransport.readintervaltimeout=50 barcodereadertransport.readtotaltimeout=1000 barcodereadertransport.hardwareflowcontrol=0 barcodereadertransport.stopbits=1 barcodereadertransport.databits=8 barcodereadertransport.comport=1 barcodereadertransport.writetotaltimeout=100 barcodereadertransport.softwareflowcontrol=0 barcodereadertransport.baudrate=9600 barcodereadertransport.writesize=-1 barcodereadertransport.host=localhost barcodereadertransport.linger=-1 barcodereadertransport.readsize=-1 barcodereadertransport.remoteport=8901 barcodereadertransport.readtimeout=1000 barcodereadertransport.localport=-1 barcodereadertransport.connection=serial barcodereadertransport.delimiterChar=-1 barcodereadertransport.endChar=-1 barcodereadertransport.messageMinimumSize=1 barcodereadertransport.beginChar=-1

The list of exported services:

Since:
1.2
Version:
1.2.0
See Also:
BarcodeReaderTransportService, org.eclipse.soda.dk.transport.service.TransportService

Field Summary
static java.lang.String CLASS_NAME
          Defines the full class name.
 
Fields inherited from interface org.eclipse.soda.dk.barcode.reader.transport.service.BarcodeReaderTransportService
BEGIN_CHAR, BEGIN_CHAR_DEFAULT, BEGIN_CHAR_PROPERTY, DELIMITER_CHAR, DELIMITER_CHAR_DEFAULT, DELIMITER_CHAR_PROPERTY, END_CHAR, END_CHAR_DEFAULT, END_CHAR_PROPERTY, FACTORY_SERVICE_NAME, MANAGED_SERVICE_NAME, MESSAGE_BEGIN, MESSAGE_BEGIN_DEFAULT, MESSAGE_BEGIN_PROPERTY, MESSAGE_END, MESSAGE_END_DEFAULT, MESSAGE_END_PROPERTY, MESSAGE_MINIMUM_SIZE, MESSAGE_MINIMUM_SIZE_DEFAULT, MESSAGE_MINIMUM_SIZE_PROPERTY, SERIAL_BAUDRATE_DEFAULT, SERIAL_BAUDRATE_PROPERTY, SERIAL_COMPORT_DEFAULT, SERIAL_COMPORT_PROPERTY, SERIAL_DATABITS_DEFAULT, SERIAL_DATABITS_PROPERTY, SERIAL_HARDWAREFLOWCONTROL_DEFAULT, SERIAL_HARDWAREFLOWCONTROL_PROPERTY, SERIAL_PARITY_DEFAULT, SERIAL_PARITY_PROPERTY, SERIAL_READINTERVALTIMEOUT_DEFAULT, SERIAL_READINTERVALTIMEOUT_PROPERTY, SERIAL_READTOTALTIMEOUT_DEFAULT, SERIAL_READTOTALTIMEOUT_PROPERTY, SERIAL_SOFTWAREFLOWCONTROL_DEFAULT, SERIAL_SOFTWAREFLOWCONTROL_PROPERTY, SERIAL_STOPBITS_DEFAULT, SERIAL_STOPBITS_PROPERTY, SERIAL_WRITETOTALTIMEOUT_DEFAULT, SERIAL_WRITETOTALTIMEOUT_PROPERTY, SERVICE_NAME, TCPIP_HOST_DEFAULT, TCPIP_LINGER_DEFAULT, TCPIP_LINGER_PROPERTY, TCPIP_LOCALHOST_DEFAULT, TCPIP_LOCALHOST_PROPERTY, TCPIP_LOCALPORT_DEFAULT, TCPIP_LOCALPORT_PROPERTY, TCPIP_READSIZE_DEFAULT, TCPIP_READSIZE_PROPERTY, TCPIP_READTIMEOUT_DEFAULT, TCPIP_READTIMEOUT_PROPERTY, TCPIP_REMOTEHOST_DEFAULT, TCPIP_REMOTEHOST_PROPERTY, TCPIP_REMOTEPORT_DEFAULT, TCPIP_REMOTEPORT_PROPERTY, TCPIP_WRITESIZE_DEFAULT, TCPIP_WRITESIZE_PROPERTY
 
Constructor Summary
BarcodeReaderTransport()
          Constructs a new instance of the BarcodeReaderTransport class.
 
Method Summary
protected  void addToBufferedMessage(byte oneChar)
          Add to buffered message with the specified one char parameter.
protected  void addToBufferedMessage(byte[] message, int index, int length)
          Add to buffered message with the specified message, index and length parameters.
 int beginIndex(byte[] bytes, int length, byte[] begin, int index)
          Begin index with the specified bytes, length, begin and index parameters and return the int result.
protected  void clearBufferedMessage()
          Clear buffered message.
 byte getBeginChar()
          Gets the value of begin char custom parameter.
protected  byte[] getBufferedMessage()
          Gets the buffered message (byte[]) value.
 ConnectionService getDefaultConnection()
          Gets the default connection (ConnectionService) value.
 SerialConnectionService getDefaultSerialConnection()
          Gets the default serial connection (SerialConnectionService) value.
 TcpipConnectionService getDefaultTcpipConnection()
          Gets the default tcpip connection.
 byte getDelimiterChar()
          Gets the value of delimiter char custom parameter.
 byte getEndChar()
          Gets the value of end char custom parameter.
 byte[] getMessageBegin()
          Gets the value of message begin custom parameter.
 byte[] getMessageEnd()
          Gets the value of message end custom parameter.
 int getMessageMinimumSize()
          Gets the value of message minimum size custom parameter.
protected  void processBarcode(byte[] bytes, int beginIndex, int length)
          Process barcode with the specified bytes, begin index and length parameters.
protected  int processInput(byte[] bytes, int length)
          Process input with the specified bytes and length parameters and return the int result.
 boolean same(byte[] bytes, int length, byte[] begin, int index)
          Same with the specified bytes, length, begin and index parameters and return the boolean result.
protected  void sendBarcode(byte[] bytes, int index, int length)
          Send barcode with the specified bytes, index and length parameters.
 void setBeginChar(byte beginChar)
          Sets the value of begin char custom parameter.
 void setDelimiterChar(byte delimiterChar)
          Sets the value of delimiter char custom parameter.
 void setEndChar(byte endChar)
          Sets the value of end char custom parameter.
 void setMessageBegin(byte[] messageBegin)
          Sets the value of message begin custom parameter.
 void setMessageEnd(byte[] messageEnd)
          Sets the value of message end custom parameter.
 void setMessageMinimumSize(int messageMinimumSize)
          Sets the value of message minimum size custom parameter.
 void setup()
          Sets user-defined variables to use in the test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final java.lang.String CLASS_NAME
Defines the full class name.

Since:
1.1
See Also:
Constant Field Values
Constructor Detail

BarcodeReaderTransport

public BarcodeReaderTransport()
Constructs a new instance of the BarcodeReaderTransport class.

Since:
1.1
Method Detail

addToBufferedMessage

protected void addToBufferedMessage(byte oneChar)
Add to buffered message with the specified one char parameter.

Parameters:
oneChar - The one char (byte) parameter.
Since:
1.2
See Also:
addToBufferedMessage(byte[],int,int)

addToBufferedMessage

protected void addToBufferedMessage(byte[] message,
                                    int index,
                                    int length)
Add to buffered message with the specified message, index and length parameters.

Parameters:
message - The message (byte[]) parameter.
index - The index (int) parameter.
length - The length (int) parameter.
Since:
1.2
See Also:
addToBufferedMessage(byte)

beginIndex

public int beginIndex(byte[] bytes,
                      int length,
                      byte[] begin,
                      int index)
Begin index with the specified bytes, length, begin and index parameters and return the int result.

Parameters:
bytes - The bytes (byte[]) parameter.
length - The length (int) parameter.
begin - The begin (byte[]) parameter.
index - The index (int) parameter.
Returns:
Results of the begin index (int) value.
Since:
1.2

clearBufferedMessage

protected void clearBufferedMessage()
Clear buffered message.

Since:
1.2
See Also:
addToBufferedMessage(byte[],int,int), addToBufferedMessage(byte), getBufferedMessage()

getBeginChar

public byte getBeginChar()
Gets the value of begin char custom parameter.

Returns:
begin char custom parameter.
Since:
1.2
See Also:
setBeginChar(byte)

getBufferedMessage

protected byte[] getBufferedMessage()
Gets the buffered message (byte[]) value.

Returns:
The buffered message (byte[]) value.
Since:
1.2
See Also:
addToBufferedMessage(byte[],int,int), addToBufferedMessage(byte), clearBufferedMessage()

getDefaultConnection

public ConnectionService getDefaultConnection()
Gets the default connection (ConnectionService) value.

Returns:
ConnectionService The default connection used by this transport.
Since:
1.1

getDefaultSerialConnection

public SerialConnectionService getDefaultSerialConnection()
Gets the default serial connection (SerialConnectionService) value.

Returns:
SerialConnectionService The default serial connection used by this transport.
Since:
1.1

getDefaultTcpipConnection

public TcpipConnectionService getDefaultTcpipConnection()
Gets the default tcpip connection.

Returns:
TcpipConnectionService The default tcpip connection used by this transport.
Since:
1.1

getDelimiterChar

public byte getDelimiterChar()
Gets the value of delimiter char custom parameter.

Returns:
delimiter char custom parameter.
Since:
1.2
See Also:
setDelimiterChar(byte)

getEndChar

public byte getEndChar()
Gets the value of end char custom parameter.

Returns:
end char custom parameter.
Since:
1.2
See Also:
setEndChar(byte)

getMessageBegin

public byte[] getMessageBegin()
Gets the value of message begin custom parameter.

Returns:
message begin custom parameter.
Since:
1.2
See Also:
setMessageBegin(byte[])

getMessageEnd

public byte[] getMessageEnd()
Gets the value of message end custom parameter.

Returns:
message end custom parameter.
Since:
1.2
See Also:
setMessageEnd(byte[])

getMessageMinimumSize

public int getMessageMinimumSize()
Gets the value of message minimum size custom parameter.

Returns:
message minimum size custom parameter.
Since:
1.1
See Also:
setMessageMinimumSize(int)

processBarcode

protected void processBarcode(byte[] bytes,
                              int beginIndex,
                              int length)
                       throws java.lang.Exception
Process barcode with the specified bytes, begin index and length parameters.

Parameters:
bytes - The bytes (byte[]) parameter.
beginIndex - The begin index (int) parameter.
length - The length (int) parameter.
Throws:
java.lang.Exception - Exception.
Since:
1.2
See Also:
sendBarcode(byte[],int,int)

processInput

protected int processInput(byte[] bytes,
                           int length)
                    throws java.lang.Exception
Process input with the specified bytes and length parameters and return the int result.

Parameters:
bytes - The bytes (byte[]) parameter.
length - The length (int) parameter.
Returns:
Results of the process input (int) value.
Throws:
java.lang.Exception - Exception.

same

public boolean same(byte[] bytes,
                    int length,
                    byte[] begin,
                    int index)
Same with the specified bytes, length, begin and index parameters and return the boolean result.

Parameters:
bytes - The bytes (byte[]) parameter.
length - The length (int) parameter.
begin - The begin (byte[]) parameter.
index - The index (int) parameter.
Returns:
Results of the same (boolean) value.
Since:
1.2

sendBarcode

protected void sendBarcode(byte[] bytes,
                           int index,
                           int length)
                    throws java.lang.Exception
Send barcode with the specified bytes, index and length parameters.

Parameters:
bytes - The bytes (byte[]) parameter.
index - The index (int) parameter.
length - The length (int) parameter.
Throws:
java.lang.Exception - Exception.
Since:
1.2
See Also:
processBarcode(byte[],int,int)

setBeginChar

public void setBeginChar(byte beginChar)
Sets the value of begin char custom parameter.

Parameters:
beginChar - The begin char custom parameter.
Since:
1.2
See Also:
getBeginChar()

setDelimiterChar

public void setDelimiterChar(byte delimiterChar)
Sets the value of delimiter char custom parameter.

Parameters:
delimiterChar - The delimiter char custom parameter.
Since:
1.2
See Also:
getDelimiterChar()

setEndChar

public void setEndChar(byte endChar)
Sets the value of end char custom parameter.

Parameters:
endChar - The end char custom parameter.
Since:
1.2
See Also:
getEndChar()

setMessageBegin

public void setMessageBegin(byte[] messageBegin)
Sets the value of message begin custom parameter.

Parameters:
messageBegin - The message begin custom parameter.
Since:
1.2
See Also:
getMessageBegin()

setMessageEnd

public void setMessageEnd(byte[] messageEnd)
Sets the value of message end custom parameter.

Parameters:
messageEnd - The message end custom parameter.
Since:
1.2
See Also:
getMessageEnd()

setMessageMinimumSize

public void setMessageMinimumSize(int messageMinimumSize)
Sets the value of message minimum size custom parameter.

Parameters:
messageMinimumSize - The message minimum size custom parameter.
Since:
1.1
See Also:
getMessageMinimumSize()

setup

public void setup()
Sets user-defined variables to use in the test.

User defined properties and default values.

barcodereadertransport.messageMinimumSize 1
barcodereadertransport.messageBegin
barcodereadertransport.messageEnd
barcodereadertransport.beginChar -1
barcodereadertransport.endChar -1
barcodereadertransport.delimiterChar -1
retrytime RETRY_TIME_DEFAULT
transmitretries TRANSMIT_RETRIES_DEFAULT
noactivitytimeout NO_ACTIVITY_TIMEOUT_DEFAULT
barcodereadertransport.messageMinimumSize=1 barcodereadertransport.messageBegin= barcodereadertransport.messageEnd= barcodereadertransport.beginChar=-1 barcodereadertransport.endChar=-1 barcodereadertransport.delimiterChar=-1

Since:
1.1
See Also:
org.eclipse.soda.dk.transport.Transport#setup()

2010-01-26 1.2.0

Copyright (c) 2010 IBM. See license in Legal section.