TLP224Message (Java Card 3 Platform, APDU I/O Library)
Date: 2009-11-05

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.javacard.apduio
Class TLP224Message

    java.lang.Object
      com.sun.javacard.apduio.TLP224Message

    public class TLP224Message

extends java.lang.Object

The TLP224Message class represents the link level message between a CAD (Card Acceptance Device) and a Terminal. All messages exchanged between the CAD and the Terminal are encoded using the TLP224 protocol. TLP224Messages are used internally in the apduio package to maintain context on the server side and to send commands to and from the client.

Field Summary
`static int` | `ACK` This field contains the ACK code which is returned to the sender as the first octet of a TLP224 response when a message has been successfully received.
`static int` | `EOT` This field contains the EOT code which is always sent as the last octet of any TLP224 message.
`static int` | `ISO_INPUT` This field contains the TLP224 command to send data to the card.
`static int` | `ISO_OUTPUT` This field contains the TLP224 command to read data from the card.
`static int` | `MAX_MESSAGE_LEN` This field contains the size of the largest possible TLP224 Message.
`static int` | `NACK` This field contains the NACK code which is returned to the sender as the first octet of a TLP224 response when a transmission error occurs.
`static int` | `POWER_DOWN` This field contains the TLP224 command to power down the CAD.
`static int` | `POWER_UP` This field contains the TLP224 command to power up the CAD.
`static int` | `STATUS_CARD_ABORTED_CHAINING` This status code is returned by the reader or ServerCad if the card aborts T=1 chaining.
`static int` | `STATUS_CARD_ERROR` This status code is returned by the reader or ServerCad if SW1 SW2 are not equal to 0x9000
`static int` | `STATUS_CARD_MALFUNCTION` This status code is returned by the reader or ServerCad if the card does not respond to a reset or times out during an exchange.
`static int` | `STATUS_CARD_MISSING` This status code is returned by the reader or ServerCad if there is no card in the reader.
`static int` | `STATUS_CARD_PROTOCOL_ERROR` This status code is returned by the reader or Server CAD when a Card Protocol T=0/T=1 error occurs.
`static int` | `STATUS_CARD_REMOVED` This status code is returned by the reader or ServerCad if the card was removed between exchanges.
`static int` | `STATUS_CARD_TURNED_OFF` This status code is returned by the Server CAD when an ISO_INPUT or ISO_OUTPUT command has been issued without first issuing a TLP224 POWER_UP command.
`static int` | `STATUS_COMMAND_UNKNOWN` This status code is returned by both the Client and Server CAD's when an unknown command has been issued.
`static int` | `STATUS_INCORRECT_NUMBER_OF_ARGS` This status code is returned by both the Client and Server CAD's when a command has been issued with an incorrect number of parameters.
`static int` | `STATUS_INTERRUPTED_EXCHANGE` This status code is returned by the reader or ServerCad if the card sends a Procedure Byte which aborts a ISO_IN or ISO_OUT command.
`static int` | `STATUS_INVALID_PROCEDURE_BYTE` This status code is returned by the reader or ServerCad if the card sends the reader or ServerCad an invalid procedure byte.
`static int` | `STATUS_ISO_CMD_ERROR` This status code is returned by the Server CAD when an ISO_INPUT or ISO_OUTPUT command has been issued and the INS byte contains either a 0x6x or 0x9x value.
`static int` | `STATUS_ISO_LC_ERROR` This status code is returned by the Server CAD when the P3 parameter in the ISO 7816-4 header does not correspond to the actual length of the data sent to or from the card.
`static int` | `STATUS_MESSAGE_TOO_LONG` This status code is returned by both the Client and Server CAD's when a received message exceeds the length of the internal buffers.
`static int` | `STATUS_PROTOCOL_ERROR` This status code is returned by both the Client and Server CAD's when the first byte of a received message is neither an ACK or NACK.
`static int` | `STATUS_READER_ABORTED_CHAINING` This status code is returned by the reader or ServerCad if the reader or ServerCad aborts T=1 chaining.
`static int` | `STATUS_SUCCESS` This status code is returned by both the Client and Server CAD's when a command has been successfully executed.
`static int` | `STATUS_UNKNOWN_PROTOCOL` This status code is returned by the reader or Server CAD when an unknown or unsupported protocol error occurs.

Method Summary
`void` | `setLength(int newLen)` Set the length of the data in this TLP224Message.
`java.lang.String` | `toString()` Generates a String representation of the TLP224 Message.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### EOT

    public static final int EOT

  This field contains the EOT code which is always sent as the last octet of any TLP224 message.

  See Also:
    Constant Field Values

### ACK

    public static final int ACK

  This field contains the ACK code which is returned to the sender as the first octet of a TLP224 response when a message has been successfully received.

  See Also:
    Constant Field Values

### NACK

    public static final int NACK

  This field contains the NACK code which is returned to the sender as the first octet of a TLP224 response when a transmission error occurs.

  See Also:
    Constant Field Values

### POWER_DOWN

    public static final int POWER_DOWN

  This field contains the TLP224 command to power down the CAD.

  See Also:
    Constant Field Values

### POWER_UP

    public static final int POWER_UP

  This field contains the TLP224 command to power up the CAD.

  See Also:
    Constant Field Values

### ISO_INPUT

    public static final int ISO_INPUT

  This field contains the TLP224 command to send data to the card.

  See Also:
    Constant Field Values

