2 * Copyright (C) 2006 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
29 #ifndef ANDROID_RIL_CDMA_SMS_H
30 #define ANDROID_RIL_CDMA_SMS_H 1
38 /* Used by RIL_REQUEST_CDMA_SEND_SMS and RIL_UNSOL_RESPONSE_CDMA_NEW_SMS */
40 #define RIL_CDMA_SMS_ADDRESS_MAX 36
41 #define RIL_CDMA_SMS_SUBADDRESS_MAX 36
42 #define RIL_CDMA_SMS_BEARER_DATA_MAX 255
45 RIL_CDMA_SMS_DIGIT_MODE_4_BIT = 0, /* DTMF digits */
46 RIL_CDMA_SMS_DIGIT_MODE_8_BIT = 1,
47 RIL_CDMA_SMS_DIGIT_MODE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
48 } RIL_CDMA_SMS_DigitMode;
51 RIL_CDMA_SMS_NUMBER_MODE_NOT_DATA_NETWORK = 0,
52 RIL_CDMA_SMS_NUMBER_MODE_DATA_NETWORK = 1,
53 RIL_CDMA_SMS_NUMBER_MODE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
54 } RIL_CDMA_SMS_NumberMode;
57 RIL_CDMA_SMS_NUMBER_TYPE_UNKNOWN = 0,
58 RIL_CDMA_SMS_NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP = 1,
59 /* INTERNATIONAL is used when number mode is not data network address.
60 * DATA_IP is used when the number mode is data network address
62 RIL_CDMA_SMS_NUMBER_TYPE_NATIONAL_OR_INTERNET_MAIL = 2,
63 /* NATIONAL is used when the number mode is not data network address.
64 * INTERNET_MAIL is used when the number mode is data network address.
65 * For INTERNET_MAIL, in the address data "digits", each byte contains
66 * an ASCII character. Examples are "x@y.com,a@b.com - ref TIA/EIA-637A 3.4.3.3
68 RIL_CDMA_SMS_NUMBER_TYPE_NETWORK = 3,
69 RIL_CDMA_SMS_NUMBER_TYPE_SUBSCRIBER = 4,
70 RIL_CDMA_SMS_NUMBER_TYPE_ALPHANUMERIC = 5,
71 /* GSM SMS: address value is GSM 7-bit chars */
72 RIL_CDMA_SMS_NUMBER_TYPE_ABBREVIATED = 6,
73 RIL_CDMA_SMS_NUMBER_TYPE_RESERVED_7 = 7,
74 RIL_CDMA_SMS_NUMBER_TYPE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
75 } RIL_CDMA_SMS_NumberType;
78 RIL_CDMA_SMS_NUMBER_PLAN_UNKNOWN = 0,
79 RIL_CDMA_SMS_NUMBER_PLAN_TELEPHONY = 1, /* CCITT E.164 and E.163, including ISDN plan */
80 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_2 = 2,
81 RIL_CDMA_SMS_NUMBER_PLAN_DATA = 3, /* CCITT X.121 */
82 RIL_CDMA_SMS_NUMBER_PLAN_TELEX = 4, /* CCITT F.69 */
83 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_5 = 5,
84 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_6 = 6,
85 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_7 = 7,
86 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_8 = 8,
87 RIL_CDMA_SMS_NUMBER_PLAN_PRIVATE = 9,
88 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_10 = 10,
89 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_11 = 11,
90 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_12 = 12,
91 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_13 = 13,
92 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_14 = 14,
93 RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_15 = 15,
94 RIL_CDMA_SMS_NUMBER_PLAN_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
95 } RIL_CDMA_SMS_NumberPlan;
98 RIL_CDMA_SMS_DigitMode digit_mode;
99 /* Indicates 4-bit or 8-bit */
100 RIL_CDMA_SMS_NumberMode number_mode;
101 /* Used only when digitMode is 8-bit */
102 RIL_CDMA_SMS_NumberType number_type;
103 /* Used only when digitMode is 8-bit.
104 * To specify an international address, use the following:
105 * digitMode = RIL_CDMA_SMS_DIGIT_MODE_8_BIT
106 * numberMode = RIL_CDMA_SMS_NOT_DATA_NETWORK
107 * numberType = RIL_CDMA_SMS_NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP
108 * numberPlan = RIL_CDMA_SMS_NUMBER_PLAN_TELEPHONY
109 * numberOfDigits = number of digits
110 * digits = ASCII digits, e.g. '1', '2', '3'3, '4', and '5'
112 RIL_CDMA_SMS_NumberPlan number_plan;
113 /* Used only when digitMode is 8-bit */
114 unsigned char number_of_digits;
115 unsigned char digits[ RIL_CDMA_SMS_ADDRESS_MAX ];
116 /* Each byte in this array represnts a 40bit or 8-bit digit of address data */
117 } RIL_CDMA_SMS_Address;
120 RIL_CDMA_SMS_SUBADDRESS_TYPE_NSAP = 0, /* CCITT X.213 or ISO 8348 AD2 */
121 RIL_CDMA_SMS_SUBADDRESS_TYPE_USER_SPECIFIED = 1, /* e.g. X.25 */
122 RIL_CDMA_SMS_SUBADDRESS_TYPE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
123 } RIL_CDMA_SMS_SubaddressType;
126 RIL_CDMA_SMS_SubaddressType subaddressType;
127 /* 1 means the last byte's lower 4 bits should be ignored */
129 unsigned char number_of_digits;
130 /* Each byte respresents a 8-bit digit of subaddress data */
131 unsigned char digits[ RIL_CDMA_SMS_SUBADDRESS_MAX ];
132 } RIL_CDMA_SMS_Subaddress;
136 unsigned char bIsServicePresent;
137 int uServicecategory;
138 RIL_CDMA_SMS_Address sAddress;
139 RIL_CDMA_SMS_Subaddress sSubAddress;
141 unsigned char aBearerData[ RIL_CDMA_SMS_BEARER_DATA_MAX ];
142 } RIL_CDMA_SMS_Message;
144 /* Used by RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE */
147 RIL_CDMA_SMS_NO_ERROR = 0,
148 RIL_CDMA_SMS_ERROR = 1,
149 RIL_CDMA_SMS_ERROR_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
150 } RIL_CDMA_SMS_ErrorClass;
153 RIL_CDMA_SMS_ErrorClass uErrorClass;
157 /* Used by RIL_REQUEST_CDMA_SMS_GET_BROADCAST_CONFIG and
158 RIL_REQUEST_CDMA_SMS_SET_BROADCAST_CONFIG */
161 int service_category;
163 unsigned char selected;
164 } RIL_CDMA_BroadcastSmsConfigInfo;
166 /* Used by RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM */
169 int status; /* Status of message. See TS 27.005 3.1, "<stat>": */
170 /* 0 = "REC UNREAD" */
172 /* 2 = "STO UNSENT" */
175 RIL_CDMA_SMS_Message message;
176 } RIL_CDMA_SMS_WriteArgs;
179 /* Used by RIL_REQUEST_ENCODE_CDMA_SMS and RIL_REQUEST_DECODE_CDMA_SMS*/
181 #define RIL_CDMA_SMS_UDH_MAX_SND_SIZE 128
182 #define RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX 131 /* 140 - 3 - 6 */
183 #define RIL_CDMA_SMS_MAX_UD_HEADERS 7
184 #define RIL_CDMA_SMS_USER_DATA_MAX 229
185 #define RIL_CDMA_SMS_ADDRESS_MAX 36
186 #define RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE 128
187 #define RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE 32
188 #define RIL_CDMA_SMS_UDH_VAR_PIC_SIZE 134
189 #define RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS 4
190 #define RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE 32
191 #define RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE 8
192 #define RIL_CDMA_SMS_UDH_OTHER_SIZE 226
193 #define RIL_CDMA_SMS_IP_ADDRESS_SIZE 4
195 /* ------------------- */
196 /* ---- User Data ---- */
197 /* ------------------- */
199 RIL_CDMA_SMS_UDH_CONCAT_8 = 0x00,
200 RIL_CDMA_SMS_UDH_SPECIAL_SM,
201 /* 02 - 03 Reserved */
202 RIL_CDMA_SMS_UDH_PORT_8 = 0x04,
203 RIL_CDMA_SMS_UDH_PORT_16,
204 RIL_CDMA_SMS_UDH_SMSC_CONTROL,
205 RIL_CDMA_SMS_UDH_SOURCE,
206 RIL_CDMA_SMS_UDH_CONCAT_16,
207 RIL_CDMA_SMS_UDH_WCMP,
208 RIL_CDMA_SMS_UDH_TEXT_FORMATING,
209 RIL_CDMA_SMS_UDH_PRE_DEF_SOUND,
210 RIL_CDMA_SMS_UDH_USER_DEF_SOUND,
211 RIL_CDMA_SMS_UDH_PRE_DEF_ANIM,
212 RIL_CDMA_SMS_UDH_LARGE_ANIM,
213 RIL_CDMA_SMS_UDH_SMALL_ANIM,
214 RIL_CDMA_SMS_UDH_LARGE_PICTURE,
215 RIL_CDMA_SMS_UDH_SMALL_PICTURE,
216 RIL_CDMA_SMS_UDH_VAR_PICTURE,
218 RIL_CDMA_SMS_UDH_USER_PROMPT = 0x13,
219 RIL_CDMA_SMS_UDH_EXTENDED_OBJECT = 0x14,
221 /* 15 - 1F Reserved for future EMS */
223 RIL_CDMA_SMS_UDH_RFC822 = 0x20,
225 /* 21 - 6F Reserved for future use */
226 /* 70 - 7f Reserved for (U)SIM Toolkit Security Headers */
227 /* 80 - 9F SME to SME specific use */
228 /* A0 - BF Reserved for future use */
229 /* C0 - DF SC specific use */
230 /* E0 - FF Reserved for future use */
232 RIL_CDMA_SMS_UDH_OTHER = 0xFFFF, /* For unsupported or proprietary headers */
233 RIL_CDMA_SMS_UDH_ID_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
235 } RIL_CDMA_SMS_UdhId;
238 /*indicates the reference number for a particular concatenated short message. */
239 /*it is constant for every short message which makes up a particular concatenated short message*/
240 unsigned char msg_ref;
242 /*indicates the total number of short messages within the concatenated short message.
243 The value shall start at 1 and remain constant for every
244 short message which makes up the concatenated short message.
245 if it is 0 then the receiving entity shall ignore the whole Information Element*/
246 unsigned char total_sm;
249 * it indicates the sequence number of a particular short message within the concatenated short
250 * message. The value shall start at 1 and increment by one for every short message sent
251 * within the concatenated short message. If the value is zero or the value is
252 * greater than the value in octet 2 then the receiving
253 * entity shall ignore the whole Information Element.
255 unsigned char seq_num;
256 } RIL_CDMA_SMS_UdhConcat8;
258 /* GW message waiting actions
261 RIL_CDMA_SMS_GW_MSG_WAITING_NONE,
262 RIL_CDMA_SMS_GW_MSG_WAITING_DISCARD,
263 RIL_CDMA_SMS_GW_MSG_WAITING_STORE,
264 RIL_CDMA_SMS_GW_MSG_WAITING_NONE_1111,
265 RIL_CDMA_SMS_GW_MSG_WAITING_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
266 } RIL_CDMA_SMS_GWMsgWaiting;
268 /* GW message waiting types
271 RIL_CDMA_SMS_GW_MSG_WAITING_VOICEMAIL,
272 RIL_CDMA_SMS_GW_MSG_WAITING_FAX,
273 RIL_CDMA_SMS_GW_MSG_WAITING_EMAIL,
274 RIL_CDMA_SMS_GW_MSG_WAITING_OTHER,
275 RIL_CDMA_SMS_GW_MSG_WAITING_KIND_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
276 } RIL_CDMA_SMS_GWMsgWaitingKind;
279 RIL_CDMA_SMS_GWMsgWaiting msg_waiting;
280 RIL_CDMA_SMS_GWMsgWaitingKind msg_waiting_kind;
282 /*it indicates the number of messages of the type specified in Octet 1 waiting.*/
283 unsigned char message_count;
284 } RIL_CDMA_SMS_UdhSpecialSM;
287 unsigned char dest_port;
288 unsigned char orig_port;
289 } RIL_CDMA_SMS_UdhWap8;
292 unsigned short dest_port;
293 unsigned short orig_port;
294 } RIL_CDMA_SMS_UdhWap16;
297 unsigned short msg_ref;
298 unsigned char total_sm;
299 unsigned char seq_num;
301 } RIL_CDMA_SMS_UdhConcat16;
304 RIL_CDMA_SMS_UDH_LEFT_ALIGNMENT = 0,
305 RIL_CDMA_SMS_UDH_CENTER_ALIGNMENT,
306 RIL_CDMA_SMS_UDH_RIGHT_ALIGNMENT,
307 RIL_CDMA_SMS_UDH_DEFAULT_ALIGNMENT,
308 RIL_CDMA_SMS_UDH_MAX_ALIGNMENT,
309 RIL_CDMA_SMS_UDH_ALIGNMENT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
310 } RIL_CDMA_SMS_UdhAlignment;
313 RIL_CDMA_SMS_UDH_FONT_NORMAL = 0,
314 RIL_CDMA_SMS_UDH_FONT_LARGE,
315 RIL_CDMA_SMS_UDH_FONT_SMALL,
316 RIL_CDMA_SMS_UDH_FONT_RESERVED,
317 RIL_CDMA_SMS_UDH_FONT_MAX,
318 RIL_CDMA_SMS_UDH_FONT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
319 } RIL_CDMA_SMS_UdhFontSize;
322 RIL_CDMA_SMS_UDH_TEXT_COLOR_BLACK = 0x0,
323 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREY = 0x1,
324 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_RED = 0x2,
325 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_YELLOW = 0x3,
326 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREEN = 0x4,
327 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_CYAN = 0x5,
328 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_BLUE = 0x6,
329 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_MAGENTA = 0x7,
330 RIL_CDMA_SMS_UDH_TEXT_COLOR_GREY = 0x8,
331 RIL_CDMA_SMS_UDH_TEXT_COLOR_WHITE = 0x9,
332 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_RED = 0xA,
333 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_YELLOW = 0xB,
334 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_GREEN = 0xC,
335 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_CYAN = 0xD,
336 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_BLUE = 0xE,
337 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_MAGENTA = 0xF,
338 RIL_CDMA_SMS_UDH_TEXT_COLOR_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
339 } RIL_CDMA_SMS_UdhTextColor;
342 unsigned char start_position;
343 unsigned char text_formatting_length;
344 RIL_CDMA_SMS_UdhAlignment alignment_type ; /*bit 0 and bit 1*/
345 RIL_CDMA_SMS_UdhFontSize font_size ; /*bit 3 and bit 2*/
346 unsigned char style_bold; /*bit 4 */
347 unsigned char style_italic; /*bit 5 */
348 unsigned char style_underlined; /*bit 6 */
349 unsigned char style_strikethrough; /*bit 7 */
351 /* if FALSE, ignore the following color information */
352 unsigned char is_color_present;
353 RIL_CDMA_SMS_UdhTextColor text_color_foreground;
354 RIL_CDMA_SMS_UdhTextColor text_color_background;
356 } RIL_CDMA_SMS_UdhTextFormating;
361 unsigned char position;
362 unsigned char snd_number;
363 } RIL_CDMA_SMS_UdhPreDefSound;
365 /* User Defined sound
368 unsigned char data_length;
369 unsigned char position;
370 unsigned char user_def_sound[RIL_CDMA_SMS_UDH_MAX_SND_SIZE];
371 } RIL_CDMA_SMS_UdhUserDefSound;
376 unsigned char position;
377 unsigned char data[RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE];
378 } RIL_CDMA_SMS_UdhLargePictureData;
383 unsigned char position;
384 unsigned char data[RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE];
385 } RIL_CDMA_SMS_UdhSmallPictureData;
387 /* Variable length picture
390 unsigned char position;
391 unsigned char width; /* Number of pixels - Should be a mutliple of 8 */
392 unsigned char height;
393 unsigned char data[RIL_CDMA_SMS_UDH_VAR_PIC_SIZE];
394 } RIL_CDMA_SMS_UdhVarPicture;
396 /* Predefined animation
399 unsigned char position;
400 unsigned char animation_number;
401 } RIL_CDMA_SMS_UdhPreDefAnim;
406 unsigned char position;
407 unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE];
408 } RIL_CDMA_SMS_UdhLargeAnim;
413 unsigned char position;
414 unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE];
415 } RIL_CDMA_SMS_UdhSmallAnim;
417 /* User Prompt Indicator UDH
420 unsigned char number_of_objects;
421 /* Number of objects of the same kind that follow this header which will
422 ** be stitched together by the applications. For example, 5 small pictures
423 ** are to be stitched together horizontally, or 6 iMelody tones are to be
424 ** connected together with intermediate iMelody header and footer ignored.
425 ** Allowed objects to be stitched:
426 ** - Images (small, large, variable)
427 ** - User defined sounds
429 } RIL_CDMA_SMS_UdhUserPrompt;
432 unsigned char length;
434 unsigned char data[RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX];
435 /* RIL_CDMA_SMS_UDH_EO_VCARD: See http://www.imc.org/pdi/vcard-21.doc for payload */
436 /* RIL_CDMA_SMS_UDH_EO_VCALENDAR: See http://www.imc.org/pdi/vcal-10.doc */
437 /* Or: Unsupported/proprietary extended objects */
439 } RIL_CDMA_SMS_UdhEoContent;
441 /* Extended Object UDH
443 /* Extended Object IDs/types
446 RIL_CDMA_SMS_UDH_EO_VCARD = 0x09,
447 RIL_CDMA_SMS_UDH_EO_VCALENDAR = 0x0A,
448 RIL_CDMA_SMS_UDH_EO_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
449 } RIL_CDMA_SMS_UdhEoId;
452 /* Extended objects are to be used together with 16-bit concatenation
453 ** UDH. The max number of segments supported for E.O. is 8 at least.
455 RIL_CDMA_SMS_UdhEoContent content;
457 unsigned char first_segment;
458 /* The following fields are only present in the first segment of a
459 ** concatenated SMS message.
461 unsigned char reference;
462 /* Identify those extended object segments which should be linked together
464 unsigned short length;
465 /* Length of the whole extended object data
467 unsigned char control;
468 RIL_CDMA_SMS_UdhEoId type;
469 unsigned short position;
470 /* Absolute position of the E.O. in the whole text after concatenation,
473 } RIL_CDMA_SMS_UdhEo;
476 RIL_CDMA_SMS_UdhId header_id;
477 unsigned char header_length;
478 unsigned char data[RIL_CDMA_SMS_UDH_OTHER_SIZE];
479 } RIL_CDMA_SMS_UdhOther;
482 unsigned char header_length;
483 } RIL_CDMA_SMS_UdhRfc822;
486 RIL_CDMA_SMS_UdhId header_id;
489 RIL_CDMA_SMS_UdhConcat8 concat_8; // 00
491 RIL_CDMA_SMS_UdhSpecialSM special_sm; // 01
492 RIL_CDMA_SMS_UdhWap8 wap_8; // 04
493 RIL_CDMA_SMS_UdhWap16 wap_16; // 05
494 RIL_CDMA_SMS_UdhConcat16 concat_16; // 08
495 RIL_CDMA_SMS_UdhTextFormating text_formating; // 0a
496 RIL_CDMA_SMS_UdhPreDefSound pre_def_sound; // 0b
497 RIL_CDMA_SMS_UdhUserDefSound user_def_sound; // 0c
498 RIL_CDMA_SMS_UdhPreDefAnim pre_def_anim; // 0d
499 RIL_CDMA_SMS_UdhLargeAnim large_anim; // 0e
500 RIL_CDMA_SMS_UdhSmallAnim small_anim; // 0f
501 RIL_CDMA_SMS_UdhLargePictureData large_picture; // 10
502 RIL_CDMA_SMS_UdhSmallPictureData small_picture; // 11
503 RIL_CDMA_SMS_UdhVarPicture var_picture; // 12
505 RIL_CDMA_SMS_UdhUserPrompt user_prompt; // 13
506 RIL_CDMA_SMS_UdhEo eo; // 14
508 RIL_CDMA_SMS_UdhRfc822 rfc822; // 20
509 RIL_CDMA_SMS_UdhOther other;
514 /* ----------------------------- */
515 /* -- User data encoding type -- */
516 /* ----------------------------- */
518 RIL_CDMA_SMS_ENCODING_OCTET = 0, /* 8-bit */
519 RIL_CDMA_SMS_ENCODING_IS91EP, /* varies */
520 RIL_CDMA_SMS_ENCODING_ASCII, /* 7-bit */
521 RIL_CDMA_SMS_ENCODING_IA5, /* 7-bit */
522 RIL_CDMA_SMS_ENCODING_UNICODE, /* 16-bit */
523 RIL_CDMA_SMS_ENCODING_SHIFT_JIS, /* 8 or 16-bit */
524 RIL_CDMA_SMS_ENCODING_KOREAN, /* 8 or 16-bit */
525 RIL_CDMA_SMS_ENCODING_LATIN_HEBREW, /* 8-bit */
526 RIL_CDMA_SMS_ENCODING_LATIN, /* 8-bit */
527 RIL_CDMA_SMS_ENCODING_GSM_7_BIT_DEFAULT, /* 7-bit */
528 RIL_CDMA_SMS_ENCODING_MAX32 = 0x10000000
530 } RIL_CDMA_SMS_UserDataEncoding;
532 /* ------------------------ */
533 /* -- IS-91 EP data type -- */
534 /* ------------------------ */
536 RIL_CDMA_SMS_IS91EP_VOICE_MAIL = 0x82,
537 RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE_FULL = 0x83,
538 RIL_CDMA_SMS_IS91EP_CLI_ORDER = 0x84,
539 RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE = 0x85,
540 RIL_CDMA_SMS_IS91EP_MAX32 = 0x10000000
542 } RIL_CDMA_SMS_IS91EPType;
545 /* NOTE: If message_id.udh_present == TRUE:
546 ** 'num_headers' is the number of User Data Headers (UDHs),
547 ** and 'headers' include all those headers.
549 unsigned char num_headers;
550 RIL_CDMA_SMS_Udh headers[RIL_CDMA_SMS_MAX_UD_HEADERS];
552 RIL_CDMA_SMS_UserDataEncoding encoding;
553 RIL_CDMA_SMS_IS91EPType is91ep_type;
555 /*----------------------------------------------------------------------
556 'data_len' indicates the valid number of bytes in the 'data' array.
558 'padding_bits' (0-7) indicates how many bits in the last byte of 'data'
559 are invalid bits. This parameter is only used for Mobile-Originated
560 messages. There is no way for the API to tell how many padding bits
561 exist in the received message. Instead, the application can find out how
562 many padding bits exist in the user data when decoding the user data.
564 'data' has the raw bits of the user data field of the SMS message.
565 The client software should decode the raw user data according to its
566 supported encoding types and languages.
568 EXCEPTION 1: CMT-91 user data raw bits are first translated into BD fields
569 (e.g. num_messages, callback, etc.) The translated user data field in
570 VMN and Short Message is in the form of ASCII characters, each occupying
571 a byte in the resulted 'data'.
573 EXCEPTION 2: GSM 7-bit Default characters are decoded so that each byte
574 has one 7-bit GSM character.
576 'number_of_digits' is the number of digits/characters (7, 8, 16, or
577 whatever bits) in the raw user data, which can be used by the client
578 when decoding the user data according to the encoding type and language.
579 -------------------------------------------------------------------------*/
580 unsigned char data_len;
581 unsigned char padding_bits;
582 unsigned char data[ RIL_CDMA_SMS_USER_DATA_MAX ];
583 unsigned char number_of_digits;
585 } RIL_CDMA_SMS_CdmaUserData;
587 /* -------------------- */
588 /* ---- Message Id ---- */
589 /* -------------------- */
591 RIL_CDMA_SMS_BD_TYPE_RESERVED_0 = 0,
592 RIL_CDMA_SMS_BD_TYPE_DELIVER, /* MT only */
593 RIL_CDMA_SMS_BD_TYPE_SUBMIT, /* MO only */
594 RIL_CDMA_SMS_BD_TYPE_CANCELLATION, /* MO only */
595 RIL_CDMA_SMS_BD_TYPE_DELIVERY_ACK, /* MT only */
596 RIL_CDMA_SMS_BD_TYPE_USER_ACK, /* MT & MO */
597 RIL_CDMA_SMS_BD_TYPE_READ_ACK, /* MT & MO */
598 RIL_CDMA_SMS_BD_TYPE_MAX32 = 0x10000000
600 } RIL_CDMA_SMS_BdMessageType;
602 typedef unsigned int RIL_CDMA_SMS_MessageNumber;
605 RIL_CDMA_SMS_BdMessageType type;
606 RIL_CDMA_SMS_MessageNumber id_number;
607 unsigned char udh_present;
608 /* NOTE: if FEATURE_SMS_UDH is not defined,
609 ** udh_present should be ignored.
611 } RIL_CDMA_SMS_MessageId;
613 typedef unsigned char RIL_CDMA_SMS_UserResponse;
615 /* ------------------- */
616 /* ---- Timestamp ---- */
617 /* ------------------- */
619 /* If 'year' is between 96 and 99, the actual year is 1900 + 'year';
620 if 'year' is between 00 and 95, the actual year is 2000 + 'year'.
621 NOTE: Each field has two BCD digits and byte arrangement is <MSB, ... ,LSB>
623 unsigned char year; /* 0x00-0x99 */
624 unsigned char month; /* 0x01-0x12 */
625 unsigned char day; /* 0x01-0x31 */
626 unsigned char hour; /* 0x00-0x23 */
627 unsigned char minute; /* 0x00-0x59 */
628 unsigned char second; /* 0x00-0x59 */
629 signed char timezone; /* +/-, [-48,+48] number of 15 minutes - GW only */
630 } RIL_CDMA_SMS_Timestamp;
632 /* ------------------ */
633 /* ---- Priority ---- */
634 /* ------------------ */
636 RIL_CDMA_SMS_PRIORITY_NORMAL = 0,
637 RIL_CDMA_SMS_PRIORITY_INTERACTIVE,
638 RIL_CDMA_SMS_PRIORITY_URGENT,
639 RIL_CDMA_SMS_PRIORITY_EMERGENCY,
640 RIL_CDMA_SMS_PRIORITY_MAX32 = 0x10000000
642 } RIL_CDMA_SMS_Priority;
644 /* ----------------- */
645 /* ---- Privacy ---- */
646 /* ----------------- */
648 RIL_CDMA_SMS_PRIVACY_NORMAL = 0,
649 RIL_CDMA_SMS_PRIVACY_RESTRICTED,
650 RIL_CDMA_SMS_PRIVACY_CONFIDENTIAL,
651 RIL_CDMA_SMS_PRIVACY_SECRET,
652 RIL_CDMA_SMS_PRIVACY_MAX32 = 0x10000000
654 } RIL_CDMA_SMS_Privacy;
656 /* ---------------------- */
657 /* ---- Reply option ---- */
658 /* ---------------------- */
660 /* whether user ack is requested
662 unsigned char user_ack_requested;
664 /* whether delivery ack is requested.
665 Should be FALSE for incoming messages.
667 unsigned char delivery_ack_requested;
669 /* Message originator requests the receiving phone to send back a READ_ACK
670 ** message automatically when the user reads the received message.
672 unsigned char read_ack_requested;
674 } RIL_CDMA_SMS_ReplyOption;
677 RIL_CDMA_SMS_ALERT_MODE_DEFAULT = 0,
678 RIL_CDMA_SMS_ALERT_MODE_LOW_PRIORITY = 1,
679 RIL_CDMA_SMS_ALERT_MODE_MEDIUM_PRIORITY = 2,
680 RIL_CDMA_SMS_ALERT_MODE_HIGH_PRIORITY = 3,
682 /* For pre-IS637A implementations, alert_mode only has values of True/False:
684 RIL_CDMA_SMS_ALERT_MODE_OFF = 0,
685 RIL_CDMA_SMS_ALERT_MODE_ON = 1
687 } RIL_CDMA_SMS_AlertMode;
689 /* ------------------ */
690 /* ---- Language ---- */
691 /* ------------------ */
693 RIL_CDMA_SMS_LANGUAGE_UNSPECIFIED = 0,
694 RIL_CDMA_SMS_LANGUAGE_ENGLISH,
695 RIL_CDMA_SMS_LANGUAGE_FRENCH,
696 RIL_CDMA_SMS_LANGUAGE_SPANISH,
697 RIL_CDMA_SMS_LANGUAGE_JAPANESE,
698 RIL_CDMA_SMS_LANGUAGE_KOREAN,
699 RIL_CDMA_SMS_LANGUAGE_CHINESE,
700 RIL_CDMA_SMS_LANGUAGE_HEBREW,
701 RIL_CDMA_SMS_LANGUAGE_MAX32 = 0x10000000
703 } RIL_CDMA_SMS_Language;
705 /* ---------------------------------- */
706 /* ---------- Display Mode ---------- */
707 /* ---------------------------------- */
709 RIL_CDMA_SMS_DISPLAY_MODE_IMMEDIATE = 0,
710 RIL_CDMA_SMS_DISPLAY_MODE_DEFAULT = 1,
711 RIL_CDMA_SMS_DISPLAY_MODE_USER_INVOKE = 2,
712 RIL_CDMA_SMS_DISPLAY_MODE_RESERVED = 3
713 } RIL_CDMA_SMS_DisplayMode;
715 /* IS-637B parameters/fields
718 /* ---------------------------------- */
719 /* ---------- Delivery Status ------- */
720 /* ---------------------------------- */
722 RIL_CDMA_SMS_DELIVERY_STATUS_ACCEPTED = 0, /* ERROR_CLASS_NONE */
723 RIL_CDMA_SMS_DELIVERY_STATUS_DEPOSITED_TO_INTERNET = 1, /* ERROR_CLASS_NONE */
724 RIL_CDMA_SMS_DELIVERY_STATUS_DELIVERED = 2, /* ERROR_CLASS_NONE */
725 RIL_CDMA_SMS_DELIVERY_STATUS_CANCELLED = 3, /* ERROR_CLASS_NONE */
727 RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_CONGESTION = 4, /* ERROR_CLASS_TEMP & PERM */
728 RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_ERROR = 5, /* ERROR_CLASS_TEMP & PERM */
729 RIL_CDMA_SMS_DELIVERY_STATUS_CANCEL_FAILED = 6, /* ERROR_CLASS_PERM */
730 RIL_CDMA_SMS_DELIVERY_STATUS_BLOCKED_DESTINATION = 7, /* ERROR_CLASS_PERM */
731 RIL_CDMA_SMS_DELIVERY_STATUS_TEXT_TOO_LONG = 8, /* ERROR_CLASS_PERM */
732 RIL_CDMA_SMS_DELIVERY_STATUS_DUPLICATE_MESSAGE = 9, /* ERROR_CLASS_PERM */
733 RIL_CDMA_SMS_DELIVERY_STATUS_INVALID_DESTINATION = 10, /* ERROR_CLASS_PERM */
734 RIL_CDMA_SMS_DELIVERY_STATUS_MESSAGE_EXPIRED = 13, /* ERROR_CLASS_PERM */
736 RIL_CDMA_SMS_DELIVERY_STATUS_UNKNOWN_ERROR = 0x1F /* ERROR_CLASS_PERM */
738 /* All the other values are reserved */
740 } RIL_CDMA_SMS_DeliveryStatusE;
743 RIL_CDMA_SMS_ErrorClass error_class;
744 RIL_CDMA_SMS_DeliveryStatusE status;
745 } RIL_CDMA_SMS_DeliveryStatus;
748 unsigned char address[RIL_CDMA_SMS_IP_ADDRESS_SIZE];
749 unsigned char is_valid;
750 } RIL_CDMA_SMS_IpAddress;
752 /* This special parameter captures any unrecognized/proprietary parameters
755 unsigned char input_other_len;
756 unsigned char desired_other_len; /* used during decoding */
757 unsigned char * other_data;
758 } RIL_CDMA_SMS_OtherParm;
761 /* the mask indicates which fields are present in this message */
764 RIL_CDMA_SMS_MessageId message_id;
765 RIL_CDMA_SMS_CdmaUserData user_data;
766 RIL_CDMA_SMS_UserResponse user_response;
767 RIL_CDMA_SMS_Timestamp mc_time;
768 RIL_CDMA_SMS_Timestamp validity_absolute;
769 RIL_CDMA_SMS_Timestamp validity_relative;
770 RIL_CDMA_SMS_Timestamp deferred_absolute;
771 RIL_CDMA_SMS_Timestamp deferred_relative;
772 RIL_CDMA_SMS_Priority priority;
773 RIL_CDMA_SMS_Privacy privacy;
774 RIL_CDMA_SMS_ReplyOption reply_option;
775 unsigned char num_messages; /* the actual value; not BCDs */
776 RIL_CDMA_SMS_AlertMode alert_mode;
777 /* For pre-IS-637A implementations, alert_mode is either Off or On. */
778 RIL_CDMA_SMS_Language language;
779 RIL_CDMA_SMS_Address callback;
780 RIL_CDMA_SMS_DisplayMode display_mode;
782 RIL_CDMA_SMS_DeliveryStatus delivery_status;
783 unsigned int deposit_index;
785 RIL_CDMA_SMS_IpAddress ip_address;
786 unsigned char rsn_no_notify;
788 /* See function comments of wms_ts_decode() and
789 ** wms_ts_decode_cdma_bd_with_other() for details regarding 'other' parameters
791 RIL_CDMA_SMS_OtherParm other;
793 } RIL_CDMA_SMS_ClientBd;
796 unsigned char length; /* length, in bytes, of the encoded SMS message */
797 unsigned char * data; /* the encoded SMS message (max 255 bytes) */
798 } RIL_CDMA_Encoded_SMS;
804 #endif /*ANDROID_RIL_CDMA_SMS_H*/