|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.jc.JCTerminal
com.ibm.jc.terminal.RemoteJCTerminal
Establish a socket connection to a remove terminal/card. The server part can be either a terminal server enabling remote access to a terminal device or it can be the JCOP simulation that simulates a real card and terminal.
Each message has the following format:
| Byte # | Abbr. | Meaning |
|---|---|---|
| 0 | MTY | Message type |
| 1 | NAD | Node addess |
| 2 | LNH | High byte of payload length |
| 3 | LNL | Low byte of payload length |
| 4... | PY0 | First byte of payload (interpretation depends on message type) |
| ...3+(LNH*256)+LNL | PYn | Last byte of payload |
The client sends a message and the terminal server responds with a message. Request and response message must have the same MTY and NAD field. Length and payload of the messages may differ. A value of 0 for NAD means client to card communication.
The following types of messages are defined:
| Field Summary |
| Fields inherited from class com.ibm.jc.JCTerminal |
CARD_PRESENT, ERROR, NOT_CONNECTED, PROTOCOL_T0, PROTOCOL_T1, PROTOCOL_TCL, SLOT_EMPTY |
| Constructor Summary | |
RemoteJCTerminal()
|
|
| Method Summary | |
void |
close()
Close socket connection. |
byte[] |
debug(byte[] data,
int offset,
int len)
Exchange debug message with terminal/card simulator. |
java.lang.String |
getErrorMessage()
|
int |
getState()
|
JCTerminal |
init(java.lang.Object param)
Initialize terminal. |
void |
open()
Open the card terminal. |
byte[] |
send(int nad,
byte[] toSend,
int offset,
int len)
Send data to the card terminal. |
int |
send(int mty,
int nad,
byte[] toSend,
int offset,
int len)
|
java.lang.String |
toString()
|
byte[] |
waitForCard(int time)
Try to get an ATR from socket peer. |
| Methods inherited from class com.ibm.jc.JCTerminal |
filterFor, filterFor, generateParityError, getInstance, ioctl, pps, send, sendraw |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RemoteJCTerminal()
| Method Detail |
public JCTerminal init(java.lang.Object param)
init in class JCTerminalparam - param has the form "[HOST:]PORT[/REMOTE]]" with REMOTE and HOST
being optional. HOST specifies the remote host (default localhost)
and PORT the port to contact. REMOTE is a string used to initialize
remote terminal server. If omitted no remote initializtion message
will be sent. If param is null it defaults to "localhost:8050".
public java.lang.String toString()
toString in class JCTerminalpublic java.lang.String getErrorMessage()
getErrorMessage in class JCTerminalpublic void open()
open in class JCTerminalpublic void close()
close in class JCTerminalJCTerminal.open()public byte[] waitForCard(int time)
waitForCard in class JCTerminaltime - the calls blocks for specified milliseconds.
public int getState()
getState in class JCTerminal
public byte[] send(int nad,
byte[] toSend,
int offset,
int len)
send in class JCTerminaltoSend - byte array containing data to be sendoffset - offset starting at which data sending is to beginlen - number of bytes to be transmittednad - node address to which data is being sent
JCException - if communication failed or if some parameters are wrongcom.ibm.jc.JCard.send
public byte[] debug(byte[] data,
int offset,
int len)
public int send(int mty,
int nad,
byte[] toSend,
int offset,
int len)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||