net.rim.device.api.system
Class SMSPacketHeader

java.lang.Object
  extended by net.rim.device.api.system.SMSParameters
      extended by net.rim.device.api.system.SMSPacketHeader

public final class SMSPacketHeader
extends SMSParameters

A RadioPacketHeader for sending SMS packets. See GSM 03.40 for details.

Since:
BlackBerry API 4.0.0

Field Summary
static String[] INDICATOR_TYPE_NAMES
           
static int RECORD_STATUS_MS_ORIGINATED
           
static int RECORD_STATUS_REPORT_RECEIVED
           
static int RECORD_STATUS_REPORT_REQUESTED
           
static int RECORD_STATUS_UNREAD
           
static int SMS_ID_NOT_ON_SIM
           
static int WAITING_INDICATOR_TYPE_EMAIL
          Represents the email wait indicator.
static int WAITING_INDICATOR_TYPE_FAX
          Represents the fax wait indicator.
static int WAITING_INDICATOR_TYPE_OTHER
          Represents an "other" wait indicator.
static int WAITING_INDICATOR_TYPE_VOICEMAIL
          Represents the voicemail waiting indicator.
 
Fields inherited from class net.rim.device.api.system.SMSParameters
LANGUAGE_CHINESE, LANGUAGE_ENGLISH, LANGUAGE_FRENCH, LANGUAGE_HEBREW, LANGUAGE_JAPANESE, LANGUAGE_KOREAN, LANGUAGE_NONE, LANGUAGE_SPANISH, LANGUAGE_UNSPECIFIED, MESSAGE_CLASS_0, MESSAGE_CLASS_1, MESSAGE_CLASS_2, MESSAGE_CLASS_3, MESSAGE_CLASS_NOT_GIVEN, MESSAGE_CODING_8_BIT, MESSAGE_CODING_ASCII, MESSAGE_CODING_DEFAULT, MESSAGE_CODING_ISO8859_1, MESSAGE_CODING_KOREAN_KSX1001, MESSAGE_CODING_UCS2, NUM_ABBREVIATED, NUM_ALPHANUMERIC, NUM_EMAIL, NUM_INTERNATIONAL, NUM_NATIONAL, NUM_NETWORK_SPEC, NUM_RESERVED, NUM_SUBSCRIBER, NUM_UNKNOWN, PERIOD_IMMEDIATE, PERIOD_INDEFINITE, PERIOD_TILL_ACTIVE, PERIOD_TILL_AREA, PLAN_DATA, PLAN_ERMES, PLAN_ISDN, PLAN_NATIONAL, PLAN_PRIVATE, PLAN_RESERVED, PLAN_TELEX, PLAN_UNKNOWN, PRIORITY_EMERGENCY, PRIORITY_INTERACTIVE, PRIORITY_NONE, PRIORITY_NORMAL, PRIORITY_URGENT, PRIVACY_CONFIDENTIAL, PRIVACY_NONE, PRIVACY_NORMAL, PRIVACY_RESTRICTED, PRIVACY_SECRET, PROTOCOL_ID_CSPDN_TELETEX, PROTOCOL_ID_DEPERSONALIZATION_SM, PROTOCOL_ID_ERMES, PROTOCOL_ID_GRP3_FAX, PROTOCOL_ID_GRP4_FAX, PROTOCOL_ID_GSM_MS, PROTOCOL_ID_IMPLICIT, PROTOCOL_ID_INTERNET_EMAIL, PROTOCOL_ID_ISDN_TELETEX, PROTOCOL_ID_MSG_HANDLING, PROTOCOL_ID_NAT_PAGING, PROTOCOL_ID_PSPDN_TELETEX, PROTOCOL_ID_PSTN_TELETEX, PROTOCOL_ID_REPLACE_SM_TYPE1, PROTOCOL_ID_REPLACE_SM_TYPE2, PROTOCOL_ID_REPLACE_SM_TYPE3, PROTOCOL_ID_REPLACE_SM_TYPE4, PROTOCOL_ID_REPLACE_SM_TYPE5, PROTOCOL_ID_REPLACE_SM_TYPE6, PROTOCOL_ID_REPLACE_SM_TYPE7, PROTOCOL_ID_RETURN_CALL_MSG, PROTOCOL_ID_SC_SPECIFIC_1, PROTOCOL_ID_SC_SPECIFIC_2, PROTOCOL_ID_SC_SPECIFIC_3, PROTOCOL_ID_SC_SPECIFIC_4, PROTOCOL_ID_SC_SPECIFIC_5, PROTOCOL_ID_SC_SPECIFIC_6, PROTOCOL_ID_SC_SPECIFIC_7, PROTOCOL_ID_SIM_DATA_DOWNLOAD, PROTOCOL_ID_SM_TYPE0, PROTOCOL_ID_TELEX, PROTOCOL_ID_UCI, PROTOCOL_ID_UNSPEC_TELETEX, PROTOCOL_ID_VIDEOTEX, PROTOCOL_ID_VOICE, PROTOCOL_ID_X400, PROTOCOL_MEANING_RAW_DATA, PROTOCOL_MEANING_RESERVED, PROTOCOL_MEANING_SC_SPECIFIC, PROTOCOL_MEANING_SM_AL_PROTOCOL, PROTOCOL_MEANING_SM_FUNCTIONS, PROTOCOL_MEANING_TELEMATIC_INTERWORK
 
