org.marre.sms
Class SmsDcs

java.lang.Object
  extended byorg.marre.sms.SmsDcs

public class SmsDcs
extends java.lang.Object

Represents a SMS DCS (Data Coding Scheme).

Version:
$Id: SmsDcs.java,v 1.3 2005/05/06 13:55:11 c95men Exp $
Author:
Markus Eriksson

Field Summary
static int ALPHABET_8BIT
          ISO 8859-1 (ISO Latin-1).
static int ALPHABET_GSM
          Alphabet as defined in GSM 03.38.
static int ALPHABET_RESERVED
          Reserved.
static int ALPHABET_UCS2
          Unicode UCS-2.
static int ALPHABET_UNKNOWN
          Unknown.
protected  byte dcs_
          The encoded dcs.
static byte DCS_MSG_WAITING_EMAIL
          Message waiting indication type - email.
static byte DCS_MSG_WAITING_FAX
          Message waiting indication type - fax.
static byte DCS_MSG_WAITING_OTHER
          Message waiting indication type - other.
static byte DCS_MSG_WAITING_VOICEMAIL
          Message waiting indication type - voicemail.
static int GROUP_DATA_CODING_MESSAGE
          DCS data coding/message class: 1111xxxx.
static int GROUP_GENERAL_DATA_CODING
          DCS general data coding indication group. 00xxxxxx.
static int GROUP_MESSAGE_WAITING_DISCARD
          DCS message waiting indication group: discard message. 1100xxxx.
static int GROUP_MESSAGE_WAITING_STORE_GSM
          DCS message waiting indication group: store message (gsm). 1101xxxx.
static int GROUP_MESSAGE_WAITING_STORE_UCS2
          DCS message waiting indication group: store message (ucs2). 1110xxxx.
static int GROUP_UNKNOWN
          DCS group unknown.
static byte MSG_CLASS_0
          Class 0 SMS.
static byte MSG_CLASS_1
          Class 1 SMS.
static byte MSG_CLASS_2
          Class 2 SMS, SIM specific message.
static byte MSG_CLASS_3
          Class 3 SMS.
static byte MSG_CLASS_UNKNOWN
          Message with no specific message class (Often handled as an class 1 SMS).
 
Constructor Summary
SmsDcs(byte dcs)
          Creates a specific DCS.
 
Method Summary
 int getAlphabet()
          Decodes the given dcs and returns the alphabet.
static SmsDcs getGeneralDataCodingDcs(int alphabet, byte messageClass)
          Builds a general-data-coding dcs.
 int getGroup()
          What group (type of message) is the given dcs.
 int getMessageClass()
          Get the message class.
 byte getValue()
          Returns the encoded dcs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALPHABET_GSM

public static final int ALPHABET_GSM
Alphabet as defined in GSM 03.38. It contains all characters needed for most Western European languages. It also contains upper case Greek characters.

See Also:
Constant Field Values

ALPHABET_8BIT

public static final int ALPHABET_8BIT
ISO 8859-1 (ISO Latin-1).

See Also:
Constant Field Values

ALPHABET_UCS2

public static final int ALPHABET_UCS2
Unicode UCS-2.

See Also:
Constant Field Values

ALPHABET_RESERVED

public static final int ALPHABET_RESERVED
Reserved.

See Also:
Constant Field Values

ALPHABET_UNKNOWN

public static final int ALPHABET_UNKNOWN
Unknown.

See Also:
Constant Field Values

MSG_CLASS_0

public static final byte MSG_CLASS_0
Class 0 SMS. Sometimes called FLASH message.

See Also:
Constant Field Values

MSG_CLASS_1

public static final byte MSG_CLASS_1
Class 1 SMS. Default meaning: ME-specific.

See Also:
Constant Field Values

MSG_CLASS_2

public static final byte MSG_CLASS_2
Class 2 SMS, SIM specific message.

See Also:
Constant Field Values

