uicc.hci.framework
Interface HCIMessage

All Known Subinterfaces:
CardEmulationMessage, ConnectivityMessage, ReaderMessage

public interface HCIMessage

An instance of HCIMessage is used to get access to the content of a received HCI message.

Sub interfaces will typically have additional methods for sending HCI service specific HCI messages.

Instances of HCIMessage hide the fragmentation of messages on the HCI layer (see TS 102 622). However, as receive and send buffers with limited capacity will be used (size depends on the Applet itself) it provides methods to check if a message is complete (see isHeading() and isComplete()) in order to support streaming of long messages. (editors note: move statements about buffer sizes from getReceiveBuffer()to the previous paragraph.) (editor's note: check what the following sentence means:) in order to chain multiple trigger session the Applet will need to use applicative callback for consume or produce the message.

Notes:

See Also:
HCIListener

Field Summary
static byte INS_ANY_CLOSE_PIPE
          The command to close a pipe
static byte INS_ANY_GET_PARAMETER
          The command to get a parameter from a registry
static byte INS_ANY_OPEN_PIPE
          The command to open a pipe
static byte INS_ANY_SET_PARAMETER
          The command to set a parameter in a registry
static byte RESP_ADM_E_NO_PIPES_AVAILABLE
          no more dynamic pipes can be created
static byte RESP_ANY_E_CMD_NOT_SUPPORTED
          the command is not supported by the gate
static byte RESP_ANY_E_CMD_PAR_UNKNOWN
          the format of the command parameters is wrong
static byte RESP_ANY_E_INHIBITED
          command is inhibited due to failure of lower layer identity check
static byte RESP_ANY_E_NOK
          command was rejected and/or not completed
static byte RESP_ANY_E_NOT_CONNECTED
          the destination host is not connected
static byte RESP_ANY_E_PIPE_ACCESS_DENIED
          Permission denied to create a pipe due to a WHITELIST violation
static byte RESP_ANY_E_PIPE_NOT_OPENED
          the pipe is not open
static byte RESP_ANY_E_REG_ACCESS_DENIED
          permission denied to write/read a value to/from a registry
static byte RESP_ANY_E_REG_PAR_UNKNOWN
          the registry parameter identifier is either unknown to the registry or an optional registry parameter is not implemented
static byte RESP_ANY_OK
          command completed successfully (with optional parameters)
static byte TYPE_COMMAND
          a command
static byte TYPE_EVENT
          an event
static byte TYPE_RESPONSE
          a response
 
Method Summary
 byte getInstruction()
          editor's note: check if needed and reword or delete accordingly). Returns the message instruction (b6-b1 of the message header) from the current incomming HCI message, see TS 102 622 for further information.
 byte[] getReceiveBuffer()
          Return a refernce to the underlying HCI message receive buffer.
 short getReceiveLength()
          This method gives the length of the received message data. Editor: is this length that is received or that is copied into the buffer? If the message is not complete then the returned value is the actual message fragment length.
 short getReceiveOffset()
          This method gives the offset to the received message data in the receive buffer.
 byte getType()
          Checks the type of the incomming HCI message editor's note: check if this method is still needed. Does this statement provide any value
 boolean isComplete()
          Cheks for the completnes of the HCI message.
 boolean isHeading()
          Checks if this is the heading part of an HCI message The heading information indicates the first part of an HCI message with isComplete() it is possible to check weather the complete message has already been received.
 

Field Detail

TYPE_COMMAND

static final byte TYPE_COMMAND
a command

See Also:
Constant Field Values

TYPE_EVENT

static final byte TYPE_EVENT
an event

See Also:
Constant Field Values

TYPE_RESPONSE

static final byte TYPE_RESPONSE
a response

See Also:
Constant Field Values

INS_ANY_SET_PARAMETER

static final byte INS_ANY_SET_PARAMETER
The command to set a parameter in a registry

See Also:
Constant Field Values

INS_ANY_GET_PARAMETER

static final byte INS_ANY_GET_PARAMETER
The command to get a parameter from a registry

See Also:
Constant Field Values

INS_ANY_OPEN_PIPE

static final byte INS_ANY_OPEN_PIPE
The command to open a pipe

See Also:
Constant Field Values

INS_ANY_CLOSE_PIPE

static final byte INS_ANY_CLOSE_PIPE
The command to close a pipe

See Also:
Constant Field Values

RESP_ANY_OK

static final byte RESP_ANY_OK
command completed successfully (with optional parameters)

See Also:
Constant Field Values

RESP_ANY_E_NOT_CONNECTED

static final byte RESP_ANY_E_NOT_CONNECTED
the destination host is not connected

See Also:
Constant Field Values

RESP_ANY_E_CMD_PAR_UNKNOWN

static final byte RESP_ANY_E_CMD_PAR_UNKNOWN
the format of the command parameters is wrong

See Also:
Constant Field Values

RESP_ANY_E_NOK

static final byte RESP_ANY_E_NOK
command was rejected and/or not completed

See Also:
Constant Field Values

RESP_ADM_E_NO_PIPES_AVAILABLE

static final byte RESP_ADM_E_NO_PIPES_AVAILABLE
no more dynamic pipes can be created

See Also:
Constant Field Values

RESP_ANY_E_REG_PAR_UNKNOWN

static final byte RESP_ANY_E_REG_PAR_UNKNOWN
the registry parameter identifier is either unknown to the registry or an optional registry parameter is not implemented

See Also:
Constant Field Values

RESP_ANY_E_PIPE_NOT_OPENED

static final byte RESP_ANY_E_PIPE_NOT_OPENED
the pipe is not open

See Also:
Constant Field Values

RESP_ANY_E_CMD_NOT_SUPPORTED

static final byte RESP_ANY_E_CMD_NOT_SUPPORTED
the command is not supported by the gate

See Also:
Constant Field Values

RESP_ANY_E_INHIBITED

static final byte RESP_ANY_E_INHIBITED
command is inhibited due to failure of lower layer identity check

See Also:
Constant Field Values

RESP_ANY_E_REG_ACCESS_DENIED

static final byte RESP_ANY_E_REG_ACCESS_DENIED
permission denied to write/read a value to/from a registry

See Also:
Constant Field Values

RESP_ANY_E_PIPE_ACCESS_DENIED

static final byte RESP_ANY_E_PIPE_ACCESS_DENIED
Permission denied to create a pipe due to a WHITELIST violation

See Also:
Constant Field Values
Method Detail

isHeading

boolean isHeading()
Checks if this is the heading part of an HCI message The heading information indicates the first part of an HCI message with isComplete() it is possible to check weather the complete message has already been received.

The preparing of an outgoing message (command response or event) will reset the current HCI message states according the outgoing message.

Returns:
true if the current message is the heading part of the message e.g the first part of an incoming message.

isComplete

boolean isComplete()
Cheks for the completnes of the HCI message.

The preparing of an outgoing message (command response or event) will reset the current HCI message states according the outgoing message.

Returns:
true if the message is complete

getType

byte getType()
Checks the type of the incomming HCI message editor's note: check if this method is still needed. Does this statement provide any value

Please note that in the case of a fragmented incoming message the type is keep in memory even if the data processed is no more in the first heading packet.

Returns:
return the message type, must be one of constant values TYPE_* defined in this interface

getInstruction

byte getInstruction()
editor's note: check if needed and reword or delete accordingly). Returns the message instruction (b6-b1 of the message header) from the current incomming HCI message, see TS 102 622 for further information. Does this statement provide any value

In the case of a fragmented incoming message the instruction is kept in memory even if the data processed is no more in the first heading packet.

The preparing of an outgoing message (command response or event) will reset the current HCI message states and set them according the outgoing message.

Returns:
return the message instruction, must be one of constant values INS_* defined in this interface

getReceiveBuffer

byte[] getReceiveBuffer()
Return a refernce to the underlying HCI message receive buffer. The length of this buffer is system dependend. The framework implementation shall guarantee a buffer size to receive a message of min. 270 bytes.

When the listener is triggered with an incoming message the usable data shall be found in the buffer returned by this method, starting at the offset gven by the method getReceiveOffset(). The length of the received message or message fragment can be retrieved from getReceiveLength().

Returns:
the buffer holding the current HCI message.

getReceiveOffset

short getReceiveOffset()
This method gives the offset to the received message data in the receive buffer.

Returns:
the offset into the buffer, retrieved via getReceiveBuffer().

getReceiveLength

short getReceiveLength()
This method gives the length of the received message data. Editor: is this length that is received or that is copied into the buffer? If the message is not complete then the returned value is the actual message fragment length.

Returns:
the message data length available in the receive buffer.