Constructor Summary
SMSPacketHeader()
          Constructs a new SMSPacketHeader.
 
Method Summary
static int getBitsPerCharacter(int messageCoding)
          Returns the number of bits required per character for the specified encoding type.
static int getBitsPerSegment(int messageCoding)
          Get the number of bits that can fit into a segment.
static int getBitsPerSegment(int messageCoding, int wmaUDHLength)
          Get the number of bits that can fit into a segment.
static int getBytesPerCharacter(int messageCoding)
          Returns the number of bytes required per character for the specified encoding type.
static int getCharacters(int segments, int messageCoding)
          Returns the number of characters that can fit into the given number of segments using the given encoding type.
 int getID()
          Returns the SIM ID for this message.
static int getMaxNumberOfSegments()
          Returns the maximum number of segments supported
 int getMessageWaitingType()
          Returns this message's MWI Group type.
 int getNumMessages()
          Returns the number of messages waiting.
 int getRecordStatus()
          Returns the record status for this message.
static int getSegments(int characters, int messageCoding)
          Returns the number of segments required for the given number of characters and the given encoding type.
static int getSegments(int characters, int messageCoding, int udhLength)
          Returns the number of segments required for the given number of characters and the given encoding type.
 boolean getStatusReportRequest()
          Returns the status report request.
 long getTimestamp()
          Returns the timestamp for this message.
 boolean isDeliveryPeriodDefault()
          Returns a boolean indicating whether or not the delivery period is set to the default amount of time.
 boolean isFromSIMCard()
          Determines if this message originated from the device SIM card.
 boolean isMessageWaitingActive()
          Determines if this message's MWI Group is "Active".
 boolean isMessageWaitingGroup()
          Determines if this message is part of the Message Waiting Indication Group.
 boolean isMessageWaitingStore()
          Determines if this message's MWI Group is "Store Message".
 boolean isReplyPath()
          Determines if this message specifies the reply path to use.
static boolean isSegmentationSupported()
          Returns true if composition of fragmented SMS messages is supported.
static boolean isSendSupported()
           
 boolean isUserDataHeaderPresent()
          Returns a boolean indicating whether or not a user data header is present.
 boolean isValidityPeriodDefault()
           
 void reset()
          Resets these parameters to default values.
 void setDeliveryPeriod(int deliveryPeriod)
          Sets the delivery period for the message.
 void setMessageClass(int messageClass)
          Sets the message class.
 void setMessageCoding(int messageCoding)
          Sets the message coding.
 void setMessageWaitingType(int waitingIndType)
          Sets this message's MWI Group type.
 void setNumMessages(int numMessages)
          Sets the number of messages waiting.
 void setProtocolId(int protocolMeaning, int protocolId)
          Sets the protocol meaning and ID.
 void setStatusReportRequest(boolean statusReportRequest)
          Sets the status report request for the message.
 void setUserDataHeaderPresent(boolean userDataHeaderPresent)
          Sets the user data header present for the message.
 void setValidityPeriod(int validityPeriod)
          Sets the validity period for the message.
static boolean validateForASCIIMessageCoding(char c)
          Validate the given character against the ASCII encoding.
static boolean validateForDefaultMessageCoding(char c)
          Validate the given character against the default encoding.
static boolean validateForDefaultMessageCoding(char c, int shiftLanguage)
          Validate the given character against the default encoding.
