ds.ov2.util
Class Protocol

java.lang.Object
  extended by ds.ov2.util.Protocol

public class Protocol
extends Object

Runtime representation of a protocol of the OV-chip protocol layer. One protocol consists of a fixed list of steps (of type Protocol_step) that must be executed in the given order. Besides the protocol steps every protocol instance must contain its protocol identification number. This identification number must be identical to the index at which this instance is stored in the protocol array. Normally this is initialized in the right way by Registered_protocols.set_protocols.

Under normal circumstances the protocol instances are created and referenced in the *_description classes, which are generated by the IDL compiler. These classes are shared between the card and the host driver. It is important that the protocol instances on the host and the card are identical, otherwise the protocol layer will not work.

CPP Preprocessing
This class uses the following cpp defines: PACKAGE, PUBLIC,
Execution Environment:
host, card
Author:
Hendrik Tews
Version:
$Revision: 1.10 $
Last Commit:
$Date: 2009-05-20 11:02:38 $ by $Author: tews $

Field Summary
 byte protocol_id
          The protocol identification number.
 Protocol_step[] steps
          All steps of this protocol.
 
Constructor Summary
Protocol(Protocol_step[] steps)
          Create a new protocol instance, consisting of the steps in steps.
 
Method Summary
 void set_result_sizes()
          Update the cached length of the declared results in all steps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocol_id

public byte protocol_id
The protocol identification number. Will be send as INS byte in all APDU's for this protocol. Must be identical to the index at which this protocol is stored in the protocol array. Under normal circumstances this is initialized in Registered_protocols.set_protocols. In the constructor of this class the protocol id is initialized to -1, to provoke an error in the Host_protocol constructor if the protocol is used without being linked in some protocols array.


steps

public final Protocol_step[] steps
All steps of this protocol.

Constructor Detail

Protocol

public Protocol(Protocol_step[] steps)
Create a new protocol instance, consisting of the steps in steps. The field protocol_id is initialized to the invalid value -1. It must receive its value later, normally in Registered_protocols.set_protocols.

Parameters:
steps - the steps
Method Detail

set_result_sizes

public void set_result_sizes()
Update the cached length of the declared results in all steps. This is only necessary if the length of some result changes, for instance in test frames.