• 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_SIM_PARCEL_H
17 #define OHOS_RIL_SIM_PARCEL_H
18 
19 #include "hril_base_parcel.h"
20 
21 namespace OHOS {
22 namespace Telephony {
23 struct CardStatusInfo {
24     int32_t index;
25     int32_t simType;
26     int32_t simState;
27 };
28 
29 /* Form 3GPP TS 27.007 V4.3.0 (2001-12) 8.18, + CRSM */
30 struct SimIoRequestInfo {
31     int32_t command; /* command passed on by the ME to the SIM; refer GSM 51.011 [28] */
32     int32_t fileId; /* this is the identifier of an elementary datafile on SIM.
33                      * Mandatory for every command except STATUS */
34     int32_t p1; /* parameters passed on by the MT to the SIM.
35                  * These parameters are mandatory for every command,
36                  * except GET RESPONSE and STATUS.
37                  * The values are described in 3GPP TS 51.011 [28] */
38     int32_t p2;
39     int32_t p3;
40     std::string data; /* information which shall be written to the SIM
41                        * (hexadecimal character format; refer +CSCS). */
42     std::string path; /* contains the path of an elementary file on the SIM/UICC
43                        * in hexadecimal format as defined in ETSI TS 102 221 [60]
44                        * (e.g. "7F205F70" in SIM and UICC case).
45                        * The <pathid> shall only be used in the mode
46                        * "select by path from MF" as defined in  ETSI TS 102 221 [60] */
47     int32_t serial;
48     std::string pin2;
49     std::string aid;
50 };
51 
52 /* Form 3GPP TS 27.007 V4.3.0 (2001-12) 8.18, + CRSM */
53 struct IccIoResultInfo {
54     int32_t sw1; /* information from the SIM about the execution of the actual command.
55                   * These parameters are delivered to the TE in both cases,
56                   * on successful or failed execution of the command */
57     int32_t sw2;
58     std::string response;
59 };
60 
61 struct SimLockInfo {
62     int32_t serial;
63     std::string fac; /* String type, which specifies the object operated by this command.
64                       * "SC": SIM PIN1;
65                       * "AO": prohibit all outgoing calls;
66                       * "OI": All international outgoing calls are prohibited;
67                       * "OX": All international outgoing calls are prohibited, except for the country of origin;
68                       * "AI": All incoming calls are prohibited;
69                       * "IR": When roaming outside the home area, all incoming calls are prohibited;
70                       * "AB": prohibit all services (applicable only when <mode>=0);
71                       * "AG": Outgoing call is prohibited (applicable only when <mode>=0);
72                       * "AC": Incoming calls are prohibited (applicable only when <mode>=0);
73                       * "FD": FDN;
74                       * "PN": lock the network;
75                       * "PU": lock subnet;
76                       * "PP": Lock SP. */
77     int32_t mode;
78     int32_t status;
79     std::string passwd;
80     int32_t classx;
81 };
82 
83 struct SimPasswordInfo {
84     int32_t serial;
85     std::string fac; /* String type, which specifies the object operated by this command.
86                       * “SC”:SIM PIN1;
87                       * “P2”:SIM PIN2;
88                       * "OI": All international outgoing calls are prohibited;
89                       * "OX": All international outgoing calls are prohibited, except for the country of origin;
90                       * "AI": All incoming calls are prohibited;
91                       * "IR": When roaming outside the home area, all incoming calls are prohibited;
92                       * "AB": prohibit all services (applicable only when <mode>=0);
93                       * "AG": Outgoing call is prohibited (applicable only when <mode>=0);
94                       * "AC": Incoming call service is prohibited (applicable only when <mode>=0). */
95     std::string oldPassword;
96     std::string newPassword;
97     int32_t passwordLength; /* Max length of oldPassword or newPassword */
98 };
99 
100 struct SimPinInputTimes {
101     int32_t serial;
102     std::string code; /* param of string.
103                        * SIM PIN2 is mean that SIM PIN2 request. SIM PUK2 is mean that SIM PUK2 request. */
104     int32_t times; /* The remaining number of entries, for PIN2, the maximum number of entries is 3 times;
105                     * for PUK2, the maximum number of entries is 10 times. */
106     int32_t pukTimes; /* The remaining number of PUK, the maximum number of entries is 10 times. */
107     int32_t pinTimes; /* The remaining number of PIN, the maximum number of entries is 3 times. */
108     int32_t puk2Times; /* The remaining number of PUK2, the maximum number of entries is 10 times. */
109     int32_t pin2Times; /* The remaining number of PIN2, the maximum number of entries is 3 times. */
110 };
111 
112 struct ApduSimIORequestInfo {
113     int32_t serial;
114     int32_t channelId;
115     int32_t type;
116     int32_t instruction;
117     int32_t p1;
118     int32_t p2;
119     int32_t p3;
120     std::string data;
121 };
122 
123 struct SimAuthenticationRequestInfo {
124     int32_t serial;
125     std::string aid;
126     std::string authData;
127 };
128 
129 struct OpenLogicalChannelResponse {
130     int32_t sw1; /* information from the SIM about the execution of the actual command.
131                   * These parameters are delivered to the TE in both cases,
132                   * on successful or failed execution of the command */
133     int32_t sw2;
134     int32_t channelId;
135     std::string response;
136 };
137 
138 struct LockStatusResp {
139     int32_t result;
140     int32_t remain;
141 };
142 } // namespace Telephony
143 } // namespace OHOS
144 #endif // OHOS_RIL_SIM_PARCEL_H