• 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 "hril_enum.h"
20 #include "hril_public_struct.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 typedef struct {
27     int32_t msgRef; /* TP-Message-Reference for GSM, and BearerData MessageId for CDMA
28                      * from 3GPP2 C.S0015-B, v2.0, 4.5-1 */
29     char *pdu; /* Protocol Data Unit */
30     int32_t errCode; /* if unknown or not applicable, that is -1
31                       * from 3GPP 27.005, 3.2.5 for GSM/UMTS,
32                       * 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA */
33 } HRilSmsResponse;
34 
35 typedef struct {
36     int32_t index;
37     int32_t state;
38     char *smsc;
39     char *pdu; /* Protocol Data Unit */
40 } HRilSmsWriteSms;
41 
42 typedef struct {
43     int32_t tosca;
44     char *address;
45 } HRilServiceCenterAddress;
46 
47 /* From 3GPP TS 27.005  AT+CSCB=[<mode>[,<mids>[,<dcss>]]] */
48 typedef struct {
49     int32_t mode;
50     char *mids;
51     char *dcss;
52 } HRilCBConfigInfo;
53 
54 typedef struct {
55     int32_t service;
56     int32_t language;
57     unsigned char checked;
58 } HRilCdmaCBConfigInfo;
59 
60 /* From 3GPP TS 27.005   if text mode (+CMGF=1):
61     <CR><LF>+CBM:
62     <sn>,<mid>,<dcs>,<page>,<pages><CR><LF><data><CR>
63     <LF> if PDU mode
64     (+CMGF=0):
65     <CR><LF>+CBM: <length><CR><LF><pdu><CR><LF>
66 */
67 typedef struct {
68     int32_t sn;
69     int32_t mid;
70     int32_t page;
71     int32_t pages;
72     char *dcs;
73     char *data;
74     int32_t length;
75     char *pdu;
76 } HRilCBConfigReportInfo;
77 
78 typedef struct {
79     int32_t digitMode;
80     int32_t mode;
81     int32_t type;
82     int32_t plan;
83     unsigned char number;
84     unsigned char bytes[HRIL_MAX_CDMA_ADDRESS_LEN];
85 } HRilCdmaSmsAddress;
86 
87 typedef struct {
88     int32_t type;
89     unsigned char odd;
90     unsigned char number;
91     unsigned char bytes[HRIL_MAX_CDMA_ADDRESS_LEN];
92 } HRilCdmaSmsSubAddress;
93 
94 typedef struct {
95     int32_t serviceId;
96     unsigned char isExist;
97     int32_t type;
98     HRilCdmaSmsAddress address;
99     HRilCdmaSmsSubAddress subAddress;
100     int32_t size;
101     unsigned char bytes[HRIL_MAX_CDMA_MESSAGE_LEN];
102 } HRilCdmaSmsMessageInfo;
103 
104 typedef struct {
105     void (*SendGsmSms)(const ReqDataInfo *requestInfo, const char *const *data, size_t dataLen);
106     void (*SendSmsAck)(const ReqDataInfo *requestInfo, const int32_t *data, size_t dataLen);
107     void (*SendCdmaSms)(const ReqDataInfo *requestInfo, const char *data, size_t dataLen);
108     void (*SendCdmaAck)(const ReqDataInfo *requestInfo, const char *data, size_t dataLen);
109     void (*AddSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
110     void (*DelSimMessage)(const ReqDataInfo *requestInfo, const int32_t *data, size_t dataLen);
111     void (*UpdateSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
112     void (*SetSmscAddr)(const ReqDataInfo *requestInfo, const HRilServiceCenterAddress *data, size_t dataLen);
113     void (*GetSmscAddr)(const ReqDataInfo *requestInfo);
114     void (*SetCBConfig)(const ReqDataInfo *requestInfo, const HRilCBConfigInfo *data, size_t dataLen);
115     void (*GetCBConfig)(const ReqDataInfo *requestInfo);
116     void (*GetCdmaCBConfig)(const ReqDataInfo *requestInfo);
117     void (*SetCdmaCBConfig)(const ReqDataInfo *requestInfo, const HRilCdmaCBConfigInfo *data, size_t dataLen);
118     void (*AddCdmaSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
119     void (*DelCdmaSimMessage)(const ReqDataInfo *requestInfo, const int32_t *data, size_t dataLen);
120     void (*UpdateCdmaSimMessage)(const ReqDataInfo *requestInfo, const HRilSmsWriteSms *data, size_t dataLen);
121 } HRilSmsReq;
122 #ifdef __cplusplus
123 }
124 #endif
125 #endif // OHOS_RIL_VENDOR_SMS_DEFS_H
126