### ISO_OUTPUT

    public static final int ISO_OUTPUT

  This field contains the TLP224 command to read data from the card.

  See Also:
    Constant Field Values

### STATUS_SUCCESS

    public static final int STATUS_SUCCESS

  This status code is returned by both the Client and Server CAD's when a command has been successfully executed.

  See Also:
    Constant Field Values

### STATUS_INCORRECT_NUMBER_OF_ARGS

    public static final int STATUS_INCORRECT_NUMBER_OF_ARGS

  This status code is returned by both the Client and Server CAD's when a command has been issued with an incorrect number of parameters.

  See Also:
    Constant Field Values

### STATUS_COMMAND_UNKNOWN

    public static final int STATUS_COMMAND_UNKNOWN

  This status code is returned by both the Client and Server CAD's when an unknown command has been issued.

  See Also:
    Constant Field Values

### STATUS_PROTOCOL_ERROR

    public static final int STATUS_PROTOCOL_ERROR

  This status code is returned by both the Client and Server CAD's when the first byte of a received message is neither an ACK or NACK.

  See Also:
    Constant Field Values

### STATUS_ISO_CMD_ERROR

    public static final int STATUS_ISO_CMD_ERROR

  This status code is returned by the Server CAD when an ISO_INPUT or ISO_OUTPUT command has been issued and the INS byte contains either a 0x6x or 0x9x value.

  See Also:
    Constant Field Values

### STATUS_MESSAGE_TOO_LONG

    public static final int STATUS_MESSAGE_TOO_LONG

  This status code is returned by both the Client and Server CAD's when a received message exceeds the length of the internal buffers.

  See Also:
    Constant Field Values

### STATUS_CARD_TURNED_OFF

    public static final int STATUS_CARD_TURNED_OFF

  This status code is returned by the Server CAD when an ISO_INPUT or ISO_OUTPUT command has been issued without first issuing a TLP224 POWER_UP command.

  See Also:
    Constant Field Values

### STATUS_UNKNOWN_PROTOCOL

    public static final int STATUS_UNKNOWN_PROTOCOL

  This status code is returned by the reader or Server CAD when an unknown or unsupported protocol error occurs.

  See Also:
    Constant Field Values

### STATUS_ISO_LC_ERROR

    public static final int STATUS_ISO_LC_ERROR

  This status code is returned by the Server CAD when the P3 parameter in the ISO 7816-4 header does not correspond to the actual length of the data sent to or from the card.

  See Also:
    Constant Field Values

### STATUS_CARD_PROTOCOL_ERROR

    public static final int STATUS_CARD_PROTOCOL_ERROR

  This status code is returned by the reader or Server CAD when a Card Protocol T=0/T=1 error occurs.

  See Also:
    Constant Field Values

### STATUS_CARD_MALFUNCTION

    public static final int STATUS_CARD_MALFUNCTION

  This status code is returned by the reader or ServerCad if the card does not respond to a reset or times out during an exchange.

  See Also:
    Constant Field Values

### STATUS_CARD_ABORTED_CHAINING

    public static final int STATUS_CARD_ABORTED_CHAINING

  This status code is returned by the reader or ServerCad if the card aborts T=1 chaining.

  See Also:
    Constant Field Values

### STATUS_READER_ABORTED_CHAINING

    public static final int STATUS_READER_ABORTED_CHAINING

  This status code is returned by the reader or ServerCad if the reader or ServerCad aborts T=1 chaining.

  See Also:
    Constant Field Values

### STATUS_INVALID_PROCEDURE_BYTE

    public static final int STATUS_INVALID_PROCEDURE_BYTE

  This status code is returned by the reader or ServerCad if the card sends the reader or ServerCad an invalid procedure byte.

  See Also:
    Constant Field Values

### STATUS_INTERRUPTED_EXCHANGE

    public static final int STATUS_INTERRUPTED_EXCHANGE

  This status code is returned by the reader or ServerCad if the card sends a Procedure Byte which aborts a ISO_IN or ISO_OUT command.

  See Also:
    Constant Field Values

### STATUS_CARD_ERROR

    public static final int STATUS_CARD_ERROR

  This status code is returned by the reader or ServerCad if SW1 SW2 are not equal to 0x9000

  See Also:
    Constant Field Values

### STATUS_CARD_REMOVED

    public static final int STATUS_CARD_REMOVED

  This status code is returned by the reader or ServerCad if the card was removed between exchanges.

  See Also:
    Constant Field Values

### STATUS_CARD_MISSING

    public static final int STATUS_CARD_MISSING

  This status code is returned by the reader or ServerCad if there is no card in the reader.

  See Also:
    Constant Field Values

### MAX_MESSAGE_LEN

    public static final int MAX_MESSAGE_LEN

  This field contains the size of the largest possible TLP224 Message. This message would be <255 bytes of command>

  See Also:
    Constant Field Values

Method Detail

### setLength

    public void setLength(int newLen)

  Set the length of the data in this TLP224Message. The length must be less than or equal to the length of the internal buffer.

  Parameters:
    `newLen` - The length to set.
  Throws:
    `java.lang.IllegalArgumentException` - if newLen is greater than the length of the internal buffer.

### toString

    public java.lang.String toString()

  Generates a String representation of the TLP224 Message.

  This method generates this TLP224Message's string representation, which consists of a list of comma separated hexadecimal digits. This method is typically used for debugging.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    A non-null String representing the TLP224Message's state.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.