• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 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/*
17 * @addtogroup HdiAGnss
18 * @{
19 *
20 * @brief Provides unified APIs for the AGNSS service.
21 *
22 * The upper layer can use the interfaces provided by this module to set the AGNSS callback, AGNSS server address,
23 * AGNSS reference information, and setId.
24 *
25 * @since 3.2
26 */
27
28/*
29 * @file AGnssTypes.idl
30 *
31 * @brief Defines the data structure used by the AGNSS module.
32 *
33 * @since 3.2
34 * @version 1.0
35 */
36
37package ohos.hdi.location.agnss.v1_0;
38
39/*
40 * @brief Defines the AGNSS reference information type.
41 *
42 * @since 3.2
43 */
44enum AGnssRefInfoType {
45    ANSS_REF_INFO_TYPE_CELLID = 1,
46    ANSS_REF_INFO_TYPE_MAC = 2,
47};
48
49/*
50 * @brief Defines the protocol type of the AGNSS user plane.
51 *
52 * @since 3.2
53 */
54enum AGnssUserPlaneProtocol {
55    AGNSS_TYPE_SUPL         = 1,
56    AGNSS_TYPE_C2K          = 2,
57    AGNSS_TYPE_SUPL_IMS     = 3,
58    AGNSS_TYPE_SUPL_EIMS    = 4
59};
60
61/*
62 * @brief Defines the action type for operating data services.
63 *
64 * @since 3.2
65 */
66enum DataLinkSetUpType {
67    /* Request to establish a data connection. */
68    ESTABLISH_DATA_CONNECTION = 1,
69
70    /* Request to release a data connection. */
71    RELEASE_DATA_CONNECTION   = 2
72};
73
74/*
75 * @brief Defines the cell id type.
76 *
77 * @since 3.2
78 */
79enum CellIdType {
80    CELLID_TYPE_GSM   = 1,
81    CELLID_TYPE_UMTS  = 2,
82    CELLID_TYPE_LTE   = 3,
83    CELLID_TYPE_NR    = 4,
84};
85
86/*
87 * @brief Defines the setid type.
88 *
89 * @since 3.2
90 */
91enum SubscriberSetIdType {
92    SETID_TYPE_NONE    = 0,
93    SETID_TYPE_IMSI    = 1,
94    SETID_TYPE_MSISDM  = 2
95};
96
97/*
98 * @brief Defines the cell information structure in the AGNSS reference information.
99 *
100 * @since 3.2
101 */
102struct AGnssRefCellId {
103    enum CellIdType type;
104
105    /* Mobile Country Code. */
106    unsigned short mcc;
107
108    /* Mobile Network Code. */
109    unsigned short mnc;
110
111    /* Location Area Code in 2G, 3G and LTE. */
112    unsigned short lac;
113
114    /* Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */
115    unsigned int cid;
116
117    /* Tracking Area Code in LTE. */
118    unsigned short tac;
119
120    /* Physical Cell id in LTE. */
121    unsigned short pcid;
122
123    /* NR Cell ID */
124    unsigned int nci;
125};
126
127/*
128 * @brief Defines the AGNSS server information.
129 *
130 * @since 3.2
131 */
132struct AGnssServerInfo {
133    enum AGnssUserPlaneProtocol type;
134    String server;
135    int port;
136};
137
138/*
139 * @brief Defines the AGNSS setid information.
140 *
141 * @since 3.2
142 */
143struct SubscriberSetId {
144    enum SubscriberSetIdType type;
145    String id;
146};
147
148/*
149 * @brief Defines the AGNSS mac information.
150 *
151 * @since 3.2
152 */
153struct AGnssRefMac {
154    unsigned char[] mac;
155};
156
157/*
158 * @brief Defines the AGNSS reference information structure.
159 *
160 * @since 3.2
161 */
162struct AGnssRefInfo {
163    enum AGnssRefInfoType type;
164    struct AGnssRefCellId   cellId;
165    struct AGnssRefMac      mac;
166};
167
168/*
169 * @brief Defines the structure of the request for operating the data service.
170 *
171 * @since 3.2
172 */
173struct AGnssDataLinkRequest {
174    enum AGnssUserPlaneProtocol agnssType;
175    enum DataLinkSetUpType setUpType;
176};