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 CELLULAR_DATA_TYPES_H
17 #define CELLULAR_DATA_TYPES_H
18 
19 #include <cstdint>
20 
21 namespace OHOS {
22 namespace Telephony {
23 enum class DataConnectionStatus : int32_t {
24     DATA_STATE_DISCONNECTED = 11,
25     DATA_STATE_CONNECTING = 12,
26     DATA_STATE_CONNECTED = 13,
27     DATA_STATE_SUSPENDED = 14
28 };
29 
30 enum class CellDataFlowType : int32_t {
31     DATA_FLOW_TYPE_NONE = 0,
32     DATA_FLOW_TYPE_DOWN = 1,
33     DATA_FLOW_TYPE_UP = 2,
34     DATA_FLOW_TYPE_UP_DOWN = 3,
35     DATA_FLOW_TYPE_DORMANT = 4
36 };
37 
38 enum class DataSwitchCode : int32_t {
39     CELLULAR_DATA_DISABLED = 0,
40     CELLULAR_DATA_ENABLED = 1
41 };
42 
43 enum class IntelligenceSwitchCode : int32_t {
44     INTELLIGENCE_SWITCH_DISABLED = 0,
45     INTELLIGENCE_SWITCH_ENABLED = 1
46 };
47 
48 enum class RoamingSwitchCode : int32_t {
49     CELLULAR_DATA_ROAMING_DISABLED = 0,
50     CELLULAR_DATA_ROAMING_ENABLED = 1
51 };
52 
53 enum class DataRespondCode : int32_t {
54     SET_FAILED = 0,
55     SET_SUCCESS = 1
56 };
57 
58 enum class RequestNetCode : int32_t {
59     REQUEST_FAILED = 0,
60     REQUEST_SUCCESS = 1
61 };
62 
63 enum class DataConnectState : int32_t {
64     /**
65      * Indicates that a cellular data link is unknown.
66      */
67     DATA_STATE_UNKNOWN = -1,
68 
69     /**
70      * Indicates that a cellular data link is disconnected.
71      */
72     DATA_STATE_DISCONNECTED = 0,
73 
74     /**
75      * Indicates that a cellular data link is being connected.
76      */
77     DATA_STATE_CONNECTING = 1,
78 
79     /**
80      * Indicates that a cellular data link is connected.
81      */
82     DATA_STATE_CONNECTED = 2,
83 
84     /**
85      * Indicates that a cellular data link is suspended.
86      */
87     DATA_STATE_SUSPENDED = 3
88 };
89 } // namespace Telephony
90 } // namespace OHOS
91 #endif // CELLULAR_DATA_TYPES_H