public interface HCIMessage
HCIMessage is used to get access to the content of a received
HCP message.
Every HCP message that is not longer then 270 bytes has to be presented to the
Applet as a complete message. In this case the contactless framework is responsible
to manage the defragmentation.
The contactless framework shall support outgoing HCIMessages of at least 256 bytes.
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 it provides methods to check if
a message is complete (see isHeading() and isComplete()) in order to support
streaming of long messages.
Instances of this object shall be temporary JCRE entry point objects.
When the applet is invoked by an event not related to an incoming HCI message (e.g. after
requestCallbackNotification method), HCIMessage) content is undefined.
HCIListener| Modifier and Type | Field and Description |
|---|---|
static byte |
RESP_ANY_E_CMD_NOT_SUPPORTED
the command is not supported by the gate
|
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_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
Indicates the HCI message type "command"
|
static byte |
TYPE_EVENT
Indicates the HCI message type "event"
|
static byte |
TYPE_RESPONSE
Indicates the HCI message type "response"
|
| Modifier and Type | Method and Description |
|---|---|
byte |
getInstruction()
Returns the instruction part of the HCP message header of the current
incoming HCP message, see TS 102 622 for further information.
|
byte[] |
getReceiveBuffer()
Return a reference to the underlying receive buffer.
|
short |
getReceiveLength()
This method returns the length of the data part of the the received HCP message.
|
short |
getReceiveOffset()
This method returns the offset of the data part of the the received HCP
message in the receive buffer.
|
byte |
getType()
Returns the type of the incomming HCI message
In the case of a fragmented incoming message this method shall return
the HCI message type coded in the first part of the HCI message.
|
boolean |
isComplete()
Checks for the completeness of the HCP message, i.e. the last received
HCP packet had the chaining bit CB set to 1.
|
boolean |
isHeading()
Checks if the current content contains the heading part of an HCP message
The heading information indicates the first part of an HCP message; with the
isComplete() method it is possible to check whether the complete HCP message
has already been received. |
static final byte TYPE_COMMAND
static final byte TYPE_EVENT
static final byte TYPE_RESPONSE
static final byte RESP_ANY_OK
static final byte RESP_ANY_E_NOT_CONNECTED
static final byte RESP_ANY_E_NOK
static final byte RESP_ANY_E_REG_PAR_UNKNOWN
static final byte RESP_ANY_E_PIPE_NOT_OPENED
static final byte RESP_ANY_E_CMD_NOT_SUPPORTED
static final byte RESP_ANY_E_INHIBITED
static final byte RESP_ANY_E_REG_ACCESS_DENIED
boolean isHeading()
isComplete() method it is possible to check whether the complete HCP message
has already been received.boolean isComplete()
byte getType()
In the case of a fragmented incoming message this method shall return the HCI message type coded in the first part of the HCI message.
TYPE_* defined in this interfacebyte getInstruction()
RESP_ANY_* constant defined in this interface may be used to check
the response which is contained in the instruction part.
In the case of a fragmented incoming message this method shall return the HCI message instruction coded in the first part of the HCI message.
byte[] getReceiveBuffer()
When the listener is invoked with an incoming message the usable data are contained in the buffer returned by this method.
getReceiveOffset() and has the length indicated by
getReceiveLength().
Note:
short getReceiveOffset()
getReceiveBuffer().short getReceiveLength()
requestCallbackNotification
method the return value shall be zero.