• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 TELEPHONY_RADIO_UTILS_H
17 #define TELEPHONY_RADIO_UTILS_H
18 
19 #include <condition_variable>
20 #include <locale>
21 #include <mutex>
22 #include <string>
23 
24 #include "telephony_errors.h"
25 #include "telephony_napi_common_error.h"
26 #include "telephony_types.h"
27 
28 namespace OHOS {
29 namespace Telephony {
30     enum CJErrorCode {
31         /**
32          * The input parameter value is out of range.
33          */
34         CJ_ERROR_TELEPHONY_ARGUMENT_ERROR = 8300001,
35 
36         /**
37          * Operation failed. Cannot connect to service.
38          */
39         CJ_ERROR_TELEPHONY_SERVICE_ERROR = 8300002,
40 
41         /**
42          * System internal error.
43          */
44         CJ_ERROR_TELEPHONY_SYSTEM_ERROR = 8300003,
45 
46         /**
47          * Do not have sim card.
48          */
49         CJ_ERROR_TELEPHONY_NO_SIM_CARD = 8300004,
50 
51         /**
52          * Airplane mode is on.
53          */
54         CJ_ERROR_TELEPHONY_AIRPLANE_MODE_ON = 8300005,
55 
56         /**
57          * Network not in service.
58          */
59         CJ_ERROR_TELEPHONY_NETWORK_NOT_IN_SERVICE = 8300006,
60 
61         /**
62          * Unknown error code.
63          */
64         CJ_ERROR_TELEPHONY_UNKNOW_ERROR = 8300999,
65 
66         /**
67          * SIM card is not activated.
68          */
69         CJ_ERROR_SIM_CARD_IS_NOT_ACTIVE = 8301001,
70 
71         /**
72          * SIM card operation error.
73          */
74         CJ_ERROR_SIM_CARD_OPERATION_ERROR = 8301002,
75 
76         /**
77          * Operator config error.
78          */
79         CJ_ERROR_OPERATOR_CONFIG_ERROR = 8301003,
80 
81         /**
82          * Permission verification failed, usually the result returned by VerifyAccessToken.
83          */
84         CJ_ERROR_TELEPHONY_PERMISSION_DENIED = 201,
85 
86         /**
87          * Permission verification failed, application which is not a system application uses system API.
88          */
89         CJ_ERROR_ILLEGAL_USE_OF_SYSTEM_API = 202,
90     };
91 
92     struct CIccAccountInfo {
93         /**
94          * SIM Id for card
95          */
96         int32_t simId;
97         /**
98          * Slot index for card
99          */
100         int32_t slotIndex;
101         /**
102          * Mark card is eSim or not
103          */
104         bool isEsim;
105         /**
106          * Active status for card
107          */
108         bool isActive;
109         /**
110          * IccId for card
111          */
112         char* iccId;
113         /**
114          * Show name for card
115          */
116         char* showName;
117         /**
118          * Show number for card
119          */
120         char* showNumber;
121     };
122 
123     struct CArryIccAccountInfo {
124         CIccAccountInfo* head;
125         int64_t size;
126     };
127 }
128 }
129 
130 #endif