MSG_CLASS_3

public static final byte MSG_CLASS_3
Class 3 SMS. Default meaning: TE specific (See GSM TS 07.05).

See Also:
Constant Field Values

MSG_CLASS_UNKNOWN

public static final byte MSG_CLASS_UNKNOWN
Message with no specific message class (Often handled as an class 1 SMS).

See Also:
Constant Field Values

GROUP_GENERAL_DATA_CODING

public static final int GROUP_GENERAL_DATA_CODING
DCS general data coding indication group. 00xxxxxx.

See Also:
Constant Field Values

GROUP_MESSAGE_WAITING_DISCARD

public static final int GROUP_MESSAGE_WAITING_DISCARD
DCS message waiting indication group: discard message. 1100xxxx.

See Also:
Constant Field Values

GROUP_MESSAGE_WAITING_STORE_GSM

public static final int GROUP_MESSAGE_WAITING_STORE_GSM
DCS message waiting indication group: store message (gsm). 1101xxxx.

See Also:
Constant Field Values

GROUP_MESSAGE_WAITING_STORE_UCS2

public static final int GROUP_MESSAGE_WAITING_STORE_UCS2
DCS message waiting indication group: store message (ucs2). 1110xxxx.

See Also:
Constant Field Values

GROUP_DATA_CODING_MESSAGE

public static final int GROUP_DATA_CODING_MESSAGE
DCS data coding/message class: 1111xxxx.

See Also:
Constant Field Values

GROUP_UNKNOWN

public static final int GROUP_UNKNOWN
DCS group unknown.

See Also:
Constant Field Values

DCS_MSG_WAITING_VOICEMAIL

public static final byte DCS_MSG_WAITING_VOICEMAIL
Message waiting indication type - voicemail.

See Also:
Constant Field Values

DCS_MSG_WAITING_FAX

public static final byte DCS_MSG_WAITING_FAX
Message waiting indication type - fax.

See Also:
Constant Field Values

DCS_MSG_WAITING_EMAIL

public static final byte DCS_MSG_WAITING_EMAIL
Message waiting indication type - email.

See Also:
Constant Field Values

DCS_MSG_WAITING_OTHER

public static final byte DCS_MSG_WAITING_OTHER
Message waiting indication type - other. Should not be used.

See Also:
Constant Field Values

dcs_

protected byte dcs_
The encoded dcs.

Constructor Detail

SmsDcs

public SmsDcs(byte dcs)
Creates a specific DCS.

Parameters:
dcs - The dcs.
Method Detail

getValue

public byte getValue()
Returns the encoded dcs.

Returns:
The dcs.

getGeneralDataCodingDcs

public static SmsDcs getGeneralDataCodingDcs(int alphabet,
                                             byte messageClass)
Builds a general-data-coding dcs.

Parameters:
alphabet - The alphabet. Possible values are ALPHABET_GSM, ALPHABET_8BIT, ALPHABET_UCS2 and ALPHABET_RESERVED.
messageClass - The message class. Possible values are MSG_CLASS_0, MSG_CLASS_1, MSG_CLASS_2 and MSG_CLASS_3.
Returns:
A valid general data coding DCS.

getAlphabet

public int getAlphabet()
Decodes the given dcs and returns the alphabet.
 Return value can be one of:
 - ALPHABET_GSM
 - ALPHABET_8BIT
 - ALPHABET_UCS2
 - ALPHABET_RESERVED
 - ALPHABET_UNKNOWN
 

Returns:
Returns the alphabet.

getGroup

public int getGroup()
What group (type of message) is the given dcs.

Returns:
Any of the GROUP_ constants.

getMessageClass

public int getMessageClass()
Get the message class.
 Return value can be one of:
 - MSG_CLASS_UNKNOWN
 - MSG_CLASS_0
 - MSG_CLASS_1
 - MSG_CLASS_2
 - MSG_CLASS_3
 

Returns:
Returns the message class.


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.