|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopencard.opt.terminal.protocol.T1Protocol
public abstract class T1Protocol
T1Protocol is a small subset of the T1 block protocol. NOTE: T1Protocol IS NOT IN FINAL STATE!!!!!!!!!!!!!!! - chaining is not supported - EDC-byte calculation only with LDR (XORed), CRC is not provided. see ISO7816_3P9
Constructor Summary | |
---|---|
T1Protocol(int stdHostAddress,
int stdRemoteAddress,
int timeout)
Constructor with specification of the host- and remoteaddress |
Method Summary | |
---|---|
void |
close()
close should be called to deinitialize the object |
protected abstract T1Block |
exchangeData(T1Block sendBlock)
exchangeData responsible for the real data-transfer. |
int |
getBlockWaitingTime()
getBlockWaitingTime returns the currently used block waiting time in milliseconds. |
int |
getHostAddress()
getHostAddress |
int |
getRecvSequenceCounter()
getRecvSequenceCounter |
int |
getRemoteAddress()
getRemoteAddress |
int |
getSendSequenceCounter()
getSendSequenceCounter |
void |
incRecvSequenceCounter()
incRecvSequenceCounter |
void |
incSendSequenceCounter()
incSendSequenceCounter |
protected T1Block |
internalTransmit(int retryCount,
T1Block dataBlock)
internalTransmit exchanges blocks with T1 protocol handling. |
protected boolean |
isBlockComplete(byte[] rawBytes,
int len)
|
void |
open()
open should be called after creating a new object of this class. |
void |
setBlockWaitingTime(int timeout)
setBlockWaitingTime sets the block waiting time in milliseconds. |
void |
setRecvSequenceCounter(int val)
setRecvSequenceCounter |
void |
setSendSequenceCounter(int val)
setSendSequenceCounter |
byte[] |
transmit(byte[] sendData)
transmit sends the data to the terminal and waits for result until timeout is reached. |
byte[] |
transmit(int remoteAddress,
byte[] sendData)
transmit sends the data to the terminal and waits for result until timeout is reached. |
byte[] |
transmit(int hostAddress,
int remoteAddress,
byte[] sendData)
transmit sends the data to the terminal and waits for result until timeout is reached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public T1Protocol(int stdHostAddress, int stdRemoteAddress, int timeout)
Method Detail |
---|
public void open() throws T1Exception
T1Exception
- thrown when error occured.public void close()
public int getBlockWaitingTime()
public void setBlockWaitingTime(int timeout)
public int getHostAddress()
public int getRemoteAddress()
public int getSendSequenceCounter()
public void setSendSequenceCounter(int val)
public void incSendSequenceCounter()
public int getRecvSequenceCounter()
public void setRecvSequenceCounter(int val)
public void incRecvSequenceCounter()
public byte[] transmit(byte[] sendData) throws T1IOException, T1TimeoutException, T1Exception
sendData
- data for the terminal
T1IOException
- thrown when IO error occurs (send- or receivemethods)
T1TimeoutException
- thrown when timeout limit reached for transmitting data
T1Exception
public byte[] transmit(int remoteAddress, byte[] sendData) throws T1IOException, T1TimeoutException, T1Exception
remoteAddress
- sendData
- data for the terminal
T1IOException
- thrown when IO error occurs (send- or receivemethods)
T1TimeoutException
- thrown when timeout limit reached for transmitting data
T1Exception
public byte[] transmit(int hostAddress, int remoteAddress, byte[] sendData) throws T1IOException, T1TimeoutException, T1Exception
hostAddress
- remoteAddress
- use another remote-address as previously given by constructor.sendData
- data for the terminal
T1IOException
- thrown when IO error occurs (send- or receivemethods)
T1TimeoutException
- thrown when timeout limit reached for transmitting data
T1Exception
protected boolean isBlockComplete(byte[] rawBytes, int len)
protected T1Block internalTransmit(int retryCount, T1Block dataBlock) throws T1Exception
retryCount
- number of retries left for transmitting data
if retryCount = 0 reached, transfer faileddataBlock
- application data block.
T1Execption
- thrown when error occurred.
T1Exception
protected abstract T1Block exchangeData(T1Block sendBlock) throws T1IOException, T1TimeoutException, T1BlockLengthException, T1UnknownBlockException, T1BlockEDCErrorException
sendBlock
- the T1-block with the send-data inside.
T1TimeoutException
- thrown when time is elapsed receiving a T1-block
T1BlockLengthException
- thrown when difference detected between calculated and received block length
T1UnknownBlockException
- thrown when blocktype could not be recognized
T1BlockEDCErrorException
- thrown when error detection code differs from the calculated value
T1IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |