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_GET_BROADCAST_CONFIG and RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG */
160 int uServiceCategory;
162 unsigned char bSelected;
163 } RIL_CDMA_BroadcastServiceInfo;
167 RIL_CDMA_BroadcastServiceInfo *entries;
168 } RIL_CDMA_BroadcastSMSConfig;
170 /* Used by RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM */
173 int status; /* Status of message. See TS 27.005 3.1, "<stat>": */
174 /* 0 = "REC UNREAD" */
176 /* 2 = "STO UNSENT" */
179 RIL_CDMA_SMS_Message message;
180 } RIL_CDMA_SMS_WriteArgs;
183 /* Used by RIL_REQUEST_ENCODE_CDMA_SMS and RIL_REQUEST_DECODE_CDMA_SMS*/
185 #define RIL_CDMA_SMS_UDH_MAX_SND_SIZE 128
186 #define RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX 131 /* 140 - 3 - 6 */
187 #define RIL_CDMA_SMS_MAX_UD_HEADERS 7
188 #define RIL_CDMA_SMS_USER_DATA_MAX 229
189 #define RIL_CDMA_SMS_ADDRESS_MAX 36
190 #define RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE 128
191 #define RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE 32
192 #define RIL_CDMA_SMS_UDH_VAR_PIC_SIZE 134
193 #define RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS 4
194 #define RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE 32
195 #define RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE 8
196 #define RIL_CDMA_SMS_UDH_OTHER_SIZE 226
197 #define RIL_CDMA_SMS_IP_ADDRESS_SIZE 4
199 /* ------------------- */
200 /* ---- User Data ---- */
201 /* ------------------- */
203 RIL_CDMA_SMS_UDH_CONCAT_8 = 0x00,
204 RIL_CDMA_SMS_UDH_SPECIAL_SM,
205 /* 02 - 03 Reserved */
206 RIL_CDMA_SMS_UDH_PORT_8 = 0x04,
207 RIL_CDMA_SMS_UDH_PORT_16,
208 RIL_CDMA_SMS_UDH_SMSC_CONTROL,
209 RIL_CDMA_SMS_UDH_SOURCE,
210 RIL_CDMA_SMS_UDH_CONCAT_16,
211 RIL_CDMA_SMS_UDH_WCMP,
212 RIL_CDMA_SMS_UDH_TEXT_FORMATING,
213 RIL_CDMA_SMS_UDH_PRE_DEF_SOUND,
214 RIL_CDMA_SMS_UDH_USER_DEF_SOUND,
215 RIL_CDMA_SMS_UDH_PRE_DEF_ANIM,
216 RIL_CDMA_SMS_UDH_LARGE_ANIM,
217 RIL_CDMA_SMS_UDH_SMALL_ANIM,
218 RIL_CDMA_SMS_UDH_LARGE_PICTURE,
219 RIL_CDMA_SMS_UDH_SMALL_PICTURE,
220 RIL_CDMA_SMS_UDH_VAR_PICTURE,
222 RIL_CDMA_SMS_UDH_USER_PROMPT = 0x13,
223 RIL_CDMA_SMS_UDH_EXTENDED_OBJECT = 0x14,
225 /* 15 - 1F Reserved for future EMS */
227 RIL_CDMA_SMS_UDH_RFC822 = 0x20,
229 /* 21 - 6F Reserved for future use */
230 /* 70 - 7f Reserved for (U)SIM Toolkit Security Headers */
231 /* 80 - 9F SME to SME specific use */
232 /* A0 - BF Reserved for future use */
233 /* C0 - DF SC specific use */
234 /* E0 - FF Reserved for future use */
236 RIL_CDMA_SMS_UDH_OTHER = 0xFFFF, /* For unsupported or proprietary headers */
237 RIL_CDMA_SMS_UDH_ID_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
239 } RIL_CDMA_SMS_UdhId;
242 /*indicates the reference number for a particular concatenated short message. */
243 /*it is constant for every short message which makes up a particular concatenated short message*/
244 unsigned char msg_ref;
246 /*indicates the total number of short messages within the concatenated short message.
247 The value shall start at 1 and remain constant for every
248 short message which makes up the concatenated short message.
249 if it is 0 then the receiving entity shall ignore the whole Information Element*/
250 unsigned char total_sm;
253 * it indicates the sequence number of a particular short message within the concatenated short
254 * message. The value shall start at 1 and increment by one for every short message sent
255 * within the concatenated short message. If the value is zero or the value is
256 * greater than the value in octet 2 then the receiving
257 * entity shall ignore the whole Information Element.
259 unsigned char seq_num;
260 } RIL_CDMA_SMS_UdhConcat8;
262 /* GW message waiting actions
265 RIL_CDMA_SMS_GW_MSG_WAITING_NONE,
266 RIL_CDMA_SMS_GW_MSG_WAITING_DISCARD,
267 RIL_CDMA_SMS_GW_MSG_WAITING_STORE,
268 RIL_CDMA_SMS_GW_MSG_WAITING_NONE_1111,
269 RIL_CDMA_SMS_GW_MSG_WAITING_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
270 } RIL_CDMA_SMS_GWMsgWaiting;
272 /* GW message waiting types
275 RIL_CDMA_SMS_GW_MSG_WAITING_VOICEMAIL,
276 RIL_CDMA_SMS_GW_MSG_WAITING_FAX,
277 RIL_CDMA_SMS_GW_MSG_WAITING_EMAIL,
278 RIL_CDMA_SMS_GW_MSG_WAITING_OTHER,
279 RIL_CDMA_SMS_GW_MSG_WAITING_KIND_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
280 } RIL_CDMA_SMS_GWMsgWaitingKind;
283 RIL_CDMA_SMS_GWMsgWaiting msg_waiting;
284 RIL_CDMA_SMS_GWMsgWaitingKind msg_waiting_kind;
286 /*it indicates the number of messages of the type specified in Octet 1 waiting.*/
287 unsigned char message_count;
288 } RIL_CDMA_SMS_UdhSpecialSM;
291 unsigned char dest_port;
292 unsigned char orig_port;
293 } RIL_CDMA_SMS_UdhWap8;
296 unsigned short dest_port;
297 unsigned short orig_port;
298 } RIL_CDMA_SMS_UdhWap16;
301 unsigned short msg_ref;
302 unsigned char total_sm;
303 unsigned char seq_num;
305 } RIL_CDMA_SMS_UdhConcat16;
308 RIL_CDMA_SMS_UDH_LEFT_ALIGNMENT = 0,
309 RIL_CDMA_SMS_UDH_CENTER_ALIGNMENT,
310 RIL_CDMA_SMS_UDH_RIGHT_ALIGNMENT,
311 RIL_CDMA_SMS_UDH_DEFAULT_ALIGNMENT,
312 RIL_CDMA_SMS_UDH_MAX_ALIGNMENT,
313 RIL_CDMA_SMS_UDH_ALIGNMENT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
314 } RIL_CDMA_SMS_UdhAlignment;
317 RIL_CDMA_SMS_UDH_FONT_NORMAL = 0,
318 RIL_CDMA_SMS_UDH_FONT_LARGE,
319 RIL_CDMA_SMS_UDH_FONT_SMALL,
320 RIL_CDMA_SMS_UDH_FONT_RESERVED,
321 RIL_CDMA_SMS_UDH_FONT_MAX,
322 RIL_CDMA_SMS_UDH_FONT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
323 } RIL_CDMA_SMS_UdhFontSize;
326 RIL_CDMA_SMS_UDH_TEXT_COLOR_BLACK = 0x0,
327 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREY = 0x1,
328 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_RED = 0x2,
329 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_YELLOW = 0x3,
330 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREEN = 0x4,
331 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_CYAN = 0x5,
332 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_BLUE = 0x6,
333 RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_MAGENTA = 0x7,
334 RIL_CDMA_SMS_UDH_TEXT_COLOR_GREY = 0x8,
335 RIL_CDMA_SMS_UDH_TEXT_COLOR_WHITE = 0x9,
336 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_RED = 0xA,
337 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_YELLOW = 0xB,
338 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_GREEN = 0xC,
339 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_CYAN = 0xD,
340 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_BLUE = 0xE,
341 RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_MAGENTA = 0xF,
342 RIL_CDMA_SMS_UDH_TEXT_COLOR_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
343 } RIL_CDMA_SMS_UdhTextColor;
346 unsigned char start_position;
347 unsigned char text_formatting_length;
348 RIL_CDMA_SMS_UdhAlignment alignment_type ; /*bit 0 and bit 1*/
349 RIL_CDMA_SMS_UdhFontSize font_size ; /*bit 3 and bit 2*/
350 unsigned char style_bold; /*bit 4 */
351 unsigned char style_italic; /*bit 5 */
352 unsigned char style_underlined; /*bit 6 */
353 unsigned char style_strikethrough; /*bit 7 */
355 /* if FALSE, ignore the following color information */
356 unsigned char is_color_present;
357 RIL_CDMA_SMS_UdhTextColor text_color_foreground;
358 RIL_CDMA_SMS_UdhTextColor text_color_background;
360 } RIL_CDMA_SMS_UdhTextFormating;
365 unsigned char position;
366 unsigned char snd_number;
367 } RIL_CDMA_SMS_UdhPreDefSound;
369 /* User Defined sound
372 unsigned char data_length;
373 unsigned char position;
374 unsigned char user_def_sound[RIL_CDMA_SMS_UDH_MAX_SND_SIZE];
375 } RIL_CDMA_SMS_UdhUserDefSound;
380 unsigned char position;
381 unsigned char data[RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE];
382 } RIL_CDMA_SMS_UdhLargePictureData;
387 unsigned char position;
388 unsigned char data[RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE];
389 } RIL_CDMA_SMS_UdhSmallPictureData;
391 /* Variable length picture
394 unsigned char position;
395 unsigned char width; /* Number of pixels - Should be a mutliple of 8 */
396 unsigned char height;
397 unsigned char data[RIL_CDMA_SMS_UDH_VAR_PIC_SIZE];
398 } RIL_CDMA_SMS_UdhVarPicture;
400 /* Predefined animation
403 unsigned char position;
404 unsigned char animation_number;
405 } RIL_CDMA_SMS_UdhPreDefAnim;
410 unsigned char position;
411 unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE];
412 } RIL_CDMA_SMS_UdhLargeAnim;
417 unsigned char position;
418 unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE];
419 } RIL_CDMA_SMS_UdhSmallAnim;
421 /* User Prompt Indicator UDH
424 unsigned char number_of_objects;
425 /* Number of objects of the same kind that follow this header which will
426 ** be stitched together by the applications. For example, 5 small pictures
427 ** are to be stitched together horizontally, or 6 iMelody tones are to be
428 ** connected together with intermediate iMelody header and footer ignored.
429 ** Allowed objects to be stitched:
430 ** - Images (small, large, variable)
431 ** - User defined sounds
433 } RIL_CDMA_SMS_UdhUserPrompt;
436 unsigned char length;
438 unsigned char data[RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX];
439 /* RIL_CDMA_SMS_UDH_EO_VCARD: See http://www.imc.org/pdi/vcard-21.doc for payload */
440 /* RIL_CDMA_SMS_UDH_EO_VCALENDAR: See http://www.imc.org/pdi/vcal-10.doc */
441 /* Or: Unsupported/proprietary extended objects */
443 } RIL_CDMA_SMS_UdhEoContent;
445 /* Extended Object UDH
447 /* Extended Object IDs/types
450 RIL_CDMA_SMS_UDH_EO_VCARD = 0x09,
451 RIL_CDMA_SMS_UDH_EO_VCALENDAR = 0x0A,
452 RIL_CDMA_SMS_UDH_EO_MAX32 = 0x10000000 /* Force constant ENUM size in structures */
453 } RIL_CDMA_SMS_UdhEoId;
456 /* Extended objects are to be used together with 16-bit concatenation
457 ** UDH. The max number of segments supported for E.O. is 8 at least.
459 RIL_CDMA_SMS_UdhEoContent content;
461 unsigned char first_segment;
462 /* The following fields are only present in the first segment of a
463 ** concatenated SMS message.
465 unsigned char reference;
466 /* Identify those extended object segments which should be linked together
468 unsigned short length;
469 /* Length of the whole extended object data
471 unsigned char control;
472 RIL_CDMA_SMS_UdhEoId type;
473 unsigned short position;
474 /* Absolute position of the E.O. in the whole text after concatenation,
477 } RIL_CDMA_SMS_UdhEo;
480 RIL_CDMA_SMS_UdhId header_id;
481 unsigned char header_length;
482 unsigned char data[RIL_CDMA_SMS_UDH_OTHER_SIZE];
483 } RIL_CDMA_SMS_UdhOther;
486 unsigned char header_length;
487 } RIL_CDMA_SMS_UdhRfc822;
490 RIL_CDMA_SMS_UdhId header_id;
493 RIL_CDMA_SMS_UdhConcat8 concat_8; // 00
495 RIL_CDMA_SMS_UdhSpecialSM special_sm; // 01
496 RIL_CDMA_SMS_UdhWap8 wap_8; // 04
497 RIL_CDMA_SMS_UdhWap16 wap_16; // 05
498 RIL_CDMA_SMS_UdhConcat16 concat_16; // 08
499 RIL_CDMA_SMS_UdhTextFormating text_formating; // 0a
500 RIL_CDMA_SMS_UdhPreDefSound pre_def_sound; // 0b
501 RIL_CDMA_SMS_UdhUserDefSound user_def_sound; // 0c
502 RIL_CDMA_SMS_UdhPreDefAnim pre_def_anim; // 0d
503 RIL_CDMA_SMS_UdhLargeAnim large_anim; // 0e
504 RIL_CDMA_SMS_UdhSmallAnim small_anim; // 0f
505 RIL_CDMA_SMS_UdhLargePictureData large_picture; // 10
506 RIL_CDMA_SMS_UdhSmallPictureData small_picture; // 11
507 RIL_CDMA_SMS_UdhVarPicture var_picture; // 12
509 RIL_CDMA_SMS_UdhUserPrompt user_prompt; // 13
510 RIL_CDMA_SMS_UdhEo eo; // 14
512 RIL_CDMA_SMS_UdhRfc822 rfc822; // 20
513 RIL_CDMA_SMS_UdhOther other;
518 /* ----------------------------- */
519 /* -- User data encoding type -- */
520 /* ----------------------------- */
522 RIL_CDMA_SMS_ENCODING_OCTET = 0, /* 8-bit */
523 RIL_CDMA_SMS_ENCODING_IS91EP, /* varies */
524 RIL_CDMA_SMS_ENCODING_ASCII, /* 7-bit */
525 RIL_CDMA_SMS_ENCODING_IA5, /* 7-bit */
526 RIL_CDMA_SMS_ENCODING_UNICODE, /* 16-bit */
527 RIL_CDMA_SMS_ENCODING_SHIFT_JIS, /* 8 or 16-bit */
528 RIL_CDMA_SMS_ENCODING_KOREAN, /* 8 or 16-bit */
529 RIL_CDMA_SMS_ENCODING_LATIN_HEBREW, /* 8-bit */
530 RIL_CDMA_SMS_ENCODING_LATIN, /* 8-bit */
531 RIL_CDMA_SMS_ENCODING_GSM_7_BIT_DEFAULT, /* 7-bit */
532 RIL_CDMA_SMS_ENCODING_MAX32 = 0x10000000
534 } RIL_CDMA_SMS_UserDataEncoding;
536 /* ------------------------ */
537 /* -- IS-91 EP data type -- */
538 /* ------------------------ */
540 RIL_CDMA_SMS_IS91EP_VOICE_MAIL = 0x82,
541 RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE_FULL = 0x83,
542 RIL_CDMA_SMS_IS91EP_CLI_ORDER = 0x84,
543 RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE = 0x85,
544 RIL_CDMA_SMS_IS91EP_MAX32 = 0x10000000
546 } RIL_CDMA_SMS_IS91EPType;
549 /* NOTE: If message_id.udh_present == TRUE:
550 ** 'num_headers' is the number of User Data Headers (UDHs),
551 ** and 'headers' include all those headers.
553 unsigned char num_headers;
554 RIL_CDMA_SMS_Udh headers[RIL_CDMA_SMS_MAX_UD_HEADERS];
556 RIL_CDMA_SMS_UserDataEncoding encoding;
557 RIL_CDMA_SMS_IS91EPType is91ep_type;
559 /*----------------------------------------------------------------------
560 'data_len' indicates the valid number of bytes in the 'data' array.
562 'padding_bits' (0-7) indicates how many bits in the last byte of 'data'
563 are invalid bits. This parameter is only used for Mobile-Originated
564 messages. There is no way for the API to tell how many padding bits
565 exist in the received message. Instead, the application can find out how
566 many padding bits exist in the user data when decoding the user data.
568 'data' has the raw bits of the user data field of the SMS message.
569 The client software should decode the raw user data according to its
570 supported encoding types and languages.
572 EXCEPTION 1: CMT-91 user data raw bits are first translated into BD fields
573 (e.g. num_messages, callback, etc.) The translated user data field in
574 VMN and Short Message is in the form of ASCII characters, each occupying
575 a byte in the resulted 'data'.
577 EXCEPTION 2: GSM 7-bit Default characters are decoded so that each byte
578 has one 7-bit GSM character.
580 'number_of_digits' is the number of digits/characters (7, 8, 16, or
581 whatever bits) in the raw user data, which can be used by the client
582 when decoding the user data according to the encoding type and language.
583 -------------------------------------------------------------------------*/
584 unsigned char data_len;
585 unsigned char padding_bits;
586 unsigned char data[ RIL_CDMA_SMS_USER_DATA_MAX ];
587 unsigned char number_of_digits;
589 } RIL_CDMA_SMS_CdmaUserData;
591 /* -------------------- */
592 /* ---- Message Id ---- */
593 /* -------------------- */
595 RIL_CDMA_SMS_BD_TYPE_RESERVED_0 = 0,
596 RIL_CDMA_SMS_BD_TYPE_DELIVER, /* MT only */
597 RIL_CDMA_SMS_BD_TYPE_SUBMIT, /* MO only */
598 RIL_CDMA_SMS_BD_TYPE_CANCELLATION, /* MO only */
599 RIL_CDMA_SMS_BD_TYPE_DELIVERY_ACK, /* MT only */
600 RIL_CDMA_SMS_BD_TYPE_USER_ACK, /* MT & MO */
601 RIL_CDMA_SMS_BD_TYPE_READ_ACK, /* MT & MO */
602 RIL_CDMA_SMS_BD_TYPE_MAX32 = 0x10000000
604 } RIL_CDMA_SMS_BdMessageType;
606 typedef unsigned int RIL_CDMA_SMS_MessageNumber;
609 RIL_CDMA_SMS_BdMessageType type;
610 RIL_CDMA_SMS_MessageNumber id_number;
611 unsigned char udh_present;
612 /* NOTE: if FEATURE_SMS_UDH is not defined,
613 ** udh_present should be ignored.
615 } RIL_CDMA_SMS_MessageId;
617 typedef unsigned char RIL_CDMA_SMS_UserResponse;
619 /* ------------------- */
620 /* ---- Timestamp ---- */
621 /* ------------------- */
623 /* If 'year' is between 96 and 99, the actual year is 1900 + 'year';
624 if 'year' is between 00 and 95, the actual year is 2000 + 'year'.
625 NOTE: Each field has two BCD digits and byte arrangement is <MSB, ... ,LSB>
627 unsigned char year; /* 0x00-0x99 */
628 unsigned char month; /* 0x01-0x12 */
629 unsigned char day; /* 0x01-0x31 */
630 unsigned char hour; /* 0x00-0x23 */
631 unsigned char minute; /* 0x00-0x59 */
632 unsigned char second; /* 0x00-0x59 */
633 signed char timezone; /* +/-, [-48,+48] number of 15 minutes - GW only */
634 } RIL_CDMA_SMS_Timestamp;
636 /* ------------------ */
637 /* ---- Priority ---- */
638 /* ------------------ */
640 RIL_CDMA_SMS_PRIORITY_NORMAL = 0,
641 RIL_CDMA_SMS_PRIORITY_INTERACTIVE,
642 RIL_CDMA_SMS_PRIORITY_URGENT,
643 RIL_CDMA_SMS_PRIORITY_EMERGENCY,
644 RIL_CDMA_SMS_PRIORITY_MAX32 = 0x10000000
646 } RIL_CDMA_SMS_Priority;
648 /* ----------------- */
649 /* ---- Privacy ---- */
650 /* ----------------- */
652 RIL_CDMA_SMS_PRIVACY_NORMAL = 0,
653 RIL_CDMA_SMS_PRIVACY_RESTRICTED,
654 RIL_CDMA_SMS_PRIVACY_CONFIDENTIAL,
655 RIL_CDMA_SMS_PRIVACY_SECRET,
656 RIL_CDMA_SMS_PRIVACY_MAX32 = 0x10000000
658 } RIL_CDMA_SMS_Privacy;
660 /* ---------------------- */
661 /* ---- Reply option ---- */
662 /* ---------------------- */
664 /* whether user ack is requested
666 unsigned char user_ack_requested;
668 /* whether delivery ack is requested.
669 Should be FALSE for incoming messages.
671 unsigned char delivery_ack_requested;
673 /* Message originator requests the receiving phone to send back a READ_ACK
674 ** message automatically when the user reads the received message.
676 unsigned char read_ack_requested;
678 } RIL_CDMA_SMS_ReplyOption;
681 RIL_CDMA_SMS_ALERT_MODE_DEFAULT = 0,
682 RIL_CDMA_SMS_ALERT_MODE_LOW_PRIORITY = 1,
683 RIL_CDMA_SMS_ALERT_MODE_MEDIUM_PRIORITY = 2,
684 RIL_CDMA_SMS_ALERT_MODE_HIGH_PRIORITY = 3,
686 /* For pre-IS637A implementations, alert_mode only has values of True/False:
688 RIL_CDMA_SMS_ALERT_MODE_OFF = 0,
689 RIL_CDMA_SMS_ALERT_MODE_ON = 1
691 } RIL_CDMA_SMS_AlertMode;
693 /* ------------------ */
694 /* ---- Language ---- */
695 /* ------------------ */
697 RIL_CDMA_SMS_LANGUAGE_UNSPECIFIED = 0,
698 RIL_CDMA_SMS_LANGUAGE_ENGLISH,
699 RIL_CDMA_SMS_LANGUAGE_FRENCH,
700 RIL_CDMA_SMS_LANGUAGE_SPANISH,
701 RIL_CDMA_SMS_LANGUAGE_JAPANESE,
702 RIL_CDMA_SMS_LANGUAGE_KOREAN,
703 RIL_CDMA_SMS_LANGUAGE_CHINESE,
704 RIL_CDMA_SMS_LANGUAGE_HEBREW,
705 RIL_CDMA_SMS_LANGUAGE_MAX32 = 0x10000000
707 } RIL_CDMA_SMS_Language;
709 /* ---------------------------------- */
710 /* ---------- Display Mode ---------- */
711 /* ---------------------------------- */
713 RIL_CDMA_SMS_DISPLAY_MODE_IMMEDIATE = 0,
714 RIL_CDMA_SMS_DISPLAY_MODE_DEFAULT = 1,
715 RIL_CDMA_SMS_DISPLAY_MODE_USER_INVOKE = 2,
716 RIL_CDMA_SMS_DISPLAY_MODE_RESERVED = 3
717 } RIL_CDMA_SMS_DisplayMode;
719 /* IS-637B parameters/fields
722 /* ---------------------------------- */
723 /* ---------- Delivery Status ------- */
724 /* ---------------------------------- */
726 RIL_CDMA_SMS_DELIVERY_STATUS_ACCEPTED = 0, /* ERROR_CLASS_NONE */
727 RIL_CDMA_SMS_DELIVERY_STATUS_DEPOSITED_TO_INTERNET = 1, /* ERROR_CLASS_NONE */
728 RIL_CDMA_SMS_DELIVERY_STATUS_DELIVERED = 2, /* ERROR_CLASS_NONE */
729 RIL_CDMA_SMS_DELIVERY_STATUS_CANCELLED = 3, /* ERROR_CLASS_NONE */
731 RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_CONGESTION = 4, /* ERROR_CLASS_TEMP & PERM */
732 RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_ERROR = 5, /* ERROR_CLASS_TEMP & PERM */
733 RIL_CDMA_SMS_DELIVERY_STATUS_CANCEL_FAILED = 6, /* ERROR_CLASS_PERM */
734 RIL_CDMA_SMS_DELIVERY_STATUS_BLOCKED_DESTINATION = 7, /* ERROR_CLASS_PERM */
735 RIL_CDMA_SMS_DELIVERY_STATUS_TEXT_TOO_LONG = 8, /* ERROR_CLASS_PERM */
736 RIL_CDMA_SMS_DELIVERY_STATUS_DUPLICATE_MESSAGE = 9, /* ERROR_CLASS_PERM */
737 RIL_CDMA_SMS_DELIVERY_STATUS_INVALID_DESTINATION = 10, /* ERROR_CLASS_PERM */
738 RIL_CDMA_SMS_DELIVERY_STATUS_MESSAGE_EXPIRED = 13, /* ERROR_CLASS_PERM */
740 RIL_CDMA_SMS_DELIVERY_STATUS_UNKNOWN_ERROR = 0x1F /* ERROR_CLASS_PERM */
742 /* All the other values are reserved */
744 } RIL_CDMA_SMS_DeliveryStatusE;
747 RIL_CDMA_SMS_ErrorClass error_class;
748 RIL_CDMA_SMS_DeliveryStatusE status;
749 } RIL_CDMA_SMS_DeliveryStatus;
752 unsigned char address[RIL_CDMA_SMS_IP_ADDRESS_SIZE];
753 unsigned char is_valid;
754 } RIL_CDMA_SMS_IpAddress;
756 /* This special parameter captures any unrecognized/proprietary parameters
759 unsigned char input_other_len;
760 unsigned char desired_other_len; /* used during decoding */
761 unsigned char * other_data;
762 } RIL_CDMA_SMS_OtherParm;
765 /* the mask indicates which fields are present in this message */
768 RIL_CDMA_SMS_MessageId message_id;
769 RIL_CDMA_SMS_CdmaUserData user_data;
770 RIL_CDMA_SMS_UserResponse user_response;
771 RIL_CDMA_SMS_Timestamp mc_time;
772 RIL_CDMA_SMS_Timestamp validity_absolute;
773 RIL_CDMA_SMS_Timestamp validity_relative;
774 RIL_CDMA_SMS_Timestamp deferred_absolute;
775 RIL_CDMA_SMS_Timestamp deferred_relative;
776 RIL_CDMA_SMS_Priority priority;
777 RIL_CDMA_SMS_Privacy privacy;
778 RIL_CDMA_SMS_ReplyOption reply_option;
779 unsigned char num_messages; /* the actual value; not BCDs */
780 RIL_CDMA_SMS_AlertMode alert_mode;
781 /* For pre-IS-637A implementations, alert_mode is either Off or On. */
782 RIL_CDMA_SMS_Language language;
783 RIL_CDMA_SMS_Address callback;
784 RIL_CDMA_SMS_DisplayMode display_mode;
786 RIL_CDMA_SMS_DeliveryStatus delivery_status;
787 unsigned int deposit_index;
789 RIL_CDMA_SMS_IpAddress ip_address;
790 unsigned char rsn_no_notify;
792 /* See function comments of wms_ts_decode() and
793 ** wms_ts_decode_cdma_bd_with_other() for details regarding 'other' parameters
795 RIL_CDMA_SMS_OtherParm other;
797 } RIL_CDMA_SMS_ClientBd;
800 unsigned char length; /* length, in bytes, of the encoded SMS message */
801 unsigned char * data; /* the encoded SMS message (max 255 bytes) */
802 } RIL_CDMA_Encoded_SMS;
808 #endif /*ANDROID_RIL_CDMA_SMS_H*/