static boolean validateForISO8859MessageCoding(char c)
          Validate the given character against the ISO8859 encoding.
static boolean validateForMessageCoding(char c, int messageCoding)
          Determines if the specified character is valid for the given encoding type.
static boolean validateForMessageCoding(char c, int messageCoding, int shiftLanguage)
          Determines if the specified character is valid for the given encoding type.
static boolean validateForUCS2MessageCoding(char c)
          Validate the given character against the UCS2 encoding.
 
Methods inherited from class net.rim.device.api.system.SMSParameters
getCallbackAddress, getCallbackPlan, getCallbackType, getDeliveryPeriod, getLanguage, getMessageClass, getMessageCoding, getPeerAddress, getPeerPlan, getPeerType, getPriority, getPrivacy, getProtocolId, getProtocolMeaning, getSCAddress, getSCPlan, getSCType, getValidityPeriod, setCallbackAddress, setCallbackAddress, setLanguage, setPeerAddress, setPeerAddress, setPriority, setPrivacy, setProtocolId, setProtocolMeaning, setSCAddress, setSCAddress
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

WAITING_INDICATOR_TYPE_VOICEMAIL

public static final int WAITING_INDICATOR_TYPE_VOICEMAIL
Represents the voicemail waiting indicator.

Indicates that a voicemail is waiting.

See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

WAITING_INDICATOR_TYPE_FAX

public static final int WAITING_INDICATOR_TYPE_FAX
Represents the fax wait indicator.

Indicates that a fax is waiting.

See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

WAITING_INDICATOR_TYPE_EMAIL

public static final int WAITING_INDICATOR_TYPE_EMAIL
Represents the email wait indicator.

Indicates that an email is waiting.

See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

WAITING_INDICATOR_TYPE_OTHER

public static final int WAITING_INDICATOR_TYPE_OTHER
Represents an "other" wait indicator.

See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

INDICATOR_TYPE_NAMES

public static final String[] INDICATOR_TYPE_NAMES
Since:
BlackBerry API 4.0.0

RECORD_STATUS_UNREAD

public static final int RECORD_STATUS_UNREAD
See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

RECORD_STATUS_MS_ORIGINATED

public static final int RECORD_STATUS_MS_ORIGINATED
See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

RECORD_STATUS_REPORT_REQUESTED

public static final int RECORD_STATUS_REPORT_REQUESTED
See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

RECORD_STATUS_REPORT_RECEIVED

public static final int RECORD_STATUS_REPORT_RECEIVED
See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

SMS_ID_NOT_ON_SIM

public static final int SMS_ID_NOT_ON_SIM
See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0


Constructor Detail

SMSPacketHeader

public SMSPacketHeader()
Constructs a new SMSPacketHeader.

Since:
BlackBerry API 4.0.0


Method Detail

reset

public void reset()
Description copied from class: SMSParameters
Resets these parameters to default values.

Overrides:
reset in class SMSParameters
Since:
BlackBerry API 4.0.0

setProtocolId

public void setProtocolId(int protocolMeaning,
                          int protocolId)
Sets the protocol meaning and ID.

If this is not specified, the default protocol meaning and ID are used.

Parameters:
protocolMeaning - An integer representing the protocol meaning.
protocolId - An integer representing the protocol Id.
Since:
BlackBerry API 4.0.0

setMessageCoding

public void setMessageCoding(int messageCoding)
Sets the message coding.

If this is not specified, the default message coding is used.

Overrides:
setMessageCoding in class SMSParameters
Parameters:
messageCoding - An integer representing the message coding.
Since:
BlackBerry API 4.0.0

setMessageClass

public void setMessageClass(int messageClass)
Sets the message class.

If this is not specified, the default message class is used.

Overrides:
setMessageClass in class SMSParameters
Parameters:
messageClass - An integer representing the message class.
Since:
BlackBerry API 4.0.0

isUserDataHeaderPresent

public boolean isUserDataHeaderPresent()
Returns a boolean indicating whether or not a user data header is present.

Returns:
True if there is a user data header present, false otherwise.
Since:
BlackBerry API 4.0.0

setUserDataHeaderPresent

public void setUserDataHeaderPresent(boolean userDataHeaderPresent)
Sets the user data header present for the message.

Parameters:
userDataHeaderPresent - Whether user data header is present
Since:
BlackBerry API 4.0.0

setValidityPeriod

