• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_RIL_VENDOR_SMS_DEFS_H
17 #define OHOS_RIL_VENDOR_SMS_DEFS_H
18 
19 #include <stdint.h>
20 
21 #include "hril_enum.h"
22 #include "hril_public_struct.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 typedef struct {
29     int32_t msgRef; /* TP-Message-Reference for GSM, and BearerData MessageId for CDMA
30                      * from 3GPP2 C.S0015-B, v2.0, 4.5-1 */
31     char *pdu; /* Protocol Data Unit */
32     int32_t errCode; /* if unknown or not applicable, that is -1
33                       * from 3GPP 27.005, 3.2.5 for GSM/UMTS,
34                       * 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA */
35 } HRilSmsResponse;
36 
37 typedef struct {
38     int32_t index;
39     int32_t state;
40     char *smsc;
41     char *pdu; /* Protocol Data Unit */
42 } HRilSmsWriteSms;
43 
44 typedef struct {
45     int32_t tosca;
46     char *address;
47 } HRilServiceCenterAddress;
48 
49 /* From 3GPP TS 27.005  AT+CSCB=[<mode>[,<mids>[,<dcss>]]] */
50 typedef struct {
51     int32_t mode;
52     char *mids;
53     char *dcss;
54 } HRilCBConfigInfo;
55 
56 typedef struct {
57     int32_t service;
58     int32_t language;
59     unsigned char checked;
60 } HRilCdmaCBConfigInfo;
61 
62 /* From 3GPP TS 27.005   if text mode (+CMGF=1):
63     <CR><LF>+CBM:
64     <sn>,<mid>,<dcs>,<page>,<pages><CR><LF><data><CR>
65     <LF> if PDU mode
66     (+CMGF=0):
67     <CR><LF>+CBM: <length><CR><LF><pdu><CR><LF>
68 */
69 typedef struct {
70     int32_t sn;
71     int32_t mid;
72     int32_t page;
73     int32_t pages;
74     char *dcs;
75     char *data;
76     int32_t length;
77     char *pdu;
78 } HRilCBConfigReportInfo;
79 
80 typedef struct {
81     int32_t digitMode;
82     int32_t mode;
83     int32_t type;
84     int32_t plan;
85     unsigned char number;
86     unsigned char bytes[HRIL_MAX_CDMA_ADDRESS_LEN];
87 } HRilCdmaSmsAddress;
88 
89 typedef struct {
90     int32_t type;
91     unsigned char odd;
92     unsigned char number;
93     unsigned char bytes[HRIL_MAX_CDMA_ADDRESS_LEN];
94 } HRilCdmaSmsSubAddress;
95 
96 typedef struct {
97     int32_t serviceId;
98     unsigned char isExist;
99     int32_t type;
100     HRilCdmaSmsAddress address;
101     HRilCdmaSmsSubAddress subAddress;
102     int32_t size;
103     unsigned char bytes[HRIL_MAX_CDMA_MESSAGE_LEN];
104 } HRilCdmaSmsMessageInfo;
105 
106 typedef struct {
107     void (*SendGsmSms)(const ReqDataInfo *requestInfo, const char *const *data, size_t dataLen);
108     void (*SendSmsAck)(const ReqDataInfo *requestInfo, const int32_t *data, size_t dataLen);
109     void (*SendCdmaSms)(const ReqDataInfo *requestInfo, const char *data, size_t dataLen);
110     void (*SendCdmaAck)(const ReqDataInfo *requestInfo, const char *data, size_t dataLen);
111     void (*AddSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
112     void (*DelSimMessage)(const ReqDataInfo *requestInfo, const int32_t *data, size_t dataLen);
113     void (*UpdateSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
114     void (*SetSmscAddr)(const ReqDataInfo *requestInfo, const HRilServiceCenterAddress *data, size_t dataLen);
115     void (*GetSmscAddr)(const ReqDataInfo *requestInfo);
116     void (*SetCBConfig)(const ReqDataInfo *requestInfo, const HRilCBConfigInfo *data, size_t dataLen);
117     void (*GetCBConfig)(const ReqDataInfo *requestInfo);
118     void (*GetCdmaCBConfig)(const ReqDataInfo *requestInfo);
119     void (*SetCdmaCBConfig)(const ReqDataInfo *requestInfo, const HRilCdmaCBConfigInfo *data, size_t dataLen);
120     void (*AddCdmaSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
121     void (*DelCdmaSimMessage)(const ReqDataInfo *requestInfo, const int32_t *data, size_t dataLen);
122     void (*UpdateCdmaSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
123 } HRilSmsReq;
124 #ifdef __cplusplus
125 }
126 #endif
127 #endif // OHOS_RIL_VENDOR_SMS_DEFS_H
128