CGSMAlphabets.java
上传用户:shunchung
上传日期:2013-04-07
资源大小:438k
文件大小:9k
- // jSMSEngine API.
- // An open-source API package for sending and receiving SMS via a GSM device.
- // Copyright (C) 2002-2006, Thanasis Delenikas, Athens/GREECE
- // Web Site: http://www.jsmsengine.org
- //
- // jSMSEngine is a package which can be used in order to add SMS processing
- // capabilities in an application. jSMSEngine is written in Java. It allows you
- // to communicate with a compatible mobile phone or GSM Modem, and
- // send / receive SMS messages.
- //
- // jSMSEngine is distributed under the LGPL license.
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Lesser General Public
- // License as published by the Free Software Foundation; either
- // version 2.1 of the License, or (at your option) any later version.
- // This library is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- // Lesser General Public License for more details.
- // You should have received a copy of the GNU Lesser General Public
- // License along with this library; if not, write to the Free Software
- // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- //
- package org.jsmsengine;
- /**
- This class contains the conversion routines to and from the standard 7bit
- GSM alphabet.
- <br><br>
- Every normal ASCII character must be converted according to the GSM 7bit
- default alphabet before dispatching through the GSM device. The opposite
- conversion is made when a message is received.
- <br><br>
- Since some characters in 7bit alphabet are in the position where control
- characters exist in the ASCII alphabet, each message is represented in
- HEX format as well (field hexText in CMessage class and descendants).
- When talking to the GSM device, either for reading messages, or for
- sending messages, a special mode is used where each character of the
- actual message is represented by two hexadecimal digits.
- So there is another conversion step here, in order to get the ASCII
- character from each pair of hex digits, and vice verca.
- <br><br>
- Note: currently, only GSM default 7Bit character set is supported.
- In all routines, you may assume the "charSet" parameter as constant.
- */
- class CGSMAlphabets
- {
- protected static final int GSM7BITDEFAULT = 1;
- private static final String alphabet = "@