|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.marre.sms.SmsUdhUtil
Toolkit class for SmsUdhElement objects.
Method Summary | |
static SmsUdhElement |
get16BitApplicationPortUdh(int theDestPort,
int theOrigPort)
Creates a "16 bit Application Port Adressing" UDH element using UDH_IEI_APP_PORT_16BIT Note! |
static SmsUdhElement |
get16BitConcatUdh(int theRefNr,
int theTotSms,
int theSeqNr)
Creates a "16Bit concatenated" UDH element using UDH_IEI_CONCATENATED_16BIT This can be used to create a concatenated SMS. |
static SmsUdhElement |
get8BitApplicationPortUdh(int theDestPort,
int theOrigPort)
Creates a "8 bit Application Port Adressing" UDH element using UDH_IEI_APP_PORT_8BIT Note! |
static SmsUdhElement |
get8BitConcatUdh(int theRefNr,
int theTotSms,
int theSeqNr)
Creates a "8Bit concatenated" UDH element using UDH_IEI_CONCATENATED_8BIT. |
static SmsUdhElement |
getEmsTextFormattingUdh(int theStartPos,
int theFormatLen,
byte theAlignment,
byte theFontSize,
byte theStyle,
byte theForegroundColor,
byte theBackgroundColor)
Creates a "EMS Text Formatting" UDH element. |
static SmsUdhElement |
getEmsUserDefinedSoundUdh(byte[] theIMelody,
int position)
Creates an ems user defined sound udh. |
static SmsUdhElement |
getEmsUserPromptIndicatorUdh(int numFragments)
Creates an ems user prompt indicator udh. |
static SmsUdhElement |
getEmsVariablePictureUdh(byte[] bitmap,
int width,
int height,
int position)
Creates an ems variable picture udh. |
static SmsUdhElement |
getMessageWaitingUdh(boolean storeMsg,
int theMsgType,
int theMsgCount)
Creates a "Message waiting" UDH element using UDH_IEI_SPECIAL_MESSAGE. |
static int |
getTotalSize(SmsUdhElement[] theUdhElements)
Calculates the number of bytes needed for the supplied udh elements. |
static boolean |
isConcat(SmsUserData ud,
byte[] udh)
Calculates if the given data needs a concatenated SMS. |
static byte[] |
toByteArray(SmsUdhElement[] theUdhElements)
Returns the whole udh as a byte array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int getTotalSize(SmsUdhElement[] theUdhElements)
theUdhElements
- The udh elements
public static byte[] toByteArray(SmsUdhElement[] theUdhElements)
The returned UDH is the same as specified when the message was created. No concat headers are added. TODO: Rename this function. The name is totally wrong.
public static boolean isConcat(SmsUserData ud, byte[] udh)
ud
- User dataudh
- UDH elements
public static SmsUdhElement get8BitConcatUdh(int theRefNr, int theTotSms, int theSeqNr)
theRefNr
- The reference number of this SMS, must be the same in
all SMS. Max 255.theTotSms
- Total number of SMS. Max 255.theSeqNr
- Sequence number. Max 255.
public static SmsUdhElement getMessageWaitingUdh(boolean storeMsg, int theMsgType, int theMsgCount)
If more than one type of message is required to be indicated within one SMS message, then multiple "Message waiting" UDH elements must be used.
Special handling in concatenated messages:
"In the case where this IEI is to be used in a concatenated SM then the
IEI, its associated IEI length and IEI data shall be contained in the
first segment of the concatenated SM. The IEI, its associated IEI length
and IEI data should also be contained in every subsequent segment of the
concatenated SM although this is not mandatory. However, in the case
where these elements are not contained in every subsequent segment of
the concatenated SM and where an out of sequence segment delivery
occurs or where the first segment is not delivered then processing
difficulties may arise at the receiving entity which may result in
the concatenated SM being totally or partially discarded."
storeMsg
- Set to true if the message should be storedtheMsgType
- Message type, may be one of MESSAGE_WAITING_VOICE,
MESSAGE_WAITING_FAX, MESSAGE_WAITING_EMAIL or MESSAGE_WAITING_OTHER.theMsgCount
- Number of messages waiting for retrieval. Max 255
messages. The value 255 shall be taken to mean 255 or greater.
public static SmsUdhElement get8BitApplicationPortUdh(int theDestPort, int theOrigPort)
Note! Only values between 240 and 255 are usable, the rest of the port numbers are marked as reserved.
Special handling in concatenated messages:
In the case where this IE is to be used in a concatenated SM then the
IEI, its associated IEI length and IEI data shall be contained in the
first segment of the concatenated SM. The IEI, its associated IEI length
and IEI data shall also be contained in every subsequent segment of the
concatenated SM.
theDestPort
- Destination porttheOrigPort
- Source port
public static SmsUdhElement get16BitApplicationPortUdh(int theDestPort, int theOrigPort)
Note! Only values between 0 and 16999 are usable, the rest of the port numbers are marked as reserved.
Special handling in concatenated messages:
In the case where this IE is to be used in a concatenated SM then the
IEI, its associated IEI length and IEI data shall be contained in the
first segment of the concatenated SM. The IEI, its associated IEI length
and IEI data shall also be contained in every subsequent segment of the
concatenated SM.
theDestPort
- Destination porttheOrigPort
- Source port
public static SmsUdhElement get16BitConcatUdh(int theRefNr, int theTotSms, int theSeqNr)
This can be used to create a concatenated SMS.
theRefNr
- The reference number of this SMS, must be the same in
all SMS. Max 65536theTotSms
- Total number of SMS. Max 255theSeqNr
- Sequence number. Max 255
public static SmsUdhElement getEmsTextFormattingUdh(int theStartPos, int theFormatLen, byte theAlignment, byte theFontSize, byte theStyle, byte theForegroundColor, byte theBackgroundColor)
theStartPos
- Start position of the text formatting. This position
is relative to the start of the UD field of the PDU.theFormatLen
- The number of character to format. If 0 it sets the
default text formatting.theAlignment
- Can be any of EMS_TEXT_ALIGN_*theFontSize
- Can be any of EMS_TEXT_SIZE_*theStyle
- Can be any of EMS_TEXT_STYLE_*theForegroundColor
- Can be any of EMS_TEXT_COLOR_*theBackgroundColor
- Can be any of EMS_TEXT_COLOR_*
public static SmsUdhElement getEmsUserDefinedSoundUdh(byte[] theIMelody, int position)
theIMelody
- The imelody dataposition
- The position
public static SmsUdhElement getEmsUserPromptIndicatorUdh(int numFragments)
numFragments
- Number of fragments
public static SmsUdhElement getEmsVariablePictureUdh(byte[] bitmap, int width, int height, int position)
bitmap
- The bitmap datawidth
- The width of the bitmap (in pixels)height
- The height of the bitmap (in pixels)position
- The position of the bitmap
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |