• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 #ifndef CDMA_SMS_TYPES_H
18 #define CDMA_SMS_TYPES_H
19 
20 #include "sms_pdu_code_type.h"
21 
22 namespace OHOS {
23 namespace Telephony {
24 static constexpr uint32_t SMS_MAX_MESSAGE_ID = 65536;
25 static constexpr uint8_t SMS_SEQ_NUM_MAX = 64;
26 static constexpr uint16_t SMS_MAX_USER_DATA_LEN = 160;
27 static constexpr uint16_t SMS_CDMA_MAX_USER_UD_LEN = 7;
28 static constexpr uint16_t SMS_MAX_SUBMIT_MESSAGE_ID = 256;
29 
30 static constexpr uint16_t SMS_TRANS_ADDRESS_MAX_LEN = 256;
31 static constexpr uint16_t SMS_MAX_NUMBER_OF_ACK = 8;
32 
33 static constexpr char SMS_PUSH_XML_HREF_TAG[] = "href";
34 static constexpr char SMS_PUSH_XML_SI_ID_TAG[] = "si-id";
35 static constexpr char SMS_PUSH_XML_CREATED_TAG[] = "created";
36 static constexpr char SMS_PUSH_XML_EXPIRES_TAG[] = "si-expires";
37 static constexpr char SMS_PUSH_XML_ACTION_TAG[] = "action";
38 
39 static constexpr char SMS_PUSH_XML_INVAL_OBJ[] = "invalidate-object";
40 static constexpr char SMS_PUSH_XML_INVAL_SVC[] = "invalidate-service";
41 static constexpr char SMS_PUSH_XML_CO_URI[] = "uri";
42 
43 struct SmsWapContentType {
44     char *contentsTypeName;
45     unsigned char contentsTypeCode;
46 };
47 
48 struct SmsWapCharset {
49     char *charsetName;
50     unsigned short charsetCode;
51 };
52 
53 struct SmsWapUnregisterContentsType {
54     char *contentsTypeName;
55     unsigned short contentsTypeCode;
56 };
57 
58 struct SmsWspLanguage {
59     char *languageName;
60     unsigned char languageCode;
61 };
62 
63 struct SmsWspHeaderParameter {
64     char *parameterToken;
65     unsigned int parameterCode;
66 };
67 
68 struct SmsWspMethodType {
69     char *methodName;
70     unsigned char methodCode;
71 };
72 
73 struct SmsWspSecurityType {
74     char *securityTypeName;
75     unsigned char securityTypeCode;
76 };
77 
78 enum SmsNetworkStatus {
79     SMS_NETWORK_SEND_SUCCESS = 0x00,
80     SMS_NETWORK_SENDING,
81     SMS_NETWORK_SEND_FAIL,
82     SMS_NETWORK_SEND_FAIL_TIMEOUT,
83     SMS_NETWORK_SEND_FAIL_MANDATORY_INFO_MISSING,
84     SMS_NETWORK_SEND_FAIL_TEMPORARY,
85     SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_WITH_MOD,
86     SMS_NETWORK_SEND_FAIL_BY_MO_CONTROL_NOT_ALLOWED,
87     SMS_NETWORK_SEND_FAIL_FDN_RESTRICED,
88     SMS_NETWORK_SEND_PENDING,
89     SMS_NETWORK_SEND_FAIL_UNKNOWN_SUBSCRIBER,
90     SMS_NETWORK_SEND_FAIL_MS_DISABLED,
91     SMS_NETWORK_SEND_FAIL_NETWORK_NOT_READY,
92 };
93 
94 enum SmsWapAppCode {
95     SMS_WAP_APPLICATION_DEFAULT = 0x00,
96 
97     SMS_WAP_APPLICATION_PUSH_SI,
98     SMS_WAP_APPLICATION_PUSH_SIC,
99 
100     SMS_WAP_APPLICATION_PUSH_SL,
101     SMS_WAP_APPLICATION_PUSH_SLC,
102 
103     SMS_WAP_APPLICATION_PUSH_CO,
104     SMS_WAP_APPLICATION_PUSH_COC,
105 
106     SMS_WAP_APPLICATION_MMS_UA,
107 
108     SMS_WAP_APPLICATION_PUSH_SIA,
109 
110     SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP,
111     SMS_WAP_APPLICATION_SYNCML_DM_BOOTSTRAP_XML,
112     SMS_WAP_APPLICATION_SYNCML_DM_NOTIFICATION,
113     SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION,
114     SMS_WAP_APPLICATION_SYNCML_DS_NOTIFICATION_WBXML,
115 
116     SMS_WAP_APPLICATION_LOC_UA_WBXML,
117     SMS_WAP_APPLICATION_LOC_UA_XML,
118 
119     SMS_WAP_APPLICATION_DRM_UA_XML,
120     SMS_WAP_APPLICATION_DRM_UA_MESSAGE,
121     SMS_WAP_APPLICATION_DRM_UA_CONETENT,
122     SMS_WAP_APPLICATION_DRM_UA_RIGHTS_XML,
123     SMS_WAP_APPLICATION_DRM_UA_RIGHTS_WBXML,
124     SMS_WAP_APPLICATION_DRM_V2_RO_XML,
125     SMS_WAP_APPLICATION_DRM_V2_ROAP_PDU_XML,
126     SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_XML,
127     SMS_WAP_APPLICATION_DRM_V2_ROAP_TRIGGER_WBXML,
128 
129     SMS_WAP_APPLICATION_PUSH_PROVISIONING,
130     SMS_WAP_APPLICATION_PUSH_PROVISIONING_XML,
131     SMS_WAP_APPLICATION_PUSH_PROVISIONING_WBXML,
132 
133     SMS_WAP_APPLICATION_PUSH_BROWSER_SETTINGS,
134     SMS_WAP_APPLICATION_PUSH_BROWSER_BOOKMARKS,
135     SMS_WAP_APPLICATION_PUSH_SYNCSET_WBXML,
136     SMS_WAP_APPLICATION_PUSH_SYNCSET_XML,
137 
138     SMS_WAP_APPLICATION_PUSH_EMAIL_XML,
139     SMS_WAP_APPLICATION_PUSH_EMAIL_WBXML,
140 
141     SMS_WAP_APPLICATION_PUSH_IMPS_CIR,
142 
143     SMS_WAP_APPLICATION_PUSH_WAP_WMLC,
144 
145     SMS_WAP_APPLICATION_WML_UA,
146     SMS_WAP_APPLICATION_WTA_UA,
147 
148     SMS_WAP_APPLICATION_PUSH_SYNCML,
149     SMS_WAP_APPLICATION_LOC_UA,
150     SMS_WAP_APPLICATION_SYNCML_DM,
151     SMS_WAP_APPLICATION_PUSH_EMAIL,
152 
153     SMS_OMA_APPLICATION_ULP_UA,
154     SMS_OMA_APPLICATION_DLOTA_UA,
155 
156     SMS_WAP_APPLICATION_LBS,
157 };
158 
159 enum SmsMessageType : unsigned char {
160     SMS_TYPE_RESERVED = 0x00, /* reserved */
161     SMS_TYPE_DELIVER, /* mobile-terminated only */
162     SMS_TYPE_SUBMIT, /* mobile-originated only */
163     SMS_TYPE_CANCEL, /* mobile-originated only */
164     SMS_TYPE_DELIVERY_ACK, /* mobile-terminated only */
165     SMS_TYPE_USER_ACK, /* either direction */
166     SMS_TYPE_READ_ACK, /* either direction */
167     SMS_TYPE_DELIVER_REPORT, /* mobile-originated only */
168     SMS_TYPE_SUBMIT_REPORT = 0x08, /* mobile-terminated only */
169     SMS_TYPE_MAX_VALUE
170 };
171 
172 enum SmsAlertOption : unsigned char {
173     SMS_ALERT_NO_ALERT = 0,
174     SMS_ALERT_DEFAULT_ALERT,
175     SMS_ALERT_VIBRATE_ONCE,
176     SMS_ALERT_VIBRATE_REPEAT,
177     SMS_ALERT_VISUAL_ONCE,
178     SMS_ALERT_VISUAL_REPEAT,
179     SMS_ALERT_LOW_PRIORITY_ONCE,
180     SMS_ALERT_LOW_PRIORITY_REPEAT,
181     SMS_ALERT_MEDIUM_PRIORITY_ONCE,
182     SMS_ALERT_MEDIUM_PRIORITY_REPEAT,
183     SMS_ALERT_HIGH_PRIORITY_ONCE,
184     SMS_ALERT_HIGH_PRIORITY_REPEAT,
185     SMS_ALERT_RESERVED
186 };
187 
188 enum SmsLanguageType : unsigned char {
189     SMS_LAN_UNKNOWN,
190     SMS_LAN_ENGLISH,
191     SMS_LAN_FRENCH,
192     SMS_LAN_SPANISH,
193     SMS_LAN_JAPANESE,
194     SMS_LAN_KOREAN,
195     SMS_LAN_CHINESE,
196     SMS_LAN_HEBREW,
197 };
198 
199 enum SmsPriorityIndicator : unsigned char {
200     SMS_PRIORITY_NORMAL = 0x00,
201     SMS_PRIORITY_INTERACTIVE,
202     SMS_PRIORITY_URGENT,
203     SMS_PRIORITY_EMERGENCY
204 };
205 
206 enum SmsPrivacyIndicator : unsigned char {
207     SMS_PRIVACY_NOT_RESTRICTED = 0x00,
208     SMS_PRIVACY_RESTRICTED,
209     SMS_PRIVACY_CONFIDENTIAL,
210     SMS_PRIVACY_SECRET
211 };
212 
213 enum SmsAlertPriority : unsigned char {
214     SMS_ALERT_MOBILE_DEFAULT = 0x00,
215     SMS_ALERT_LOW_PRIORITY,
216     SMS_ALERT_MEDIUM_PRIORITY,
217     SMS_ALERT_HIGH_PRIORITY
218 };
219 
220 enum SmsDisplayMode : unsigned char {
221     SMS_DISPLAY_IMMEDIATE = 0x00,
222     SMS_DISPLAY_DEFAULT_SETTING,
223     SMS_DISPLAY_USER_INVOKE,
224     SMS_DISPLAY_RESERVED
225 };
226 
227 enum SmsEncodingType : unsigned char {
228     SMS_ENCODE_OCTET = 0x0,
229     SMS_ENCODE_EPM = 0x1, /* IS-91 Extended Protocol Message */
230     SMS_ENCODE_7BIT_ASCII = 0x2,
231     SMS_ENCODE_IA5 = 0x3,
232     SMS_ENCODE_UNICODE = 0x4,
233     SMS_ENCODE_SHIFT_JIS = 0x5,
234     SMS_ENCODE_KOREAN = 0x6,
235     SMS_ENCODE_LATIN_HEBREW = 0x7,
236     SMS_ENCODE_LATIN = 0x8,
237     SMS_ENCODE_GSM7BIT = 0x9,
238     SMS_ENCODE_GSMDCS = 0xa,
239     SMS_ENCODE_EUCKR = 0x10,
240     SMS_ENCODE_RESERVED
241 };
242 
243 enum SmsStatusCode : unsigned char {
244     /* ERROR_CLASS = '00' (no error) */
245     SMS_STATUS_ACCEPTED = 0x00,
246     SMS_STATUS_DEPOSITED = 0x01,
247     SMS_STATUS_DELIVERED = 0x02,
248     SMS_STATUS_CANCELLED = 0x03,
249 
250     /* ERROR_CLASS = '10' (temporary condition) */
251     SMS_STATUS_TEMP_NETWORK_CONGESTION = 0x84,
252     SMS_STATUS_TEMP_NETWORK_ERROR = 0x85,
253     SMS_STATUS_TEMP_UNKNOWN_ERROR = 0x9F,
254 
255     /* ERROR_CLASS = '11' (permanent condition) */
256     SMS_STATUS_PERMANENT_NETWORK_CONGESTION = 0xC4,
257     SMS_STATUS_PERMANENT_NETWORK_ERROR = 0xC5,
258     SMS_STATUS_PERMANENT_CANCEL_FAILED = 0xC6,
259     SMS_STATUS_PERMANENT_BLOCKED_DESTINATION = 0xC7,
260     SMS_STATUS_PERMANENT_TEXT_TOO_LONG = 0xC8,
261     SMS_STATUS_PERMANENT_DUPLICATE_MESSAGE = 0xC9,
262     SMS_STATUS_PERMANENT_INVALID_DESTINATION = 0xCA,
263     SMS_STATUS_PERMANENT_MESSAGE_EXPIRED = 0xCD,
264     SMS_STATUS_PERMANENT_UNKNOWN_ERROR = 0xDF,
265 };
266 
267 enum SmsCmaeCategory : unsigned char {
268     SMS_CMAE_CTG_GEO = 0x00,
269     SMS_CMAE_CTG_MET = 0x01,
270     SMS_CMAE_CTG_SAFETY = 0x02,
271     SMS_CMAE_CTG_SECURITY = 0x03,
272     SMS_CMAE_CTG_RESCUE = 0x04,
273     SMS_CMAE_CTG_FIRE = 0x05,
274     SMS_CMAE_CTG_HEALTH = 0x06,
275     SMS_CMAE_CTG_ENV = 0x07,
276     SMS_CMAE_CTG_TRANSPORT = 0x08,
277     SMS_CMAE_CTG_INFRA = 0x09,
278     SMS_CMAE_CTG_CBRNE = 0x0a,
279     SMS_CMAE_CTG_OTHER = 0x0b,
280     SMS_CMAE_CTG_RESERVED,
281 };
282 
283 enum SmsCmaeResponseType : unsigned char {
284     SMS_CMAE_RESP_TYPE_SHELTER = 0x00,
285     SMS_CMAE_RESP_TYPE_EVACUATE = 0x01,
286     SMS_CMAE_RESP_TYPE_PREPARE = 0x02,
287     SMS_CMAE_RESP_TYPE_EXECUTE = 0x03,
288     SMS_CMAE_RESP_TYPE_MONITOR = 0x04,
289     SMS_CMAE_RESP_TYPE_AVOID = 0x05,
290     SMS_CMAE_RESP_TYPE_ASSESS = 0x06,
291     SMS_CMAE_RESP_TYPE_NONE = 0x07,
292     SMS_CMAE_RESP_TYPE_RESERVED,
293 };
294 
295 enum SmsCmaeSeverity : unsigned char {
296     SMS_CMAE_SEVERITY_EXTREME = 0x0,
297     SMS_CMAE_SEVERITY_SEVERE = 0x1,
298     SMS_CMAE_SEVERITY_RESERVED,
299 };
300 
301 enum SmsCmaeUrgency : unsigned char {
302     SMS_CMAE_URGENCY_IMMEDIATE = 0x0,
303     SMS_CMAE_URGENCY_EXPECTED = 0x1,
304     SMS_CMAE_URGENCY_RESERVED,
305 };
306 
307 enum SmsCmaeCertainty : unsigned char {
308     SMS_CMAE_CERTAINTY_OBSERVED = 0x0,
309     SMS_CMAE_CERTAINTY_LIKELY = 0x1,
310     SMS_CMAE_CERTAINTY_RESERVED,
311 };
312 
313 enum SmsCmaeAlertHandle : unsigned char {
314     SMS_CMAE_ALERT_PRESIDENTIAL = 0x00,
315     SMS_CMAE_ALERT_EXTREME = 0x01,
316     SMS_CMAE_ALERT_SEVERE = 0x02,
317     SMS_CMAE_ALERT_AMBER = 0x03,
318     SMS_CMAE_ALERT_RESERVED,
319 };
320 
321 enum SmsBearerSubParam : unsigned char {
322     SMS_BEARER_MESSAGE_IDENTIFIER = 0x00,
323     SMS_BEARER_USER_DATA = 0x01,
324     SMS_BEARER_USER_RESPONSE_CODE = 0x02,
325     SMS_BEARER_MSG_CENTER_TIME_STAMP = 0x03,
326     SMS_BEARER_VALIDITY_PERIOD_ABSOLUTE = 0x04,
327     SMS_BEARER_VALIDITY_PERIOD_RELATIVE = 0x05,
328     SMS_BEARER_DEFERRED_DELIVERY_TIME_ABSOLUTE = 0x06,
329     SMS_BEARER_DEFERRED_DELIVERY_TIME_RELATIVE = 0x07,
330     SMS_BEARER_PRIORITY_INDICATOR = 0x08,
331     SMS_BEARER_PRIVACY_INDICATOR = 0x09,
332     SMS_BEARER_REPLY_OPTION = 0x0A,
333     SMS_BEARER_NUMBER_OF_MESSAGES = 0x0B,
334     SMS_BEARER_ALERT_ON_MSG_DELIVERY = 0x0C,
335     SMS_BEARER_LANGUAGE_INDICATOR = 0x0D,
336     SMS_BEARER_CALLBACK_NUMBER = 0x0E,
337     SMS_BEARER_MSG_DISPLAY_MODE = 0x0F,
338     SMS_BEARER_MULTI_ENCODING_USER_DATA = 0x10,
339     SMS_BEARER_MSG_DEPOSIT_INDEX = 0x11,
340     SMS_BEARER_SVC_CATEGORY_PROGRAM_DATA = 0x12,
341     SMS_BEARER_SVC_CATEGORY_PROGRAM_RESULT = 0x13,
342     SMS_BEARER_MESSAGE_STATUS = 0x14,
343     SMS_BEARER_TP_FAILURE_CAUSE = 0x15,
344     SMS_BEARER_ENHANCED_VMN = 0x16,
345     SMS_BEARER_ENHANCED_VMN_ACK = 0x17,
346     SMS_BEARER_MAX_VALUE
347 };
348 
349 enum SmsSvcCtgResult : unsigned char {
350     SMS_SVC_RESULT_SUCCESS = 0x00,
351     SMS_SVC_RESULT_MEMORY_LIMIT_EXCEEDED,
352     SMS_SVC_RESULT_LIMIT_EXCEEDED,
353     SMS_SVC_RESULT_ALREADY_PROGRAMMED,
354     SMS_SVC_RESULT_NOT_PREVIOUSLY_PROGRAMMED,
355     SMS_SVC_RESULT_INVALID_MAX_MESSAGES,
356     SMS_SVC_RESULT_INVALID_ALERT_OPTION,
357     SMS_SVC_RESULT_INVALID_SVC_CTG_NAME,
358     SMS_SVC_RESULT_INSPECIFIED_PROGRAMMING_FAILURE,
359     SMS_SVC_RESULT_RESERVED
360 };
361 
362 enum SmsTpFailureCause {
363     /* 0x00 ~ 0x7f reserved */
364     SMS_TP_CAUSE_RESERVED,
365 
366     /* 0x80 ~ 0x8f TP-PID errors */
367     SMS_TP_CAUSE_TELEMATIC_INTERWORKING_NOT_SUPPORTED = 0x80,
368     SMS_TP_CAUSE_SHORT_MSG_TYPE_0_NOT_SUPPORTED = 0x81,
369     SMS_TP_CAUSE_CANNOT_REPLACE_SHORT_MSG = 0x82,
370     SMS_TP_CAUSE_UNSPECIFIED_TP_PID_ERROR = 0x8f,
371 
372     /* 0x90 ~ 0x9f TP-DCS errors */
373     SMS_TP_CAUSE_DCS_NOT_SPPORTED = 0x90,
374     SMS_TP_CAUSE_MSG_CLASS_NOT_SUPPORTED = 0x91,
375     SMS_TP_CAUSE_UNSPECIFIED_TP_DCS_ERROR = 0x9f,
376 
377     /* 0xa0 ~ 0xaf TP-Command Errors */
378     SMS_TP_CAUSE_CMD_CANNOT_BE_ACTIONED = 0xa0,
379     SMS_TP_CAUSE_CMD_UNSUPPORTED = 0xa1,
380     SMS_TP_CAUSE_UNSPECIFIED_TP_CMD_ERROR = 0xaf,
381 
382     SMS_TP_CAUSE_TPDU_NOT_SUPPORTED = 0xb0,
383 
384     SMS_TP_CAUSE_SC_BUSY = 0xc0,
385     SMS_TP_CAUSE_NO_SC_SUBCRIPTION = 0xc1,
386     SMS_TP_CAUSE_SC_SYSTEM_FAILURE = 0xc2,
387     SMS_TP_CAUSE_INVALID_SME_ADDRESS = 0xc3,
388     SMS_TP_CAUSE_DESTINATION_SME_BARRED = 0xc4,
389     SMS_TP_CAUSE_SM_REJECTED_DUPLICATE_SM = 0xc5,
390     SMS_TP_CAUSE_TP_VPF_NOT_SUPPORTED = 0xc6,
391     SMS_TP_CAUSE_TP_VP_NOT_SUPPORTED = 0xc7,
392 
393     SMS_TP_CAUSE_SIM_SMS_STORAGE_FULL = 0xd0,
394     SMS_TP_CAUSE_NO_SMS_STORAGE_CAPABILITY_IN_SIM = 0xd1,
395     SMS_TP_CAUSE_ERROR_IN_MS = 0xd2,
396     SMS_TP_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xd3,
397     SMS_TP_CAUSE_SIM_APPLICATION_TOOLKIT_BUSY = 0xd4,
398     SMS_TP_CAUSE_SIM_DATA_DOWNLOAD_ERROR = 0xd5,
399 
400     /* 0xe0 ~ 0xfe Values specific to an application */
401     SMS_TP_CAUSE_SPECIFIC_TO_APPLICATION_MIN = 0xe0,
402     SMS_TP_CAUSE_SPECIFIC_TO_APPLICATION_MAX = 0xfe,
403 
404     SMS_TP_CAUSE_UNSPECIFIED_ERROR_CAUSE = 0xff
405 };
406 
407 struct SmsTransMsgId {
408     unsigned short msgId;
409     bool headerInd;
410 };
411 
412 struct SmsTeleSvcAddr {
413     bool digitMode;
414     unsigned char numberType;
415     unsigned char numberPlan;
416     unsigned int addrLen;
417     char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
418 };
419 
420 struct SmsReplyOption {
421     bool userAckReq;
422     bool deliverAckReq;
423     bool readAckReq;
424     bool reportReq;
425 };
426 
427 struct SmsValPeriod {
428     unsigned char format;
429     union {
430         SmsTimeRel relTime;
431         SmsTimeAbs absTime;
432     } time;
433 };
434 
435 struct SmsEncodingSpecific {
436     enum SmsEncodingType encodeType;
437     unsigned int dataLen;
438     char userData[SMS_MAX_USER_DATA_LEN + 1];
439 };
440 
441 struct SmsCtgSpecific {
442     unsigned char operationCode;
443     unsigned short category;
444     SmsLanguageType language;
445     unsigned char maxMsg;
446     SmsAlertOption alertOption;
447     unsigned int dataLen;
448     char userData[SMS_MAX_USER_DATA_LEN + 1];
449 };
450 
451 struct SmsSvcCtgProgramData {
452     enum SmsEncodingType encodeType;
453     unsigned int numData;
454     SmsCtgSpecific *specificData;
455 };
456 
457 struct SmsTeleSvcUserData {
458     enum SmsEncodingType encodeType;
459     unsigned char msgType;
460     struct SmsUserData userData;
461 };
462 
463 struct SmsTeleSvcCmasData {
464     unsigned int dataLen;
465     enum SmsEncodingType encodeType;
466     unsigned char alertText[SMS_MAX_USER_DATA_LEN + 1];
467     enum SmsCmaeCategory category;
468     enum SmsCmaeResponseType responseType;
469     enum SmsCmaeSeverity severity;
470     enum SmsCmaeUrgency urgency;
471     enum SmsCmaeCertainty certainty;
472     unsigned short id;
473     enum SmsCmaeAlertHandle alertHandle; /* 00:Presidential 01:Extreme 02:Severe 03:AMBER 04:Test */
474     struct SmsTimeAbs expires;
475     enum SmsLanguageType language;
476     bool isWrongRecodeType;
477 };
478 
479 struct SmsEnhancedVmn {
480     enum SmsPriorityIndicator priority;
481     bool passwordReq;
482     bool setupReq;
483     bool pwChangeReq;
484     unsigned char minPwLen;
485     unsigned char maxPwLen;
486     unsigned char vmNumUnheardMsg;
487     bool vmMailboxAlmFull;
488     bool vmMailboxFull;
489     bool replyAllowed;
490     bool faxIncluded;
491     unsigned short vmLen;
492     unsigned char vmRetDay;
493     unsigned short vmMsgId;
494     unsigned short vmMailboxId;
495 
496     bool anDigitMode;
497     unsigned char anNumberType;
498     unsigned char anNumberPlan;
499     unsigned char anNumField;
500     unsigned char anChar[SMS_MAX_USER_DATA_LEN + 1];
501 
502     bool cliDigitMode;
503     unsigned char cliNumberType;
504     unsigned char cliNumberPlan;
505     unsigned char cliNumField;
506     unsigned char cliChar[SMS_MAX_USER_DATA_LEN + 1];
507 };
508 
509 struct SmsEnhancedVmnAck {
510     unsigned short vmMailboxId;
511     unsigned char vmNumUnheardMsg;
512     unsigned char numDeleteAck;
513     unsigned char numPlayAck;
514 
515     unsigned short daVmMsgId[SMS_MAX_NUMBER_OF_ACK + 1];
516     unsigned short paVmMsgId[SMS_MAX_NUMBER_OF_ACK + 1];
517 };
518 
519 struct SmsTeleSvcDeliver {
520     SmsTransMsgId msgId;
521     SmsTeleSvcUserData userData;
522     SmsTeleSvcCmasData cmasData;
523     struct SmsTimeAbs timeStamp;
524     struct SmsValPeriod valPeriod;
525     struct SmsValPeriod deferValPeriod;
526     enum SmsPriorityIndicator priority;
527     enum SmsPrivacyIndicator privacy;
528     SmsReplyOption replyOpt;
529     unsigned int numMsg;
530     enum SmsAlertPriority alertPriority;
531     enum SmsLanguageType language;
532     SmsTeleSvcAddr callbackNumber;
533     enum SmsDisplayMode displayMode;
534     SmsEncodingSpecific multiEncodeData;
535     unsigned short depositId;
536     /* sms_svc_ctg_program_data_s svc_ctg */
537     SmsEnhancedVmn enhancedVmn;
538     SmsEnhancedVmnAck enhancedVmnAck;
539 };
540 
541 struct SmsTeleSvcSubmit {
542     SmsTransMsgId msgId;
543     SmsTeleSvcUserData userData;
544     SmsValPeriod valPeriod;
545     SmsValPeriod deferValPeriod;
546     enum SmsPriorityIndicator priority;
547     enum SmsPrivacyIndicator privacy;
548     SmsReplyOption replyOpt;
549     enum SmsAlertPriority alertPriority;
550     enum SmsLanguageType language;
551     SmsTeleSvcAddr callbackNumber;
552     SmsEncodingSpecific multiEncodeData;
553     unsigned char depositId;
554     /* sms_svc_ctg_program_data_s svc_ctg */
555 };
556 
557 struct SmsTeleSvcCancel {
558     SmsTransMsgId msgId;
559 };
560 
561 struct SmsTeleSvcUserAck {
562     SmsTransMsgId msgId;
563     SmsTeleSvcUserData userData;
564     unsigned char respCode;
565     SmsTimeAbs timeStamp;
566     SmsEncodingSpecific multiEncodeData;
567     unsigned char depositId;
568 };
569 
570 struct SmsTeleSvcDeliverAck {
571     SmsTransMsgId msgId;
572     SmsTeleSvcUserData userData;
573     SmsTimeAbs timeStamp;
574     SmsEncodingSpecific multiEncodeData;
575     enum SmsStatusCode msgStatus;
576 };
577 
578 struct SmsTeleSvcReadAck {
579     SmsTransMsgId msgId;
580     SmsTeleSvcUserData userData;
581     SmsTimeAbs timeStamp;
582     SmsEncodingSpecific multiEncodeData;
583     unsigned char depositId;
584 };
585 
586 struct SmsTeleSvcDeliverReport {
587     SmsTransMsgId msgId;
588     unsigned char tpFailCause;
589     SmsTeleSvcUserData userData;
590     enum SmsLanguageType language;
591     unsigned char multiEncodeData;
592 };
593 
594 struct SmsTeleSvcMsg {
595     enum SmsMessageType type;
596     union {
597         SmsTeleSvcDeliver deliver;
598         SmsTeleSvcSubmit submit;
599         SmsTeleSvcCancel cancel;
600         SmsTeleSvcUserAck userAck;
601         SmsTeleSvcDeliverAck deliveryAck;
602         SmsTeleSvcReadAck readAck;
603         SmsTeleSvcDeliverReport report;
604     } data;
605 };
606 
607 enum SmsTransParamId : unsigned char {
608     SMS_TRANS_PARAM_TELESVC_IDENTIFIER = 0x00,
609     SMS_TRANS_PARAM_SERVICE_CATEGORY = 0x01,
610     SMS_TRANS_PARAM_ORG_ADDRESS = 0x02,
611     SMS_TRANS_PARAM_ORG_SUB_ADDRESS = 0x03,
612     SMS_TRANS_PARAM_DEST_ADDRESS = 0x04,
613     SMS_TRANS_PARAM_DEST_SUB_ADDRESS = 0x05,
614     SMS_TRANS_PARAM_BEARER_REPLY_OPTION = 0x06,
615     SMS_TRANS_PARAM_CAUSE_CODES = 0x07,
616     SMS_TRANS_PARAM_BEARER_DATA = 0x08,
617     SMS_TRANS_PARAM_RESERVED
618 };
619 
620 enum SmsTransTelsvcId : unsigned short {
621     SMS_TRANS_TELESVC_CMT_91 = 0x1000, /* IS-91 Extended Protocol Enhanced Services */
622     SMS_TRANS_TELESVC_CPT_95 = 0x1001, /* Wireless Paging Teleservice */
623     SMS_TRANS_TELESVC_CMT_95 = 0x1002, /* Wireless Messaging Teleservice */
624     SMS_TRANS_TELESVC_VMN_95 = 0x1003, /* Voice Mail Notification */
625     SMS_TRANS_TELESVC_WAP = 0x1004, /* Wireless Application Protocol */
626     SMS_TRANS_TELESVC_WEMT = 0x1005, /* Wireless Enhanced Messaging Teleservice */
627     SMS_TRANS_TELESVC_SCPT = 0x1006, /* Service Category Programming Teleservice */
628     SMS_TRANS_TELESVC_CATPT = 0x1007, /* Card Application Toolkit Protocol Teleservice */
629     SMS_TRANS_TELESVC_RESERVED = 0xffff
630 };
631 
632 enum SmsTransSvcCtg : unsigned short {
633     SMS_TRANS_SVC_CTG_UNKNOWN = 0x0000,
634     SMS_TRANS_SVC_CTG_EMERGENCY = 0x0001,
635     SMS_TRANS_SVC_CTG_ADMINISTRATIVE = 0x0002,
636     SMS_TRANS_SVC_CTG_MAINTENANCE = 0x0003,
637     SMS_TRANS_SVC_CTG_GNEWS_LOCAL = 0x0004,
638     SMS_TRANS_SVC_CTG_GNEWS_REGIONAL = 0x0005,
639     SMS_TRANS_SVC_CTG_GNEWS_NATIONAL = 0x0006,
640     SMS_TRANS_SVC_CTG_GNEWS_INTERNATIONAL = 0x0007,
641     SMS_TRANS_SVC_CTG_BFNEWS_LOCAL = 0x0008,
642     SMS_TRANS_SVC_CTG_BFNEWS_REGIONAL = 0x0009,
643     SMS_TRANS_SVC_CTG_BFNEWS_NATIONAL = 0x000a,
644     SMS_TRANS_SVC_CTG_BFNEWS_INTERNATIONAL = 0x000b,
645     SMS_TRANS_SVC_CTG_SNEWS_LOCAL = 0x000c,
646     SMS_TRANS_SVC_CTG_SNEWS_REGIONAL = 0x000d,
647     SMS_TRANS_SVC_CTG_SNEWS_NATIONAL = 0x000e,
648     SMS_TRANS_SVC_CTG_SNEWS_INTERNATIONAL = 0x000f,
649     SMS_TRANS_SVC_CTG_ENEWS_LOCAL = 0x0010,
650     SMS_TRANS_SVC_CTG_ENEWS_REGIONAL = 0x0011,
651     SMS_TRANS_SVC_CTG_ENEWS_NATIONAL = 0x0012,
652     SMS_TRANS_SVC_CTG_ENEWS_INTERNATIONAL = 0x0013,
653     SMS_TRANS_SVC_CTG_LOCAL_WEATHER = 0x0014,
654     SMS_TRANS_SVC_CTG_TRAFFIC_REPORTS = 0x0015,
655     SMS_TRANS_SVC_CTG_FLIGHT_SCHEDULES = 0x0016,
656     SMS_TRANS_SVC_CTG_RESTAURANTS = 0x0017,
657     SMS_TRANS_SVC_CTG_LODGINGS = 0x0018,
658     SMS_TRANS_SVC_CTG_RETAIL_DIRECTORY = 0x0019,
659     SMS_TRANS_SVC_CTG_ADVERTISEMENTS = 0x001a,
660     SMS_TRANS_SVC_CTG_STOCK_QUOTES = 0x001b,
661     SMS_TRANS_SVC_CTG_EMPLOYMENT = 0x001c,
662     SMS_TRANS_SVC_CTG_MEDICAL = 0x001d,
663     SMS_TRANS_SVC_CTG_TECHNOLOGY_NEWS = 0x001e,
664     SMS_TRANS_SVC_CTG_MULTI_CTG = 0x001f,
665     SMS_TRANS_SVC_CTG_CATPT = 0x0020,
666     SMS_TRANS_SVC_CTG_KDDI_CORP_MIN1 = 0x0021,
667     SMS_TRANS_SVC_CTG_KDDI_CORP_MAX1 = 0x003f,
668     SMS_TRANS_SVC_CTG_CMAS_PRESIDENTIAL = 0x1000,
669     SMS_TRANS_SVC_CTG_CMAS_EXTREME = 0x1001,
670     SMS_TRANS_SVC_CTG_CMAS_SEVERE = 0x1002,
671     SMS_TRANS_SVC_CTG_CMAS_AMBER = 0x1003,
672     SMS_TRANS_SVC_CTG_CMAS_TEST = 0x1004,
673     SMS_TRANS_SVC_CTG_KDDI_CORP_MIN2 = 0x8001,
674     SMS_TRANS_SVC_CTG_KDDI_CORP_MAX2 = 0x803f,
675     SMS_TRANS_SVC_CTG_KDDI_CORP_MIN3 = 0xc001,
676     SMS_TRANS_SVC_CTG_KDDI_CORP_MAX3 = 0xc03f,
677     SMS_TRANS_SVC_CTG_RESERVED,
678     SMS_TRANS_SVC_CTG_UNDEFINED = 0x8001,
679 };
680 
681 enum SmsTransErrClass {
682     SMS_TRANS_ERR_CLASS_NONE = 0x00,
683     SMS_TRANS_ERR_CLASS_TEMPORARY = 0x02,
684     SMS_TRANS_ERR_CLASS_PERMANENT = 0x03
685 };
686 
687 enum SmsTransCauseCodeType : unsigned char {
688     SMS_CAUSE_CODE_INVAILD_TELESERVICE_ID = 0x04,
689     SMS_CAUSE_CODE_SERVICE_TERMINATION_DENIED = 0x62,
690     SMS_TO_FILL_THIS_ENUMS
691 };
692 
693 enum SmsTransSubAddrType : unsigned char {
694     SMS_TRANS_SUB_ADDR_NSAP = 0x00,
695     SMS_TRANS_SUB_ADDR_USER = 0x01,
696     SMS_TRANS_SUB_ADDR_RESERVED
697 };
698 
699 enum SmsTransDnetAddrType : unsigned char {
700     SMS_TRANS_DNET_UNKNOWN = 0x00,
701     SMS_TRANS_DNET_INTERNET_PROTOCOL = 0x01,
702     SMS_TRANS_DNET_INTERNET_MAIL_ADDR = 0x02,
703     SMS_TRANS_DNET_RESERVED
704 };
705 
706 enum SmsDnetNumberType : unsigned char {
707     SMS_ADDRESS_TYPE_UNKNOWN = 0x00,
708     SMS_ADDRESS_TYPE_INTERNET_PROTOCOL = 0x01,
709     SMS_ADDRESS_TYPE_EMAIL_ADDRESS = 0x02,
710 };
711 
712 enum SmsNumberType : unsigned char {
713     SMS_NUMBER_TYPE_UNKNOWN = 0x00,
714     SMS_NUMBER_TYPE_INTERNATIONAL = 0x01,
715     SMS_NUMBER_TYPE_NATIONAL = 0x02,
716     SMS_NUMBER_TYPE_NETWORK_SPECIFIC = 0x03,
717     SMS_NUMBER_TYPE_SUBSCRIBER = 0x04,
718     SMS_NUMBER_TYPE_RESERVED_5 = 0x05,
719     SMS_NUMBER_TYPE_ABBREVIATED = 0x06,
720     SMS_NUMBER_TYPE_RESERVED_7 = 0x07,
721 };
722 
723 enum SmsDigitMode { SMS_DIGIT_4BIT_DTMF = 0, SMS_DIGIT_8BIT = 1 };
724 
725 enum SmsNumberMode {
726     SMS_NUMBER_MODE_NONE_DATANETWORK = 0,
727     SMS_NUMBER_MODE_DATANETWORK = 1, /* using data network address format */
728 };
729 
730 struct SmsTransAddr {
731     bool digitMode; // ture digit 8bit mode, false digit 4bit dtmf
732     bool numberMode; // ture using data network address format, false none data network
733     unsigned char numberType;
734     unsigned char numberPlan;
735     unsigned int addrLen;
736     char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
737 };
738 
739 struct SmsTransSubAddr {
740     enum SmsTransSubAddrType type;
741     bool odd;
742     unsigned int addrLen;
743     char szData[SMS_TRANS_ADDRESS_MAX_LEN + 1];
744 };
745 
746 struct SmsTransCauseCode {
747     unsigned char transReplySeq;
748     enum SmsTransErrClass errorClass;
749     enum SmsTransCauseCodeType causeCode;
750 };
751 
752 enum SmsTransMsgType {
753     SMS_TRANS_P2P_MSG = 0x00,
754     SMS_TRANS_BROADCAST_MSG = 0x01,
755     SMS_TRANS_ACK_MSG = 0x02,
756     SMS_TRANS_TYPE_RESERVED
757 };
758 
759 struct SmsTransP2PMsg {
760     unsigned short transTelesvcId;
761     unsigned short transSvcCtg;
762     SmsTransAddr address;
763     SmsTransSubAddr subAddress;
764     unsigned char transReplySeq;
765     SmsTeleSvcMsg telesvcMsg;
766 };
767 
768 struct SmsTransBroadCastMsg {
769     unsigned short transSvcCtg;
770     SmsTeleSvcMsg telesvcMsg;
771 };
772 
773 struct SmsTransAckMsg {
774     SmsTransAddr address;
775     SmsTransSubAddr subAddress;
776     SmsTransCauseCode causeCode;
777 };
778 
779 struct SmsTransMsg {
780     enum SmsTransMsgType type;
781     union {
782         SmsTransP2PMsg p2pMsg;
783         SmsTransBroadCastMsg cbMsg;
784         SmsTransAckMsg ackMsg;
785     } data;
786 };
787 } // namespace Telephony
788 } // namespace OHOS
789 #endif