| java.lang.Object sim.toolkit.ViewHandler sim.toolkit.EnvelopeHandler
EnvelopeHandler | final public class EnvelopeHandler extends ViewHandler (Code) | | The EnvelopeHandler class contains basic methods to handle the Envelope
data field. This class will be used by the Toolkit applet in order to
have access to the current Envelope information. No constructor is available
for the Toolkit applet. The EnvelopeHandler class is a Temporary JCRE
Entry Point Object. The only way to get a EnvelopeHandler reference is
through the getTheHandler() static method.
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 = EnvelopeHandler.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));
}
}
}
version: 8.3.0 See Also: ViewHandler See Also: EnvelopeResponseHandler See Also: ProactiveHandler See Also: ToolkitException |
Method Summary | |
public byte | getEnvelopeTag() Returns the Envelope BER-TLV tag. | public byte | getItemIdentifier() Returns the item identifier byte value from the first Item
Identifier TLV element in the current Envelope data field. | public short | getSecuredDataLength() Looks for the length of the Secured Data from the Command Packet
in the first SMS TPDU or Cell Broadcast Page Simple TLV contained
in the Envelope handler. | public short | getSecuredDataOffset() Looks for the Secured Data from the Command Packet in the first SMS
TPDU or Cell Broadcast Page Simple TLV contained in the Envelope
handler. | public short | getTPUDLOffset() Looks for the TP-UDL field in the first TPDU TLV element in the Envelope
data field. | public static EnvelopeHandler | getTheHandler() Returns the single system instance of the EnvelopeHandler class. |
getEnvelopeTag | public byte getEnvelopeTag()(Code) | | Returns the Envelope BER-TLV tag.
Envelope BER-TLV tag |
getItemIdentifier | public byte getItemIdentifier() throws ToolkitException(Code) | | 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.
item identifier exception: ToolkitException - with the following reason codes: UNAVAILABLE_ELEMENT in case of unavailableTLV elementOUT_OF_TLV_BOUNDARIES if the item identifier byte is missing in the Item Identifier Simple TLV
|
getSecuredDataLength | public short getSecuredDataLength() throws ToolkitException(Code) | | Looks for the length of the Secured Data from the Command Packet
in the first SMS TPDU or Cell Broadcast Page Simple TLV contained
in the Envelope handler. This can be used on the events:
- EVENT_FORMATTED_SMS_PP_ENV, EVENT_FORMATTED_SMS_PP_UPD,
if the SMS TP-UD is formatted according to GSM03.48 Single
Short Message.
- EVENT_FORMATTED_SMS_CB, if the Cell Broadcast Page is formatted
according to GSM 03.48.
If the element is available it becomes the TLV selected.
the length of the Secured Data contained in the first SMS TPDU or Cell Broadcast Page TLV element (without padding bytes). If the Secured Data length is zero, no exception shall be thrown. exception: ToolkitException - with the following reason codes: UNAVAILABLE_ELEMENT in case of unavailable SMS TPDU or Cell Broadcast Page TLV element or wrong data format
|
getSecuredDataOffset | public short getSecuredDataOffset() throws ToolkitException(Code) | | Looks for the Secured Data from the Command Packet in the first SMS
TPDU or Cell Broadcast Page Simple TLV contained in the Envelope
handler. This can be used on the events:
- EVENT_FORMATTED_SMS_PP_ENV, EVENT_FORMATTED_SMS_PP_UPD,
if the SMS TP-UD is formatted according to GSM03.48 Single
Short Message.
- EVENT_FORMATTED_SMS_CB, if the Cell Broadcast Page is formatted
according to GSM 03.48.
If the element is available it becomes the TLV selected.
the offset of the Secured Data first byte in the first SMS TPDU or Cell Broadcast Page TLV element. If the Secured Data length is zero the value returned shall be the SMS TPDU TLV length. exception: ToolkitException - with the following reason codes: UNAVAILABLE_ELEMENT in case of unavailable SMS TPDU or Cell Broadcast Page TLV element or wrong data format
|
getTPUDLOffset | public short getTPUDLOffset() throws ToolkitException(Code) | | Looks for the TP-UDL field in the first TPDU TLV element in the Envelope
data field. This method can be used on the events
EVENT_FORMATTED_SMS_PP_ENV,
EVENT_FORMATTED_SMS_PP_UPD, EVENT_UNFORMATTED_SMS_PP_ENV,
EVENT_UNFORMATTED_SMS_PP_UPD.
If the element is available it becomes the TLV selected.
TPUDL offset in the first TPDU TLV element if TPUDL exists.The TPUD length can be recovered by using the getValueByte method in Handler class. exception: ToolkitException - with the following reason codes: UNAVAILABLE_ELEMENT in case of unavailable TPDU TLV element or if the TPUDL field does not exist
|
getTheHandler | public static EnvelopeHandler getTheHandler() throws ToolkitException(Code) | | Returns the single system instance of the EnvelopeHandler class.
The applet shall get the reference of the handler at its triggering,
the beginning of the processToolkit method.
reference of the system instance exception: ToolkitException - with the following reason codes: HANDLER_NOT_AVAILABLE if the handler is busy.
|
Methods inherited from sim.toolkit.ViewHandler | public byte compareValue(short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc) public short copy(byte[] dstBuffer, short dstOffset, short dstLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc) public short copyValue(short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc) public byte findAndCompareValue(byte tag, byte[] compareBuffer, short compareOffset) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc) public byte findAndCompareValue(byte tag, byte occurrence, short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc) public short findAndCopyValue(byte tag, byte[] dstBuffer, short dstOffset) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc) public short findAndCopyValue(byte tag, byte occurrence, short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength) throws NullPointerException, ArrayIndexOutOfBoundsException, ToolkitException(Code)(Java Doc) public byte findTLV(byte tag, byte occurrence) throws ToolkitException(Code)(Java Doc) public static byte[] getAPDUBuffer(byte[] buffer)(Code)(Java Doc) public static byte[] getAPDUBuffer()(Code)(Java Doc) protected short getLastTLVOffset(byte[] buffer, short Lc)(Code)(Java Doc) public short getLength() throws ToolkitException(Code)(Java Doc) protected short getTLVOffset(byte[] buffer, byte tag, short Lc, short occurrence)(Code)(Java Doc) public byte getValueByte(short valueOffset) throws ToolkitException(Code)(Java Doc) public short getValueLength() throws ToolkitException(Code)(Java Doc) public static void setAPDUBuffer(byte[] buffer, short length)(Code)(Java Doc) public static void setAPDUBuffer(short length)(Code)(Java Doc) public static void setOutBufferData(short length)(Code)(Java Doc)
|
|
|