public void setValidityPeriod(int validityPeriod)
Sets the validity period for the message.

If this is not specified, the default validity period is used.

Overrides:
setValidityPeriod in class SMSParameters
Parameters:
validityPeriod - The validity period.
Since:
BlackBerry API 4.0.0

isValidityPeriodDefault

public boolean isValidityPeriodDefault()
Since:
BlackBerry API 4.0.0

setDeliveryPeriod

public void setDeliveryPeriod(int deliveryPeriod)
Sets the delivery period for the message.

If this is not specified, the default delivery period is used.

Overrides:
setDeliveryPeriod in class SMSParameters
Parameters:
deliveryPeriod - The delivery period.
Since:
BlackBerry API 4.0.0

isDeliveryPeriodDefault

public boolean isDeliveryPeriodDefault()
Returns a boolean indicating whether or not the delivery period is set to the default amount of time.

Returns:
true if the delivery period is set to the default amount of time, false otherwise.
Since:
BlackBerry API 4.0.0

getStatusReportRequest

public boolean getStatusReportRequest()
Returns the status report request.

Returns:
True if status report is requested, false otherwise. Will also return false if ability to request status reports is blocked by the radio layer.
Since:
BlackBerry API 4.0.0

setStatusReportRequest

public void setStatusReportRequest(boolean statusReportRequest)
Sets the status report request for the message.

Parameters:
statusReportRequest - The status report request.
Since:
BlackBerry API 4.0.0

isMessageWaitingGroup

public boolean isMessageWaitingGroup()
Determines if this message is part of the Message Waiting Indication Group.

Returns:
True if this message is part of the MWI Group; otherwise, false.
Since:
BlackBerry API 4.0.0

isMessageWaitingStore

public boolean isMessageWaitingStore()
Determines if this message's MWI Group is "Store Message".

Returns:
True if the Message Waiting Indicaton Group is 'Store Message'; otherwise, false.
Since:
BlackBerry API 4.0.0

isMessageWaitingActive

public boolean isMessageWaitingActive()
Determines if this message's MWI Group is "Active".

Returns:
True if the Message Waiting Indication Group is "Active"; otherwise, false.
Since:
BlackBerry API 4.0.0

getMessageWaitingType

public int getMessageWaitingType()
Returns this message's MWI Group type.

Returns:
This message's MWI Group type.
Since:
BlackBerry API 4.0.0

setMessageWaitingType

public void setMessageWaitingType(int waitingIndType)
Sets this message's MWI Group type.

Parameters:
waitingIndType - An integer representing the message waiting idnication group type to set.
Since:
BlackBerry API 4.0.0

getNumMessages

public int getNumMessages()
Returns the number of messages waiting.

Returns:
The number of messages waiting.
Since:
BlackBerry API 4.0.0

setNumMessages

public void setNumMessages(int numMessages)
Sets the number of messages waiting.

Parameters:
numMessages - The number of messages waiting.
Since:
BlackBerry API 4.0.0

getID

public int getID()
Returns the SIM ID for this message.

Returns:
The SIM ID for this message, or SMS_ID_NOT_ON_SIM if the message is not stored on the SIM.
Since:
BlackBerry API 4.0.0

getTimestamp

public long getTimestamp()
Returns the timestamp for this message.

Returns:
The timestamp.
Since:
BlackBerry API 4.0.0

getRecordStatus

public int getRecordStatus()
Returns the record status for this message.

Returns:
A combination of the RECORD_STATUS_ values.
Since:
BlackBerry API 4.0.0

isFromSIMCard

public boolean isFromSIMCard()
Determines if this message originated from the device SIM card.

Returns:
True if the message originated from the SIM Card, false if it is being received OTA.
Since:
BlackBerry API 4.0.0

isReplyPath

public boolean isReplyPath()
Determines if this message specifies the reply path to use.

Returns:
True if the message specified the reply path, false otherwise.
Since:
BlackBerry API 4.0.0

isSendSupported

public static boolean isSendSupported()
Returns:
True if sending SMS messages is supported
Since:
BlackBerry API 4.1.0

isSegmentationSupported

public static boolean isSegmentationSupported()
Returns true if composition of fragmented SMS messages is supported.

Since:
BlackBerry API 4.0.0

getMaxNumberOfSegments

public static int getMaxNumberOfSegments()
Returns the maximum number of segments supported

Since:
BlackBerry API 6.0.0

