Package uicc.toolkit
Interface EnvelopeHandler
- All Superinterfaces:
BERTLVViewHandler,ViewHandler
The
EnvelopeHandler interface contains basic methods to handle the Envelope
data field. A class implementing this interface will be used by the Toolkit
applet in order to have access to the current Envelope information. A class
implementing the EnvelopeHandler interface is a Temporary JCRE Entry Point Object
and can be retrieved by invoking the getTheHandler() method of the
EnvelopeHandlerSystem class.
Toolkit Applet Example:
private static final byte MY_TAG = (byte)0x54;
private byte[] data;
data = new byte[32];
void processToolkit(byte event) throws ToolkitException {
// get the EnvelopeHandler system instance
EnvelopeHandler theEnv = EnvelopeHandlerSystem.getTheHandler();
// look for MY_TAG TLV
if (theEnv.findTLV(MY_TAG, (byte)1) != TLV_NOT_FOUND) {
// check first element byte
if (theEnv.getValueByte((short)0) == (byte)1) {
// copy element part into data buffer
theEnv.copyValue((short)1,
data,
(short)0,
(short)(theEnv.getValueLength() - 1));
}
}
}
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbyteReturns the channel identifier value from the first Channel status TLV element in the current Envelope data field.shortgetChannelStatus(byte channelIdentifier) Returns the value of the first Channel Status TLV element whose channel identifier is equal to thechannelIdentifierparameter.byteReturns the item identifier byte value from the first Item Identifier TLV element in the current Envelope data field.Methods inherited from interface uicc.toolkit.BERTLVViewHandler
getSize, getTagMethods inherited from interface uicc.toolkit.ViewHandler
compareValue, copy, copyValue, findAndCompareValue, findAndCompareValue, findAndCopyValue, findAndCopyValue, findTLV, getCapacity, getLength, getValueByte, getValueLength, getValueShort
-
Method Details
-
getItemIdentifier
Returns the item identifier byte value from the first Item Identifier TLV element in the current Envelope data field. If the element is available it becomes the TLV selected.- Returns:
- item identifier
- Throws:
ToolkitException- with the following reason codes:UNAVAILABLE_ELEMENTin case of unavailable TLV elementOUT_OF_TLV_BOUNDARIESif the item identifier byte is missing in the Item Identifier Comprehension TLV.
-
getChannelIdentifier
Returns the channel identifier value from the first Channel status TLV element in the current Envelope data field. If the element is available it becomes the currently selected TLV.- Returns:
- channel identifier
- Throws:
ToolkitException- - with the following reason codes:UNAVAILABLE_ELEMENTin case of unavailable TLV element.OUT_OF_TLV_BOUNDARIESif the Comprehension TLV Channels Status length is equal to zero.
-
getChannelStatus
Returns the value of the first Channel Status TLV element whose channel identifier is equal to thechannelIdentifierparameter. If the element is available it becomes the currently selected TLV element.- Parameters:
channelIdentifier- the channel number- Returns:
- channel identifier and status : MSB = byte 1 of the Channel Status TLV value (byte 3 of the Channel Status TLV element), LSB = byte 2 of the Channel Status TLV value (byte 4 of the Channel Status TLV element).
- Throws:
ToolkitException- with the following reason codes:UNAVAILABLE_ELEMENTif no Channel Status TLV element with the right identifier could be foundOUT_OF_TLV_BOUNDARIESif a Channel Status TLV element with the right identifier could be found but its value is less than 2 bytes long
-