pdulib
pdulib.h
Go to the documentation of this file.
1 
12 #ifdef PDU_LIB_INCLUDE
13 #else
14 #define PDU_LIB_INCLUDE
15 #define BITMASK_7BITS 0x7F
16 
17 // DCS bit masks
18 #define DCS_COMPRESSED (5<<1)
19 #define DCS_CLASS_MEANING (4<<1)
20 #define DCS_ALPHABET_MASK (3<<2)
21 #define DCS_ALPHABET_OFFSET 2
22 #define DCS_7BIT_ALPHABET_MASK 0B0000 //(0<<2)
23 #define DCS_8BIT_ALPHABET_MASK 0B0100 //1<<2)
24 #define DCS_16BIT_ALPHABET_MASK 0B1000 //(2<<2)
25 #define DCS_CLASS_MASK 3
26 #define DCS_IMMEDIATE_DISPLAY 3
27 #define DCS_ME_SPECIFIC_MASK 1
28 #define DCS_SIM_SPECIFIC_MASK 2
29 #define DCS_TE_SPECIFIC_MASK 3
30 
31  // PDU bits
32 #define PDU_VALIDITY_MASK_OFFSET 3
33 #define PDU_VALIDITY_NOT_PRESENT 0
34 #define PDU_VALIDITY_PRESENT_RELATIVE 2
35 #define PDU_VALIDITY_PRESENT_ENHANCED 1
36 #define PDU_VALIDITY_PRESENT_ABSOLUTE 3
37 #define PSU_SMS_DELIVER 0
38 #define PSU_SMS_SUBMIT 1
39 
40 // type of address
41 #define INTERNATIONAL_NUMBER 0x91
42 #define NATIONAL_NUMBER 0xA1
43 
44 #define EXT_MASK 0x80 // bit 7
45 #define TON_MASK 0x70 // bits 4-6
46 #define TON_OFFSET 4
47 #define NPI_MASK 0x0f // bits 0-3
48 
49 #define MAX_SMS_LENGTH_7BIT 160 // GSM 3.4
50 #define MAX_NUMBER_LENGTH 20 // gets packed into BCD or packed 7 bit
51 
52 //SCA (12) + type + mref + address(12) + pid + dcs + length + data(140) -- no valtime
53 #define PDU_BINARY_MAX_LENGTH 170
54 
55  /* Define Non-Printable Characters as a question mark */
56 #define NPC7 63
57 #define NPC8 '?'
58 
59 enum eDCS { ALPHABET_7BIT, ALPHABET_8BIT, ALPHABET_16BIT };
60 enum eAddressType {INTERNATIONAL_NUMERIC,NATIONAL_NUMERIC,ALPHABETIC};
61 enum eLengthType {OCTETS,NIBBLES}; // SCA is in octets, sender/recipient nibbles
67 class PDU
68 {
69 public:
70  PDU();
71  ~PDU();
79  int encodePDU(const char *recipient,const char *message);
85  const char *getSMS();
93  void setSCAnumber(const char *number);
102  bool decodePDU(const char *pdu);
103  //const char *getSCA();
109  char *getSCAnumber();
115  const char *getSender();
121  const char *getTimeStamp();
127  const unsigned char *getText();
128 private:
129  // following for storing decode fields of incoming messages
130  int scalength;
131  char scabuff[MAX_NUMBER_LENGTH];
132  int addressLength; // in octets
133  char addressBuff[MAX_NUMBER_LENGTH]; // ample for any phone number
134  int meslength;
135  unsigned char mesbuff[MAX_SMS_LENGTH_7BIT]; // actually packed 7 bit is 140
136  int tslength;
137  char tsbuff[20]; // big enough for timestamp
138  char scanumber[MAX_NUMBER_LENGTH];
139  // following for buiulding an SMS-SUBMIT message - Binary not ASCII
140  int addressType; // GSM 3.04 for building address part of SMS SUBMIT
141  int smsOffset;
142  char smsSubmit[PDU_BINARY_MAX_LENGTH*2]; // big enough for largest message
143  // helper methods
144  //bool setMessage(const char *message,eDCS);
145 
146  void stringToBCD(const char *number, char *pdu);
147  void BCDtoString(char *number, const char *pdu,int length);
148  void digitSwap(const char *number, char *pdu);
149 
150  int ascii_to_pdu(const char *ascii, char *pdu);
151  int pdu_to_ascii(const char *pdu, int pdulength, char *ascii);
152 
153  int convert_ascii_to_7bit(const char *ascii, char *a7bit);
154  int convert_7bit_to_ascii(uint8_t *a7bit, int length, char *ascii);
155 
156  uint8_t gethex(const char *pc);
157  void putHex(unsigned char b, char *target);
158  // return number of ucs2 octets in output array
159  int pdu_to_ucs2(const char *pdu, int length, uint16_t *ucs2);
160  // callers responsibilty that utf8 array is big enough
161  int ucs2_to_utf8(unsigned short ucs2, unsigned char *utf8);
162  // callers responsibilty that ucs2 array is big enough
163  int utf8_to_ucs2_single(const char *utf8, short *ucs2); // translate to a single uds2
164  int utf8_to_ucs2(const char *utf8, char *ucs2); // translate an utf8 zero terminated string
165  // get length of next utf8
166  int utf8Length(const char *);
167  bool decodeAddress(const char *,char *, eLengthType); // pdu to readable starts with length octet
168  bool setAddress(const char *,eAddressType,eLengthType);
169 };
170 
171 /****************************************************************************
172 This lookup table converts from ISO-8859-1 8-bit ASCII to the
173 7 bit "default alphabet" as defined in ETSI GSM 03.38
174 
175 ISO-characters that don't have any correspondning character in the
176 7-bit alphabet is replaced with the NPC7-character. If there's
177 a close match between the ISO-char and a 7-bit character (for example
178 the letter i with a circumflex and the plain i-character) a substitution
179 is done. These "close-matches" are marked in the lookup table by
180 having its value negated.
181 
182 There are some character (for example the curly brace "}") that must
183 be converted into a 2 uint8_t 7-bit sequence. These characters are
184 marked in the table by having 256 added to its value.
185 ****************************************************************************/
186 const
187 #ifdef PM
188  PROGMEM
189 #endif
190 int16_t lookup_ascii8to7[] = {
191  NPC7, /* 0 null [NUL] */
192  NPC7, /* 1 start of heading [SOH] */
193  NPC7, /* 2 start of text [STX] */
194  NPC7, /* 3 end of text [ETX] */
195  NPC7, /* 4 end of transmission [EOT] */
196  NPC7, /* 5 enquiry [ENQ] */
197  NPC7, /* 6 acknowledge [ACK] */
198  NPC7, /* 7 bell [BEL] */
199  NPC7, /* 8 backspace [BS] */
200  NPC7, /* 9 horizontal tab [HT] */
201  10, /* 10 line feed [LF] */
202  NPC7, /* 11 vertical tab [VT] */
203  10 + 256, /* 12 form feed [FF] */
204  13, /* 13 carriage return [CR] */
205  NPC7, /* 14 shift out [SO] */
206  NPC7, /* 15 shift in [SI] */
207  NPC7, /* 16 data link escape [DLE] */
208  NPC7, /* 17 device control 1 [DC1] */
209  NPC7, /* 18 device control 2 [DC2] */
210  NPC7, /* 19 device control 3 [DC3] */
211  NPC7, /* 20 device control 4 [DC4] */
212  NPC7, /* 21 negative acknowledge [NAK] */
213  NPC7, /* 22 synchronous idle [SYN] */
214  NPC7, /* 23 end of trans. block [ETB] */
215  NPC7, /* 24 cancel [CAN] */
216  NPC7, /* 25 end of medium [EM] */
217  NPC7, /* 26 substitute [SUB] */
218  NPC7, /* 27 escape [ESC] */
219  NPC7, /* 28 file separator [FS] */
220  NPC7, /* 29 group separator [GS] */
221  NPC7, /* 30 record separator [RS] */
222  NPC7, /* 31 unit separator [US] */
223  32, /* 32 space */
224  33, /* 33 ! exclamation mark */
225  34, /* 34 " double quotation mark */
226  35, /* 35 # number sign */
227  2, /* 36 $ dollar sign */
228  37, /* 37 % percent sign */
229  38, /* 38 & ampersand */
230  39, /* 39 ' apostrophe */
231  40, /* 40 ( left parenthesis */
232  41, /* 41 ) right parenthesis */
233  42, /* 42 * asterisk */
234  43, /* 43 + plus sign */
235  44, /* 44 , comma */
236  45, /* 45 - hyphen */
237  46, /* 46 . period */
238  47, /* 47 / slash, */
239  48, /* 48 0 digit 0 */
240  49, /* 49 1 digit 1 */
241  50, /* 50 2 digit 2 */
242  51, /* 51 3 digit 3 */
243  52, /* 52 4 digit 4 */
244  53, /* 53 5 digit 5 */
245  54, /* 54 6 digit 6 */
246  55, /* 55 7 digit 7 */
247  56, /* 56 8 digit 8 */
248  57, /* 57 9 digit 9 */
249  58, /* 58 : colon */
250  59, /* 59 ; semicolon */
251  60, /* 60 < less-than sign */
252  61, /* 61 = equal sign */
253  62, /* 62 > greater-than sign */
254  63, /* 63 ? question mark */
255  0, /* 64 @ commercial at sign */
256  65, /* 65 A uppercase A */
257  66, /* 66 B uppercase B */
258  67, /* 67 C uppercase C */
259  68, /* 68 D uppercase D */
260  69, /* 69 E uppercase E */
261  70, /* 70 F uppercase F */
262  71, /* 71 G uppercase G */
263  72, /* 72 H uppercase H */
264  73, /* 73 I uppercase I */
265  74, /* 74 J uppercase J */
266  75, /* 75 K uppercase K */
267  76, /* 76 L uppercase L */
268  77, /* 77 M uppercase M */
269  78, /* 78 N uppercase N */
270  79, /* 79 O uppercase O */
271  80, /* 80 P uppercase P */
272  81, /* 81 Q uppercase Q */
273  82, /* 82 R uppercase R */
274  83, /* 83 S uppercase S */
275  84, /* 84 T uppercase T */
276  85, /* 85 U uppercase U */
277  86, /* 86 V uppercase V */
278  87, /* 87 W uppercase W */
279  88, /* 88 X uppercase X */
280  89, /* 89 Y uppercase Y */
281  90, /* 90 Z uppercase Z */
282  60 + 256, /* 91 [ left square bracket */
283  47 + 256, /* 92 \ backslash */
284  62 + 256, /* 93 ] right square bracket */
285  20 + 256, /* 94 ^ circumflex accent */
286  17, /* 95 _ underscore */
287  -39, /* 96 ` back apostrophe */
288  97, /* 97 a lowercase a */
289  98, /* 98 b lowercase b */
290  99, /* 99 c lowercase c */
291  100, /* 100 d lowercase d */
292  101, /* 101 e lowercase e */
293  102, /* 102 f lowercase f */
294  103, /* 103 g lowercase g */
295  104, /* 104 h lowercase h */
296  105, /* 105 i lowercase i */
297  106, /* 106 j lowercase j */
298  107, /* 107 k lowercase k */
299  108, /* 108 l lowercase l */
300  109, /* 109 m lowercase m */
301  110, /* 110 n lowercase n */
302  111, /* 111 o lowercase o */
303  112, /* 112 p lowercase p */
304  113, /* 113 q lowercase q */
305  114, /* 114 r lowercase r */
306  115, /* 115 s lowercase s */
307  116, /* 116 t lowercase t */
308  117, /* 117 u lowercase u */
309  118, /* 118 v lowercase v */
310  119, /* 119 w lowercase w */
311  120, /* 120 x lowercase x */
312  121, /* 121 y lowercase y */
313  122, /* 122 z lowercase z */
314  40 + 256, /* 123 { left brace */
315  64 + 256, /* 124 | vertical bar */
316  41 + 256, /* 125 } right brace */
317  61 + 256, /* 126 ~ tilde accent */
318  NPC7, /* 127 delete [DEL] */
319  NPC7, /* 128 */
320  NPC7, /* 129 */
321  -39, /* 130 low left rising single quote */
322  -102, /* 131 lowercase italic f */
323  -34, /* 132 low left rising double quote */
324  NPC7, /* 133 low horizontal ellipsis */
325  NPC7, /* 134 dagger mark */
326  NPC7, /* 135 double dagger mark */
327  NPC7, /* 136 letter modifying circumflex */
328  NPC7, /* 137 per thousand (mille) sign */
329  -83, /* 138 uppercase S caron or hacek */
330  -39, /* 139 left single angle quote mark */
331  -214, /* 140 uppercase OE ligature */
332  NPC7, /* 141 */
333  NPC7, /* 142 */
334  NPC7, /* 143 */
335  NPC7, /* 144 */
336  -39, /* 145 left single quotation mark */
337  -39, /* 146 right single quote mark */
338  -34, /* 147 left double quotation mark */
339  -34, /* 148 right double quote mark */
340  -42, /* 149 round filled bullet */
341  -45, /* 150 en dash */
342  -45, /* 151 em dash */
343  -39, /* 152 small spacing tilde accent */
344  NPC7, /* 153 trademark sign */
345  -115, /* 154 lowercase s caron or hacek */
346  -39, /* 155 right single angle quote mark */
347  -111, /* 156 lowercase oe ligature */
348  NPC7, /* 157 */
349  NPC7, /* 158 */
350  -89, /* 159 uppercase Y dieresis or umlaut */
351  -32, /* 160   non-breaking space */
352  64, /* 161 ¡ inverted exclamation mark */
353  -99, /* 162 ¢ cent sign */
354  1, /* 163 £ pound sterling sign */
355  36, /* 164 ? general currency sign */
356  3, /* 165 ¥ yen sign */
357  -33, /* 166 ¦ broken vertical bar */
358  95, /* 167 § section sign */
359  -34, /* 168 ¨ spacing dieresis or umlaut */
360  NPC7, /* 169 © copyright sign */
361  NPC7, /* 170 × feminine ordinal indicator */
362  -60, /* 171 « left (double) angle quote */
363  NPC7, /* 172 ¬ logical not sign */
364  -45, /* 173 ­ soft hyphen */
365  NPC7, /* 174 ® registered trademark sign */
366  NPC7, /* 175 ¯ spacing macron (long) accent */
367  NPC7, /* 176 ° degree sign */
368  NPC7, /* 177 ± plus-or-minus sign */
369  -50, /* 178 ² superscript 2 */
370  -51, /* 179 ³ superscript 3 */
371  -39, /* 180 ´ spacing acute accent */
372  -117, /* 181 µ micro sign */
373  NPC7, /* 182 ¶ paragraph sign, pilcrow sign */
374  NPC7, /* 183 · middle dot, centered dot */
375  NPC7, /* 184 ¸ spacing cedilla */
376  -49, /* 185 ¹ superscript 1 */
377  NPC7, /* 186 ÷ masculine ordinal indicator */
378  -62, /* 187 » right (double) angle quote (guillemet) */
379  NPC7, /* 188 ¼ fraction 1/4 */
380  NPC7, /* 189 ½ fraction 1/2 */
381  NPC7, /* 190 ¾ fraction 3/4 */
382  96, /* 191 ¿ inverted question mark */
383  -65, /* 192 ? uppercase A grave */
384  -65, /* 193 ? uppercase A acute */
385  -65, /* 194 ? uppercase A circumflex */
386  -65, /* 195 ? uppercase A tilde */
387  91, /* 196 ? uppercase A dieresis or umlaut */
388  14, /* 197 ? uppercase A ring */
389  28, /* 198 ? uppercase AE ligature */
390  9, /* 199 ? uppercase C cedilla */
391  -31, /* 200 ? uppercase E grave */
392  31, /* 201 ? uppercase E acute */
393  -31, /* 202 ? uppercase E circumflex */
394  -31, /* 203 ? uppercase E dieresis or umlaut */
395  -73, /* 204 ? uppercase I grave */
396  -73, /* 205 ? uppercase I acute */
397  -73, /* 206 ? uppercase I circumflex */
398  -73, /* 207 ? uppercase I dieresis or umlaut */
399  -68, /* 208 ? uppercase ETH */
400  93, /* 209 ? uppercase N tilde */
401  -79, /* 210 ? uppercase O grave */
402  -79, /* 211 ? uppercase O acute */
403  -79, /* 212 ? uppercase O circumflex */
404  -79, /* 213 ? uppercase O tilde */
405  92, /* 214 ? uppercase O dieresis or umlaut */
406  -42, /* 215 ? multiplication sign */
407  11, /* 216 ? uppercase O slash */
408  -85, /* 217 ? uppercase U grave */
409  -85, /* 218 ? uppercase U acute */
410  -85, /* 219 ? uppercase U circumflex */
411  94, /* 220 ? uppercase U dieresis or umlaut */
412  -89, /* 221 ? uppercase Y acute */
413  NPC7, /* 222 ? uppercase THORN */
414  30, /* 223 ? lowercase sharp s, sz ligature */
415  127, /* 224 ? lowercase a grave */
416  -97, /* 225 ? lowercase a acute */
417  -97, /* 226 ? lowercase a circumflex */
418  -97, /* 227 ? lowercase a tilde */
419  123, /* 228 ? lowercase a dieresis or umlaut */
420  15, /* 229 ? lowercase a ring */
421  29, /* 230 ? lowercase ae ligature */
422  -9, /* 231 ? lowercase c cedilla */
423  4, /* 232 ? lowercase e grave */
424  5, /* 233 ? lowercase e acute */
425  -101, /* 234 ? lowercase e circumflex */
426  -101, /* 235 ? lowercase e dieresis or umlaut */
427  7, /* 236 ? lowercase i grave */
428  7, /* 237 ? lowercase i acute */
429  -105, /* 238 ? lowercase i circumflex */
430  -105, /* 239 ? lowercase i dieresis or umlaut */
431  NPC7, /* 240 ? lowercase eth */
432  125, /* 241 ? lowercase n tilde */
433  8, /* 242 ? lowercase o grave */
434  -111, /* 243 ? lowercase o acute */
435  -111, /* 244 ? lowercase o circumflex */
436  -111, /* 245 ? lowercase o tilde */
437  124, /* 246 ? lowercase o dieresis or umlaut */
438  -47, /* 247 ? division sign */
439  12, /* 248 ? lowercase o slash */
440  6, /* 249 ? lowercase u grave */
441  -117, /* 250 ? lowercase u acute */
442  -117, /* 251 ? lowercase u circumflex */
443  126, /* 252 ? lowercase u dieresis or umlaut */
444  -121, /* 253 ? lowercase y acute */
445  NPC7, /* 254 ? lowercase thorn */
446  -121 /* 255 ? lowercase y dieresis or umlaut */
447 };
448 
449 /****************************************************************************
450 This lookup table converts from the 7 bit "default alphabet" as
451 defined in ETSI GSM 03.38 to a standard ISO-8859-1 8-bit ASCII.
452 
453 Some characters in the 7-bit alphabet does not exist in the ISO
454 character set, they are replaced by the NPC8-character.
455 
456 If the character is decimal 27 (ESC) the following character have
457 a special meaning and must be handled separately.
458 ****************************************************************************/
459 
460 const
461 #ifdef PM
462  PROGMEM
463 #endif
464  uint8_t lookup_ascii7to8[] = {
465  64, /* 0 @ COMMERCIAL AT */
466  163, /* 1 £ POUND SIGN */
467  36, /* 2 $ DOLLAR SIGN */
468  165, /* 3 ¥ YEN SIGN */
469  232, /* 4 ? LATIN SMALL LETTER E WITH GRAVE */
470  233, /* 5 ? LATIN SMALL LETTER E WITH ACUTE */
471  249, /* 6 ? LATIN SMALL LETTER U WITH GRAVE */
472  236, /* 7 ? LATIN SMALL LETTER I WITH GRAVE */
473  242, /* 8 ? LATIN SMALL LETTER O WITH GRAVE */
474  199, /* 9 ? LATIN CAPITAL LETTER C WITH CEDILLA */
475  10, /* 10 LINE FEED */
476  216, /* 11 ? LATIN CAPITAL LETTER O WITH STROKE */
477  248, /* 12 ? LATIN SMALL LETTER O WITH STROKE */
478  13, /* 13 CARRIAGE RETURN */
479  197, /* 14 ? LATIN CAPITAL LETTER A WITH RING ABOVE */
480  229, /* 15 ? LATIN SMALL LETTER A WITH RING ABOVE */
481  NPC8, /* 16 GREEK CAPITAL LETTER DELTA */
482  95, /* 17 _ LOW LINE */
483  NPC8, /* 18 GREEK CAPITAL LETTER PHI */
484  NPC8, /* 19 GREEK CAPITAL LETTER GAMMA */
485  NPC8, /* 20 GREEK CAPITAL LETTER LAMBDA */
486  NPC8, /* 21 GREEK CAPITAL LETTER OMEGA */
487  NPC8, /* 22 GREEK CAPITAL LETTER PI */
488  NPC8, /* 23 GREEK CAPITAL LETTER PSI */
489  NPC8, /* 24 GREEK CAPITAL LETTER SIGMA */
490  NPC8, /* 25 GREEK CAPITAL LETTER THETA */
491  NPC8, /* 26 GREEK CAPITAL LETTER XI */
492  27, /* 27 ESCAPE TO EXTENSION TABLE */
493  198, /* 28 ? LATIN CAPITAL LETTER AE */
494  230, /* 29 ? LATIN SMALL LETTER AE */
495  223, /* 30 ? LATIN SMALL LETTER SHARP S (German) */
496  201, /* 31 ? LATIN CAPITAL LETTER E WITH ACUTE */
497  32, /* 32 SPACE */
498  33, /* 33 ! EXCLAMATION MARK */
499  34, /* 34 " QUOTATION MARK */
500  35, /* 35 # NUMBER SIGN */
501  164, /* 36 ? CURRENCY SIGN */
502  37, /* 37 % PERCENT SIGN */
503  38, /* 38 & AMPERSAND */
504  39, /* 39 ' APOSTROPHE */
505  40, /* 40 ( LEFT PARENTHESIS */
506  41, /* 41 ) RIGHT PARENTHESIS */
507  42, /* 42 * ASTERISK */
508  43, /* 43 + PLUS SIGN */
509  44, /* 44 , COMMA */
510  45, /* 45 - HYPHEN-MINUS */
511  46, /* 46 . FULL STOP */
512  47, /* 47 / SOLIDUS (SLASH) */
513  48, /* 48 0 DIGIT ZERO */
514  49, /* 49 1 DIGIT ONE */
515  50, /* 50 2 DIGIT TWO */
516  51, /* 51 3 DIGIT THREE */
517  52, /* 52 4 DIGIT FOUR */
518  53, /* 53 5 DIGIT FIVE */
519  54, /* 54 6 DIGIT SIX */
520  55, /* 55 7 DIGIT SEVEN */
521  56, /* 56 8 DIGIT EIGHT */
522  57, /* 57 9 DIGIT NINE */
523  58, /* 58 : COLON */
524  59, /* 59 ; SEMICOLON */
525  60, /* 60 < LESS-THAN SIGN */
526  61, /* 61 = EQUALS SIGN */
527  62, /* 62 > GREATER-THAN SIGN */
528  63, /* 63 ? QUESTION MARK */
529  161, /* 64 ¡ INVERTED EXCLAMATION MARK */
530  65, /* 65 A LATIN CAPITAL LETTER A */
531  66, /* 66 B LATIN CAPITAL LETTER B */
532  67, /* 67 C LATIN CAPITAL LETTER C */
533  68, /* 68 D LATIN CAPITAL LETTER D */
534  69, /* 69 E LATIN CAPITAL LETTER E */
535  70, /* 70 F LATIN CAPITAL LETTER F */
536  71, /* 71 G LATIN CAPITAL LETTER G */
537  72, /* 72 H LATIN CAPITAL LETTER H */
538  73, /* 73 I LATIN CAPITAL LETTER I */
539  74, /* 74 J LATIN CAPITAL LETTER J */
540  75, /* 75 K LATIN CAPITAL LETTER K */
541  76, /* 76 L LATIN CAPITAL LETTER L */
542  77, /* 77 M LATIN CAPITAL LETTER M */
543  78, /* 78 N LATIN CAPITAL LETTER N */
544  79, /* 79 O LATIN CAPITAL LETTER O */
545  80, /* 80 P LATIN CAPITAL LETTER P */
546  81, /* 81 Q LATIN CAPITAL LETTER Q */
547  82, /* 82 R LATIN CAPITAL LETTER R */
548  83, /* 83 S LATIN CAPITAL LETTER S */
549  84, /* 84 T LATIN CAPITAL LETTER T */
550  85, /* 85 U LATIN CAPITAL LETTER U */
551  86, /* 86 V LATIN CAPITAL LETTER V */
552  87, /* 87 W LATIN CAPITAL LETTER W */
553  88, /* 88 X LATIN CAPITAL LETTER X */
554  89, /* 89 Y LATIN CAPITAL LETTER Y */
555  90, /* 90 Z LATIN CAPITAL LETTER Z */
556  196, /* 91 ? LATIN CAPITAL LETTER A WITH DIAERESIS */
557  214, /* 92 ? LATIN CAPITAL LETTER O WITH DIAERESIS */
558  209, /* 93 ? LATIN CAPITAL LETTER N WITH TILDE */
559  220, /* 94 ? LATIN CAPITAL LETTER U WITH DIAERESIS */
560  167, /* 95 § SECTION SIGN */
561  191, /* 96 ¿ INVERTED QUESTION MARK */
562  97, /* 97 a LATIN SMALL LETTER A */
563  98, /* 98 b LATIN SMALL LETTER B */
564  99, /* 99 c LATIN SMALL LETTER C */
565  100, /* 100 d LATIN SMALL LETTER D */
566  101, /* 101 e LATIN SMALL LETTER E */
567  102, /* 102 f LATIN SMALL LETTER F */
568  103, /* 103 g LATIN SMALL LETTER G */
569  104, /* 104 h LATIN SMALL LETTER H */
570  105, /* 105 i LATIN SMALL LETTER I */
571  106, /* 106 j LATIN SMALL LETTER J */
572  107, /* 107 k LATIN SMALL LETTER K */
573  108, /* 108 l LATIN SMALL LETTER L */
574  109, /* 109 m LATIN SMALL LETTER M */
575  110, /* 110 n LATIN SMALL LETTER N */
576  111, /* 111 o LATIN SMALL LETTER O */
577  112, /* 112 p LATIN SMALL LETTER P */
578  113, /* 113 q LATIN SMALL LETTER Q */
579  114, /* 114 r LATIN SMALL LETTER R */
580  115, /* 115 s LATIN SMALL LETTER S */
581  116, /* 116 t LATIN SMALL LETTER T */
582  117, /* 117 u LATIN SMALL LETTER U */
583  118, /* 118 v LATIN SMALL LETTER V */
584  119, /* 119 w LATIN SMALL LETTER W */
585  120, /* 120 x LATIN SMALL LETTER X */
586  121, /* 121 y LATIN SMALL LETTER Y */
587  122, /* 122 z LATIN SMALL LETTER Z */
588  228, /* 123 ? LATIN SMALL LETTER A WITH DIAERESIS */
589  246, /* 124 ? LATIN SMALL LETTER O WITH DIAERESIS */
590  241, /* 125 ? LATIN SMALL LETTER N WITH TILDE */
591  252, /* 126 ? LATIN SMALL LETTER U WITH DIAERESIS */
592  224 /* 127 ? LATIN SMALL LETTER A WITH GRAVE */
593 
594  /* The double bytes below must be handled separately after the
595  table lookup.
596 
597  12 27 10 FORM FEED
598  94 27 20 ^ CIRCUMFLEX ACCENT
599  123 27 40 { LEFT CURLY BRACKET
600  125 27 41 } RIGHT CURLY BRACKET
601  92 27 47 \ REVERSE SOLIDUS (BACKSLASH)
602  91 27 60 [ LEFT SQUARE BRACKET
603  126 27 61 ~ TILDE
604  93 27 62 ] RIGHT SQUARE BRACKET
605  124 27 64 | VERTICAL BAR */
606 
607 };
608 #endif
PDU::decodePDU
bool decodePDU(const char *pdu)
Decode a PDU, typically received from a GSM modem when in PDU mode. After a successful decoding you c...
Definition: pdulib.cpp:357
PDU::getSender
const char * getSender()
Get the senders phone number from a decoded PDU.
Definition: pdulib.cpp:544
PDU::encodePDU
int encodePDU(const char *recipient, const char *message)
Encode a PDU block for sending to an GSM modem.
Definition: pdulib.cpp:158
PDU::getSMS
const char * getSMS()
Get the address of the PDU message created by encodePDU
Definition: pdulib.cpp:614
PDU::getTimeStamp
const char * getTimeStamp()
Get the Timestamp from a decoded PDU.
Definition: pdulib.cpp:547
PDU
PDU class, provides methods to decode a PDU message or encode a new one.
Definition: pdulib.h:67
PDU::getText
const unsigned char * getText()
Get the text froma a decoded PDU.
Definition: pdulib.cpp:550
PDU::setSCAnumber
void setSCAnumber(const char *number)
Before encoding a PDU, you must supply the SCA phone number. Typically this can be retrieved from a G...
Definition: pdulib.cpp:618
PDU::getSCAnumber
char * getSCAnumber()
Get the SCA number from a decoded PDU.
Definition: pdulib.cpp:622