pdu.h

Go to the documentation of this file.
00001 #ifndef _PDU_H
00002         #define _PDU_H
00003 
00004 #ifndef _STRING_H
00005         #define _STRING_H
00006         #include <string>
00007 #endif
00008 
00009 /* Define Non-Printable Characters as a question mark */
00010 #define NPC7    63
00011 #define NPC8    '?'
00012 
00013 
00014 /****************************************************************************
00015    This lookup table converts from the 7 bit "default alphabet" as 
00016     defined in ETSI GSM 03.38 to a standard ISO-8859-1 8-bit ASCII.  
00017     
00018     Some characters in the 7-bit alphabet does not exist in the ISO
00019     character set, they are replaced by the NPC8-character.
00020     
00021     If the character is decimal 27 (ESC) the following character have
00022     a special meaning and must be handled separately.
00023 ****************************************************************************/
00024 char lookup_ascii7to8[]={
00025     64,         /*  0      @  COMMERCIAL AT                           */      
00026     163,        /*  1      ?  POUND SIGN                              */      
00027     36,         /*  2      $  DOLLAR SIGN                             */      
00028     165,        /*  3      ?  YEN SIGN                                */      
00029     232,        /*  4      ?  LATIN SMALL LETTER E WITH GRAVE         */      
00030     233,        /*  5      ?  LATIN SMALL LETTER E WITH ACUTE         */      
00031     249,        /*  6      ?  LATIN SMALL LETTER U WITH GRAVE         */      
00032     236,        /*  7      ?  LATIN SMALL LETTER I WITH GRAVE         */      
00033     242,        /*  8      ?  LATIN SMALL LETTER O WITH GRAVE         */      
00034     199,        /*  9      ?  LATIN CAPITAL LETTER C WITH CEDILLA     */      
00035     10,         /*  10        LINE FEED                               */      
00036     216,        /*  11     ?  LATIN CAPITAL LETTER O WITH STROKE      */      
00037     248,        /*  12     ?  LATIN SMALL LETTER O WITH STROKE        */      
00038     13,         /*  13        CARRIAGE RETURN                         */      
00039     197,        /*  14     ?  LATIN CAPITAL LETTER A WITH RING ABOVE  */      
00040     229,        /*  15     ?  LATIN SMALL LETTER A WITH RING ABOVE    */      
00041     NPC8,       /*  16        GREEK CAPITAL LETTER DELTA              */
00042     95,         /*  17     _  LOW LINE                                */      
00043     NPC8,       /*  18        GREEK CAPITAL LETTER PHI                */
00044     NPC8,       /*  19        GREEK CAPITAL LETTER GAMMA              */
00045     NPC8,       /*  20        GREEK CAPITAL LETTER LAMBDA             */
00046     NPC8,       /*  21        GREEK CAPITAL LETTER OMEGA              */
00047     NPC8,       /*  22        GREEK CAPITAL LETTER PI                 */
00048     NPC8,       /*  23        GREEK CAPITAL LETTER PSI                */
00049     NPC8,       /*  24        GREEK CAPITAL LETTER SIGMA              */
00050     NPC8,       /*  25        GREEK CAPITAL LETTER THETA              */
00051     NPC8,       /*  26        GREEK CAPITAL LETTER XI                 */
00052     27,         /*  27        ESCAPE TO EXTENSION TABLE               */
00053     198,        /*  28     ?  LATIN CAPITAL LETTER AE                 */                 
00054     230,        /*  29     ?  LATIN SMALL LETTER AE                   */      
00055     223,        /*  30     ?  LATIN SMALL LETTER SHARP S (German)     */      
00056     201,        /*  31     ?  LATIN CAPITAL LETTER E WITH ACUTE       */      
00057     32,         /*  32        SPACE                                   */       
00058     33,         /*  33     !  EXCLAMATION MARK                        */       
00059     34,         /*  34     "  QUOTATION MARK                          */       
00060     35,         /*  35     #  NUMBER SIGN                             */       
00061     164,        /*  36     ?  CURRENCY SIGN                           */       
00062     37,         /*  37     %  PERCENT SIGN                            */       
00063     38,         /*  38     &  AMPERSAND                               */       
00064     39,         /*  39     '  APOSTROPHE                              */       
00065     40,         /*  40     (  LEFT PARENTHESIS                        */       
00066     41,         /*  41     )  RIGHT PARENTHESIS                       */       
00067     42,         /*  42     *  ASTERISK                                */       
00068     43,         /*  43     +  PLUS SIGN                               */       
00069     44,         /*  44     ,  COMMA                                   */       
00070     45,         /*  45     -  HYPHEN-MINUS                            */       
00071     46,         /*  46     .  FULL STOP                               */       
00072     47,         /*  47     /  SOLIDUS (SLASH)                         */       
00073     48,         /*  48     0  DIGIT ZERO                              */       
00074     49,         /*  49     1  DIGIT ONE                               */       
00075     50,         /*  50     2  DIGIT TWO                               */       
00076     51,         /*  51     3  DIGIT THREE                             */       
00077     52,         /*  52     4  DIGIT FOUR                              */       
00078     53,         /*  53     5  DIGIT FIVE                              */       
00079     54,         /*  54     6  DIGIT SIX                               */       
00080     55,         /*  55     7  DIGIT SEVEN                             */       
00081     56,         /*  56     8  DIGIT EIGHT                             */       
00082     57,         /*  57     9  DIGIT NINE                              */       
00083     58,         /*  58     :  COLON                                   */       
00084     59,         /*  59     ;  SEMICOLON                               */       
00085     60,         /*  60     <  LESS-THAN SIGN                          */       
00086     61,         /*  61     =  EQUALS SIGN                             */       
00087     62,         /*  62     >  GREATER-THAN SIGN                       */                                       
00088     63,         /*  63     ?  QUESTION MARK                           */       
00089     161,        /*  64     ?  INVERTED EXCLAMATION MARK               */       
00090     65,         /*  65     A  LATIN CAPITAL LETTER A                  */       
00091     66,         /*  66     B  LATIN CAPITAL LETTER B                  */       
00092     67,         /*  67     C  LATIN CAPITAL LETTER C                  */       
00093     68,         /*  68     D  LATIN CAPITAL LETTER D                  */       
00094     69,         /*  69     E  LATIN CAPITAL LETTER E                  */       
00095     70,         /*  70     F  LATIN CAPITAL LETTER F                  */       
00096     71,         /*  71     G  LATIN CAPITAL LETTER G                  */       
00097     72,         /*  72     H  LATIN CAPITAL LETTER H                  */       
00098     73,         /*  73     I  LATIN CAPITAL LETTER I                  */       
00099     74,         /*  74     J  LATIN CAPITAL LETTER J                  */       
00100     75,         /*  75     K  LATIN CAPITAL LETTER K                  */       
00101     76,         /*  76     L  LATIN CAPITAL LETTER L                  */       
00102     77,         /*  77     M  LATIN CAPITAL LETTER M                  */       
00103     78,         /*  78     N  LATIN CAPITAL LETTER N                  */       
00104     79,         /*  79     O  LATIN CAPITAL LETTER O                  */       
00105     80,         /*  80     P  LATIN CAPITAL LETTER P                  */       
00106     81,         /*  81     Q  LATIN CAPITAL LETTER Q                  */       
00107     82,         /*  82     R  LATIN CAPITAL LETTER R                  */       
00108     83,         /*  83     S  LATIN CAPITAL LETTER S                  */       
00109     84,         /*  84     T  LATIN CAPITAL LETTER T                  */       
00110     85,         /*  85     U  LATIN CAPITAL LETTER U                  */       
00111     86,         /*  86     V  LATIN CAPITAL LETTER V                  */       
00112     87,         /*  87     W  LATIN CAPITAL LETTER W                  */       
00113     88,         /*  88     X  LATIN CAPITAL LETTER X                  */       
00114     89,         /*  89     Y  LATIN CAPITAL LETTER Y                  */       
00115     90,         /*  90     Z  LATIN CAPITAL LETTER Z                  */       
00116     196,        /*  91     ?  LATIN CAPITAL LETTER A WITH DIAERESIS   */       
00117     214,        /*  92     ?  LATIN CAPITAL LETTER O WITH DIAERESIS   */       
00118     209,        /*  93     ?  LATIN CAPITAL LETTER N WITH TILDE       */       
00119     220,        /*  94     ?  LATIN CAPITAL LETTER U WITH DIAERESIS   */       
00120     167,        /*  95     ?  SECTION SIGN                            */       
00121     191,        /*  96     ?  INVERTED QUESTION MARK                  */       
00122     97,         /*  97     a  LATIN SMALL LETTER A                    */       
00123     98,         /*  98     b  LATIN SMALL LETTER B                    */       
00124     99,         /*  99     c  LATIN SMALL LETTER C                    */       
00125     100,        /*  100    d  LATIN SMALL LETTER D                    */       
00126     101,        /*  101    e  LATIN SMALL LETTER E                    */       
00127     102,        /*  102    f  LATIN SMALL LETTER F                    */                                       
00128     103,        /*  103    g  LATIN SMALL LETTER G                    */       
00129     104,        /*  104    h  LATIN SMALL LETTER H                    */       
00130     105,        /*  105    i  LATIN SMALL LETTER I                    */       
00131     106,        /*  106    j  LATIN SMALL LETTER J                    */       
00132     107,        /*  107    k  LATIN SMALL LETTER K                    */       
00133     108,        /*  108    l  LATIN SMALL LETTER L                    */       
00134     109,        /*  109    m  LATIN SMALL LETTER M                    */       
00135     110,        /*  110    n  LATIN SMALL LETTER N                    */       
00136     111,        /*  111    o  LATIN SMALL LETTER O                    */       
00137     112,        /*  112    p  LATIN SMALL LETTER P                    */       
00138     113,        /*  113    q  LATIN SMALL LETTER Q                    */       
00139     114,        /*  114    r  LATIN SMALL LETTER R                    */       
00140     115,        /*  115    s  LATIN SMALL LETTER S                    */       
00141     116,        /*  116    t  LATIN SMALL LETTER T                    */       
00142     117,        /*  117    u  LATIN SMALL LETTER U                    */       
00143     118,        /*  118    v  LATIN SMALL LETTER V                    */       
00144     119,        /*  119    w  LATIN SMALL LETTER W                    */       
00145     120,        /*  120    x  LATIN SMALL LETTER X                    */       
00146     121,        /*  121    y  LATIN SMALL LETTER Y                    */       
00147     122,        /*  122    z  LATIN SMALL LETTER Z                    */       
00148     228,        /*  123    ?  LATIN SMALL LETTER A WITH DIAERESIS     */       
00149     246,        /*  124    ?  LATIN SMALL LETTER O WITH DIAERESIS     */       
00150     241,        /*  125    ?  LATIN SMALL LETTER N WITH TILDE         */       
00151     252,        /*  126    ?  LATIN SMALL LETTER U WITH DIAERESIS     */       
00152     224         /*  127    ?  LATIN SMALL LETTER A WITH GRAVE         */
00153 };
00154 
00155 /****************************************************************************
00156     This lookup table converts from ISO-8859-1 8-bit ASCII to the
00157     7 bit "default alphabet" as defined in ETSI GSM 03.38
00158 
00159     ISO-characters that don't have any correspondning character in the
00160     7-bit alphabet is replaced with the NPC7-character.  If there's
00161     a close match between the ISO-char and a 7-bit character (for example
00162     the letter i with a circumflex and the plain i-character) a substitution
00163     is done. These "close-matches" are marked in the lookup table by
00164     having its value negated.
00165     
00166     There are some character (for example the curly brace "}") that must
00167     be converted into a 2 byte 7-bit sequence.  These characters are
00168     marked in the table by having 256 added to its value.              
00169 ****************************************************************************/
00170 
00171 char lookup_ascii8to7[]= {
00172     NPC7,       /*     0      null [NUL]                              */
00173     NPC7,       /*     1      start of heading [SOH]                  */
00174     NPC7,       /*     2      start of text [STX]                     */
00175     NPC7,       /*     3      end of text [ETX]                       */
00176     NPC7,       /*     4      end of transmission [EOT]               */
00177     NPC7,       /*     5      enquiry [ENQ]                           */
00178     NPC7,       /*     6      acknowledge [ACK]                       */
00179     NPC7,       /*     7      bell [BEL]                              */
00180     NPC7,       /*     8      backspace [BS]                          */
00181     NPC7,       /*     9      horizontal tab [HT]                     */
00182     10,         /*    10      line feed [LF]                          */
00183     NPC7,       /*    11      vertical tab [VT]                       */
00184     10+256,     /*    12      form feed [FF]                          */
00185     13,         /*    13      carriage return [CR]                    */
00186     NPC7,       /*    14      shift out [SO]                          */
00187     NPC7,       /*    15      shift in [SI]                           */
00188     NPC7,       /*    16      data link escape [DLE]                  */
00189     NPC7,       /*    17      device control 1 [DC1]                  */
00190     NPC7,       /*    18      device control 2 [DC2]                  */
00191     NPC7,       /*    19      device control 3 [DC3]                  */
00192     NPC7,       /*    20      device control 4 [DC4]                  */
00193     NPC7,       /*    21      negative acknowledge [NAK]              */
00194     NPC7,       /*    22      synchronous idle [SYN]                  */
00195     NPC7,       /*    23      end of trans. block [ETB]               */
00196     NPC7,       /*    24      cancel [CAN]                            */
00197     NPC7,       /*    25      end of medium [EM]                      */
00198     NPC7,       /*    26      substitute [SUB]                        */
00199     NPC7,       /*    27      escape [ESC]                            */
00200     NPC7,       /*    28      file separator [FS]                     */
00201     NPC7,       /*    29      group separator [GS]                    */
00202     NPC7,       /*    30      record separator [RS]                   */
00203     NPC7,       /*    31      unit separator [US]                     */
00204     32,         /*    32      space                                   */
00205     33,         /*    33    ! exclamation mark                        */
00206     34,         /*    34    " double quotation mark                   */
00207     35,         /*    35    # number sign                             */
00208     2,          /*    36    $ dollar sign                             */
00209     37,         /*    37    % percent sign                            */
00210     38,         /*    38    & ampersand                               */
00211     39,         /*    39    ' apostrophe                              */
00212     40,         /*    40    ( left parenthesis                        */
00213     41,         /*    41    ) right parenthesis                       */
00214     42,         /*    42    * asterisk                                */
00215     43,         /*    43    + plus sign                               */
00216     44,         /*    44    , comma                                   */
00217     45,         /*    45    - hyphen                                  */
00218     46,         /*    46    . period                                  */
00219     47,         /*    47    / slash,                                  */
00220     48,         /*    48    0 digit 0                                 */
00221     49,         /*    49    1 digit 1                                 */
00222     50,         /*    50    2 digit 2                                 */
00223     51,         /*    51    3 digit 3                                 */
00224     52,         /*    52    4 digit 4                                 */
00225     53,         /*    53    5 digit 5                                 */
00226     54,         /*    54    6 digit 6                                 */
00227     55,         /*    55    7 digit 7                                 */
00228     56,         /*    56    8 digit 8                                 */
00229     57,         /*    57    9 digit 9                                 */
00230     58,         /*    58    : colon                                   */
00231     59,         /*    59    ; semicolon                               */
00232     60,         /*    60    < less-than sign                          */
00233     61,         /*    61    = equal sign                              */
00234     62,         /*    62    > greater-than sign                       */
00235     63,         /*    63    ? question mark                           */
00236     0,          /*    64    @ commercial at sign                      */
00237     65,         /*    65    A uppercase A                             */
00238     66,         /*    66    B uppercase B                             */
00239     67,         /*    67    C uppercase C                             */
00240     68,         /*    68    D uppercase D                             */
00241     69,         /*    69    E uppercase E                             */
00242     70,         /*    70    F uppercase F                             */
00243     71,         /*    71    G uppercase G                             */
00244     72,         /*    72    H uppercase H                             */
00245     73,         /*    73    I uppercase I                             */
00246     74,         /*    74    J uppercase J                             */
00247     75,         /*    75    K uppercase K                             */
00248     76,         /*    76    L uppercase L                             */
00249     77,         /*    77    M uppercase M                             */
00250     78,         /*    78    N uppercase N                             */
00251     79,         /*    79    O uppercase O                             */
00252     80,         /*    80    P uppercase P                             */
00253     81,         /*    81    Q uppercase Q                             */
00254     82,         /*    82    R uppercase R                             */
00255     83,         /*    83    S uppercase S                             */
00256     84,         /*    84    T uppercase T                             */
00257     85,         /*    85    U uppercase U                             */
00258     86,         /*    86    V uppercase V                             */
00259     87,         /*    87    W uppercase W                             */
00260     88,         /*    88    X uppercase X                             */
00261     89,         /*    89    Y uppercase Y                             */
00262     90,         /*    90    Z uppercase Z                             */
00263     60+256,     /*    91    [ left square bracket                     */
00264     47+256,     /*    92    \ backslash                               */
00265     62+256,     /*    93    ] right square bracket                    */
00266     20+256,     /*    94    ^ circumflex accent                       */
00267     17,         /*    95    _ underscore                              */
00268     -39,        /*    96    ` back apostrophe                         */
00269     97,         /*    97    a lowercase a                             */
00270     98,         /*    98    b lowercase b                             */
00271     99,         /*    99    c lowercase c                             */
00272     100,        /*   100    d lowercase d                             */
00273     101,        /*   101    e lowercase e                             */
00274     102,        /*   102    f lowercase f                             */
00275     103,        /*   103    g lowercase g                             */
00276     104,        /*   104    h lowercase h                             */
00277     105,        /*   105    i lowercase i                             */
00278     106,        /*   106    j lowercase j                             */
00279     107,        /*   107    k lowercase k                             */
00280     108,        /*   108    l lowercase l                             */
00281     109,        /*   109    m lowercase m                             */
00282     110,        /*   110    n lowercase n                             */
00283     111,        /*   111    o lowercase o                             */
00284     112,        /*   112    p lowercase p                             */
00285     113,        /*   113    q lowercase q                             */
00286     114,        /*   114    r lowercase r                             */
00287     115,        /*   115    s lowercase s                             */
00288     116,        /*   116    t lowercase t                             */
00289     117,        /*   117    u lowercase u                             */
00290     118,        /*   118    v lowercase v                             */
00291     119,        /*   119    w lowercase w                             */
00292     120,        /*   120    x lowercase x                             */
00293     121,        /*   121    y lowercase y                             */
00294     122,        /*   122    z lowercase z                             */
00295     40+256,     /*   123    { left brace                              */
00296     64+256,     /*   124    | vertical bar                            */
00297     41+256,     /*   125    } right brace                             */
00298     61+256,     /*   126    ~ tilde accent                            */
00299     NPC7,       /*   127      delete [DEL]                            */
00300     NPC7,       /*   128                                              */
00301     NPC7,       /*   129                                              */
00302     -39,        /*   130      low left rising single quote            */
00303     -102,       /*   131      lowercase italic f                      */
00304     -34,        /*   132      low left rising double quote            */
00305     NPC7,       /*   133      low horizontal ellipsis                 */
00306     NPC7,       /*   134      dagger mark                             */
00307     NPC7,       /*   135      double dagger mark                      */
00308     NPC7,       /*   136      letter modifying circumflex             */
00309     NPC7,       /*   137      per thousand (mille) sign               */
00310     -83,        /*   138      uppercase S caron or hacek              */
00311     -39,        /*   139      left single angle quote mark            */
00312     -214,       /*   140      uppercase OE ligature                   */
00313     NPC7,       /*   141                                              */
00314     NPC7,       /*   142                                              */
00315     NPC7,       /*   143                                              */
00316     NPC7,       /*   144                                              */
00317     -39,        /*   145      left single quotation mark              */
00318     -39,        /*   146      right single quote mark                 */
00319     -34,        /*   147      left double quotation mark              */
00320     -34,        /*   148      right double quote mark                 */
00321     -42,        /*   149      round filled bullet                     */
00322     -45,        /*   150      en dash                                 */
00323     -45,        /*   151      em dash                                 */
00324     -39,        /*   152      small spacing tilde accent              */
00325     NPC7,       /*   153      trademark sign                          */
00326     -115,       /*   154      lowercase s caron or hacek              */
00327     -39,        /*   155      right single angle quote mark           */
00328     -111,       /*   156      lowercase oe ligature                   */
00329     NPC7,       /*   157                                              */
00330     NPC7,       /*   158                                              */
00331     -89,        /*   159      uppercase Y dieresis or umlaut          */
00332     -32,        /*   160    ? non-breaking space                      */
00333     64,         /*   161    ? inverted exclamation mark               */
00334     -99,        /*   162    ? cent sign                               */
00335     1,          /*   163    ? pound sterling sign                     */
00336     36,         /*   164    ? general currency sign                   */
00337     3,          /*   165    ? yen sign                                */
00338     -33,        /*   166    ? broken vertical bar                     */
00339     95,         /*   167    ? section sign                            */
00340     -34,        /*   168    ? spacing dieresis or umlaut              */
00341     NPC7,       /*   169    ? copyright sign                          */
00342     NPC7,       /*   170    ? feminine ordinal indicator              */
00343     -60,        /*   171    ? left (double) angle quote               */
00344     NPC7,       /*   172    ? logical not sign                        */
00345     -45,        /*   173    ? soft hyphen                             */
00346     NPC7,       /*   174    ? registered trademark sign               */
00347     NPC7,       /*   175    ? spacing macron (long) accent            */
00348     NPC7,       /*   176    ? degree sign                             */
00349     NPC7,       /*   177    ? plus-or-minus sign                      */
00350     -50,        /*   178    ? superscript 2                           */
00351     -51,        /*   179    ? superscript 3                           */
00352     -39,        /*   180    ? spacing acute accent                    */
00353     -117,       /*   181    ? micro sign                              */
00354     NPC7,       /*   182    ? paragraph sign, pilcrow sign            */
00355     NPC7,       /*   183    ? middle dot, centered dot                */
00356     NPC7,       /*   184    ? spacing cedilla                         */
00357     -49,        /*   185    ? superscript 1                           */
00358     NPC7,       /*   186    ? masculine ordinal indicator             */
00359     -62,        /*   187    ? right (double) angle quote (guillemet)  */
00360     NPC7,       /*   188    ? fraction 1/4                            */
00361     NPC7,       /*   189    ? fraction 1/2                            */
00362     NPC7,       /*   190    ? fraction 3/4                            */
00363     96,         /*   191    ? inverted question mark                  */
00364     -65,        /*   192    ? uppercase A grave                       */
00365     -65,        /*   193    ? uppercase A acute                       */
00366     -65,        /*   194    ? uppercase A circumflex                  */
00367     -65,        /*   195    ? uppercase A tilde                       */
00368     91,         /*   196    ? uppercase A dieresis or umlaut          */
00369     14,         /*   197    ? uppercase A ring                        */
00370     28,         /*   198    ? uppercase AE ligature                   */
00371     9,          /*   199    ? uppercase C cedilla                     */
00372     -31,        /*   200    ? uppercase E grave                       */
00373     31,         /*   201    ? uppercase E acute                       */
00374     -31,        /*   202    ? uppercase E circumflex                  */
00375     -31,        /*   203    ? uppercase E dieresis or umlaut          */
00376     -73,        /*   204    ? uppercase I grave                       */
00377     -73,        /*   205    ? uppercase I acute                       */
00378     -73,        /*   206    ? uppercase I circumflex                  */
00379     -73,        /*   207    ? uppercase I dieresis or umlaut          */
00380     -68,        /*   208    ? uppercase ETH                           */
00381     93,         /*   209    ? uppercase N tilde                       */
00382     -79,        /*   210    ? uppercase O grave                       */
00383     -79,        /*   211    ? uppercase O acute                       */
00384     -79,        /*   212    ? uppercase O circumflex                  */
00385     -79,        /*   213    ? uppercase O tilde                       */
00386     92,         /*   214    ? uppercase O dieresis or umlaut          */
00387     -42,        /*   215    ? multiplication sign                     */
00388     11,         /*   216    ? uppercase O slash                       */
00389     -85,        /*   217    ? uppercase U grave                       */
00390     -85,        /*   218    ? uppercase U acute                       */
00391     -85,        /*   219    ? uppercase U circumflex                  */
00392     94,         /*   220    ? uppercase U dieresis or umlaut          */
00393     -89,        /*   221    ? uppercase Y acute                       */
00394     NPC7,       /*   222    ? uppercase THORN                         */
00395     30,         /*   223    ? lowercase sharp s, sz ligature          */
00396     127,        /*   224    ? lowercase a grave                       */
00397     -97,        /*   225    ? lowercase a acute                       */
00398     -97,        /*   226    ? lowercase a circumflex                  */
00399     -97,        /*   227    ? lowercase a tilde                       */
00400     123,        /*   228    ? lowercase a dieresis or umlaut          */
00401     15,         /*   229    ? lowercase a ring                        */
00402     29,         /*   230    ? lowercase ae ligature                   */
00403     -9,         /*   231    ? lowercase c cedilla                     */
00404     4,          /*   232    ? lowercase e grave                       */
00405     5,          /*   233    ? lowercase e acute                       */
00406     -101,       /*   234    ? lowercase e circumflex                  */
00407     -101,       /*   235    ? lowercase e dieresis or umlaut          */
00408     7,          /*   236    ? lowercase i grave                       */
00409     7,          /*   237    ? lowercase i acute                       */
00410     -105,       /*   238    ? lowercase i circumflex                  */
00411     -105,       /*   239    ? lowercase i dieresis or umlaut          */
00412     NPC7,       /*   240    ? lowercase eth                           */
00413     125,        /*   241    ? lowercase n tilde                       */
00414     8,          /*   242    ? lowercase o grave                       */
00415     -111,       /*   243    ? lowercase o acute                       */
00416     -111,       /*   244    ? lowercase o circumflex                  */
00417     -111,       /*   245    ? lowercase o tilde                       */
00418     124,        /*   246    ? lowercase o dieresis or umlaut          */
00419     -47,        /*   247    ? division sign                           */
00420     12,         /*   248    ? lowercase o slash                       */
00421     6,          /*   249    ? lowercase u grave                       */
00422     -117,       /*   250    ? lowercase u acute                       */
00423     -117,       /*   251    ? lowercase u circumflex                  */
00424     126,        /*   252    ? lowercase u dieresis or umlaut          */
00425     -121,       /*   253    ? lowercase y acute                       */
00426     NPC7,       /*   254    ? lowercase thorn                         */
00427     -121        /*   255    ? lowercase y dieresis or umlaut          */
00428 };
00429 
00430 using std::string;
00431 
00432 class pdu {
00433         private:
00434                 int     smsc_length;
00435                 int     smsc_type_of_address;
00436                 string  smsc_number;
00437                 int     sms_deliver;                    //SMS-DELIVER message
00438                 int     sender_length;
00439                 int     sender_type_of_address;
00440                 string  sender_number;
00441                 int             tp_pid;                                 // protocol identifier
00442                 int             tp_msgref;                              // TP - message reference
00443                 int             tp_dcs;                                 // data coding scheme
00444                 string  tp_scts;                                // timestamp
00445                 int             tp_validity;                    // TP Validity
00446                 int             tp_length;                              // lenght of data ( dependent of dcs)
00447                 string  tp_data;                                // the data of the message
00448                 string  PDU_ERROR;                              //--unused
00449                 string  tp_text;                                //--internal use for storing sms text before creating the pdu string
00450                 int             tp_dcs_alpha;                   //--internal use for storing alphabet size when creating the pdu string
00451 
00452                 
00453                 
00454                 string semiOctetToString (string);
00455                 string stringToSemiOctet (string);
00456                 int hexStringToInt (string);
00457                 string intToHexString (int);
00458                 int binStringToInt (string);
00459                 string intToBinString (int);
00460                 int pow(int , int );
00461                 int stoi(string);
00462                 int getDCSAlphabet(void);
00463                 void parsePDU_send ( string pdustring );
00464                 void parsePDU_receive ( string pdustring );
00465                 string userData(void);
00466                 string userData7_to_8(void);
00467                 string userData8_to_8(void);
00468                 string userData16_to_8(void);
00469                 string userTextTo7(void);
00470         public:
00471                 pdu (){ this->tp_dcs_alpha = 0; };
00472                 ~pdu (){};
00473                 void parsePDU ( string pdustring );
00474                 string getText(void);
00475                 string getSender(void);
00476                 int setText(string);
00477                 int setSender(string);
00478                 string encodePDU(void);
00479                 
00480 };
00481 
00482 #endif
00483 

Generated on Tue May 31 20:21:08 2005 for sendsms by  doxygen 1.4.2