hp.opencall.media.sms.tl
Class PDU

java.lang.Object
  extended byhp.opencall.media.sms.tl.PDU
Direct Known Subclasses:
PDU, PDU

public class PDU
extends Object

A PDU is a SMS TL (Short Message Service Transport Layer) byte array message sent or received thanks to a play or record operation on a relevant SMS Resource.

Each PDU is composed of one or severals Parameter

Encoding of an SMS TL PDU requires to :

1. Create the relevant PDU from SMS protocol 1 or 2 (tl1 or tl2 package)
2. Set all the Parameters value
3. Encode the PDU in order to get the encoded byte array
The resulting byte array can be sent thanks to a play operation

Decoding of a received SMS TL byte array from a record operation requires to :

1. Create the relevant PDU from SMS protocol 1 or 2 (tl1 or tl2 package)
2. Decode the PDU in order to assign all the parameters value from the byte array
The resulting PDU object can be acceded in order to get all the Parameters value


Constructor Summary
PDU(String aName, int aParameterNumber)
           
 
Method Summary
 void decodePDU(byte[] encodedPDU)
          Decode a PDU and assigns all the involving Parameters This method should be used when receiving a SMS TL PDU and the Oclet need to get the Parameters values.
 byte[] encodedPDU()
          Encode a PDU thanks to the previous Parameters assignment.
 int getSizeInByte()
          getSizeInByte calculates the PDU size in byte
 String toString()
          Dump a PDU as a String This method is supply for debug only because of performance topic.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDU

public PDU(String aName,
           int aParameterNumber)
Method Detail

encodedPDU

public byte[] encodedPDU()
                  throws PDUException
Encode a PDU thanks to the previous Parameters assignment.

This method should be used to build a SMS TL PDU to be sent thanks to a play operation.

This method throws a PDUException if the encoding can be proceded completly.

Returns:
the encoded byte array PDU.
Throws:
PDUException - if requested operation fails
See Also:
Player.play(java.lang.String[], int, hp.telephony.media.RTC[], java.util.Dictionary)

decodePDU

public void decodePDU(byte[] encodedPDU)
               throws PDUException
Decode a PDU and assigns all the involving Parameters

This method should be used when receiving a SMS TL PDU and the Oclet need to get the Parameters values.

This method throws an DecodingException if the decoding can be proceded completly.

Parameters:
encodedPDU - is the encoded byte array PDU to decode.
Throws:
PDUException - if requested operation fails
See Also:
Recorder.record(java.lang.String, hp.telephony.media.RTC[], java.util.Dictionary)

toString

public String toString()
Dump a PDU as a String

This method is supply for debug only because of performance topic.


getSizeInByte

public int getSizeInByte()
                  throws PDUException
getSizeInByte calculates the PDU size in byte

Throws:
PDUException