getBitsPerCharacter

public static int getBitsPerCharacter(int messageCoding)
Returns the number of bits required per character for the specified encoding type.

Parameters:
messageCoding - The encoding type.
Returns:
The number of bits required per character.
Since:
BlackBerry API 4.0.0

getBytesPerCharacter

public static int getBytesPerCharacter(int messageCoding)
Returns the number of bytes required per character for the specified encoding type.

Parameters:
messageCoding - The encoding type.
Returns:
The number of bytes required per character.
Since:
BlackBerry API 4.0.0

getBitsPerSegment

public static int getBitsPerSegment(int messageCoding)
Get the number of bits that can fit into a segment.

Since:
BlackBerry API 4.0.0

getBitsPerSegment

public static int getBitsPerSegment(int messageCoding,
                                    int wmaUDHLength)
Get the number of bits that can fit into a segment.

Since:
BlackBerry API 4.1.0

getSegments

public static int getSegments(int characters,
                              int messageCoding)
Returns the number of segments required for the given number of characters and the given encoding type.

Parameters:
characters - The number of characters.
messageCoding - The encoding type.
Returns:
The number of segments required.
Since:
BlackBerry API 4.0.0

getSegments

public static int getSegments(int characters,
                              int messageCoding,
                              int udhLength)
Returns the number of segments required for the given number of characters and the given encoding type.

Parameters:
characters - The number of characters.
messageCoding - The encoding type.
udhLength - The number of bytes required by user defined data. This size does not include the UDH length byte. For example, if the existing UDH is "3ABC", where 3 is the length of the existing UDH, then the value for for udhLength would be 3, not 4.
Returns:
The number of segments required.
Since:
BlackBerry API 4.0.0

getCharacters

public static int getCharacters(int segments,
                                int messageCoding)
Returns the number of characters that can fit into the given number of segments using the given encoding type.

Parameters:
segments - The number of segments.
messageCoding - The encoding type.
Returns:
The number of characters.
Since:
BlackBerry API 4.0.0

validateForMessageCoding

public static boolean validateForMessageCoding(char c,
                                               int messageCoding)
Determines if the specified character is valid for the given encoding type.

Parameters:
c - The character to validate.
messageCoding - The encoding type.
Returns:
True if the character is valid.
Since:
BlackBerry API 4.0.0

validateForMessageCoding

public static boolean validateForMessageCoding(char c,
                                               int messageCoding,
                                               int shiftLanguage)
Determines if the specified character is valid for the given encoding type.

Parameters:
c - The character to validate.
messageCoding - The encoding type.
shiftLanguage - SMSConstants.NATIONAL_LANGUAGE_IDENTIFIER_??? or 0 if not applicable. Applies only when messageCoding is 7 bit SMS (0);
Returns:
True if the character is valid.
Since:
BlackBerry API 4.7.0

validateForDefaultMessageCoding

public static boolean validateForDefaultMessageCoding(char c)
Validate the given character against the default encoding.

Parameters:
c - The character to validate.
Returns:
If the character is valid; false otherwise.
Since:
BlackBerry API 4.0.0

validateForDefaultMessageCoding

public static boolean validateForDefaultMessageCoding(char c,
                                                      int shiftLanguage)
Validate the given character against the default encoding.

Parameters:
c - The character to validate.
shiftLanguage - SMSConstants.NATIONAL_LANGUAGE_IDENTIFIER_??? or 0 if not applicable. Applies only when default message coding is 7 bit SMS (0);
Returns:
If the character is valid; false otherwise.
Since:
BlackBerry API 4.7.0

validateForISO8859MessageCoding

public static boolean validateForISO8859MessageCoding(char c)
Validate the given character against the ISO8859 encoding.

Parameters:
c - The character to validate.
Returns:
If the character is valid; false otherwise.
Since:
BlackBerry API 4.0.0

validateForASCIIMessageCoding

public static boolean validateForASCIIMessageCoding(char c)
Validate the given character against the ASCII encoding.

Parameters:
c - The character to validate.
Returns:
If the character is valid; false otherwise.
Since:
BlackBerry API 4.0.0

validateForUCS2MessageCoding

public static boolean validateForUCS2MessageCoding(char c)
Validate the given character against the UCS2 encoding.

Parameters:
c - The character to validate.
Returns:
If the character is valid; false otherwise.
Since:
BlackBerry API 4.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.