1c5e268c6Sopenharmony_ci/*
2c5e268c6Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License.
5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at
6c5e268c6Sopenharmony_ci *
7c5e268c6Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c5e268c6Sopenharmony_ci *
9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and
13c5e268c6Sopenharmony_ci * limitations under the License.
14c5e268c6Sopenharmony_ci */
15c5e268c6Sopenharmony_ci
16c5e268c6Sopenharmony_ci/*
17c5e268c6Sopenharmony_ci * @addtogroup HdiGnss
18c5e268c6Sopenharmony_ci * @{
19c5e268c6Sopenharmony_ci *
20c5e268c6Sopenharmony_ci * @brief Provides unified APIs for GNSS services to access GNSS drivers.
21c5e268c6Sopenharmony_ci *
22c5e268c6Sopenharmony_ci * A GNSS service can obtain a GNSS driver object or agent and then call APIs provided by this object or agent to
23c5e268c6Sopenharmony_ci * access GNSS devices, thereby Start the GNSS chip, start the navigation,
24c5e268c6Sopenharmony_ci * set the GNSS working mode, inject reference information, obtain the positioning result, obtain the nmea,
25c5e268c6Sopenharmony_ci * obtain the satellite status information, and obtain the cache location information.
26c5e268c6Sopenharmony_ci *
27c5e268c6Sopenharmony_ci * @since 3.2
28c5e268c6Sopenharmony_ci */
29c5e268c6Sopenharmony_ci
30c5e268c6Sopenharmony_ci/*
31c5e268c6Sopenharmony_ci * @file IGnssInterface.idl
32c5e268c6Sopenharmony_ci *
33c5e268c6Sopenharmony_ci * @brief Declares the APIs provided by the GNSS module for Start the GNSS chip, start the navigation,
34c5e268c6Sopenharmony_ci * set the GNSS working mode, inject reference information, Delete auxiliary data, inject PGNSS data,
35c5e268c6Sopenharmony_ci * obtain the number of GNSS cache locations, and obtain all cache locations.
36c5e268c6Sopenharmony_ci *
37c5e268c6Sopenharmony_ci * @since 3.2
38c5e268c6Sopenharmony_ci * @version 1.0
39c5e268c6Sopenharmony_ci */
40c5e268c6Sopenharmony_ci
41c5e268c6Sopenharmony_cipackage ohos.hdi.location.gnss.v1_0;
42c5e268c6Sopenharmony_ci
43c5e268c6Sopenharmony_ciimport ohos.hdi.location.gnss.v1_0.IGnssCallback;
44c5e268c6Sopenharmony_ciimport ohos.hdi.location.gnss.v1_0.GnssTypes;
45c5e268c6Sopenharmony_ci
46c5e268c6Sopenharmony_ci/*
47c5e268c6Sopenharmony_ci * @brief Defines the functions for performing basic operations on GNSS.
48c5e268c6Sopenharmony_ci *
49c5e268c6Sopenharmony_ci * The functions include  Start the GNSS chip, start the navigation,
50c5e268c6Sopenharmony_ci * set the GNSS working mode, inject reference information, Delete auxiliary data, inject PGNSS data,
51c5e268c6Sopenharmony_ci * obtain the number of GNSS cache locations, and obtain all cache locations.
52c5e268c6Sopenharmony_ci *
53c5e268c6Sopenharmony_ci * @since 3.2
54c5e268c6Sopenharmony_ci */
55c5e268c6Sopenharmony_ciinterface IGnssInterface {
56c5e268c6Sopenharmony_ci    /*
57c5e268c6Sopenharmony_ci     * @brief Setting GNSS configuration parameters.
58c5e268c6Sopenharmony_ci     *
59c5e268c6Sopenharmony_ci     * @param para Indicates GNSS configuration parameters, including basic GNSS parameters and GNSS cache
60c5e268c6Sopenharmony_ci     * function configuration parameters. For details, see {@link GnssConfigPara}.
61c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> If the setting is successful; returns a negative value otherwise.
62c5e268c6Sopenharmony_ci     *
63c5e268c6Sopenharmony_ci     * @since 3.2
64c5e268c6Sopenharmony_ci     * @version 1.0
65c5e268c6Sopenharmony_ci     */
66c5e268c6Sopenharmony_ci    SetGnssConfigPara([in] struct GnssConfigPara para);
67c5e268c6Sopenharmony_ci
68c5e268c6Sopenharmony_ci    /*
69c5e268c6Sopenharmony_ci     * @brief Enable the GNSS module and transmit the callback of the upper layer to the GNSS module.
70c5e268c6Sopenharmony_ci     *
71c5e268c6Sopenharmony_ci     * @param callback Indicates Callback function sent by the upper layer to the GNSS driver. The GNSS driver returns
72c5e268c6Sopenharmony_ci     * location results and satellite status information by the callbacks. For details, see {@link IGnssCallback}.
73c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the GNSS is successfully enabled; returns a negative value otherwise.
74c5e268c6Sopenharmony_ci     *
75c5e268c6Sopenharmony_ci     * @since 3.2
76c5e268c6Sopenharmony_ci     * @version 1.0
77c5e268c6Sopenharmony_ci     */
78c5e268c6Sopenharmony_ci    EnableGnss([in] IGnssCallback callbackObj);
79c5e268c6Sopenharmony_ci
80c5e268c6Sopenharmony_ci    /*
81c5e268c6Sopenharmony_ci     * @brief Disable the GNSS module.
82c5e268c6Sopenharmony_ci     *
83c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the GNSS is successfully disabled; returns a negative value otherwise.
84c5e268c6Sopenharmony_ci     *
85c5e268c6Sopenharmony_ci     * @since 3.2
86c5e268c6Sopenharmony_ci     * @version 1.0
87c5e268c6Sopenharmony_ci     */
88c5e268c6Sopenharmony_ci    DisableGnss();
89c5e268c6Sopenharmony_ci
90c5e268c6Sopenharmony_ci    /*
91c5e268c6Sopenharmony_ci     * @brief Start the navigation function.
92c5e268c6Sopenharmony_ci     *
93c5e268c6Sopenharmony_ci     * @param type Indicates the GNSS startup type, which is used to distinguish between common GNSS positioning
94c5e268c6Sopenharmony_ci     * and GNSS caching function. For details, see {@link GnssStartType}.
95c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the GNSS navigation is successfully started; returns a negative value otherwise.
96c5e268c6Sopenharmony_ci     *
97c5e268c6Sopenharmony_ci     * @since 3.2
98c5e268c6Sopenharmony_ci     * @version 1.0
99c5e268c6Sopenharmony_ci     */
100c5e268c6Sopenharmony_ci    StartGnss([in] enum GnssStartType type);
101c5e268c6Sopenharmony_ci
102c5e268c6Sopenharmony_ci    /*
103c5e268c6Sopenharmony_ci     * @brief Stop the navigation function.
104c5e268c6Sopenharmony_ci     *
105c5e268c6Sopenharmony_ci     * @param type Indicates the GNSS startup type, which is used to distinguish between common GNSS positioning
106c5e268c6Sopenharmony_ci     * and GNSS caching function. For details, see {@link GnssStartType}.
107c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if the GNSS navigation is successfully stopped; returns a negative value otherwise.
108c5e268c6Sopenharmony_ci     *
109c5e268c6Sopenharmony_ci     * @since 3.2
110c5e268c6Sopenharmony_ci     * @version 1.0
111c5e268c6Sopenharmony_ci     */
112c5e268c6Sopenharmony_ci    StopGnss([in] enum GnssStartType type);
113c5e268c6Sopenharmony_ci
114c5e268c6Sopenharmony_ci    /*
115c5e268c6Sopenharmony_ci     * @brief Inject reference information to the GNSS module.
116c5e268c6Sopenharmony_ci     *
117c5e268c6Sopenharmony_ci     * @param refInfo Indicates the GNSS reference information structure, including the reference time and reference
118c5e268c6Sopenharmony_ci     * location. For details, see {@link GnssRefInfo}.
119c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if ingestion succeeded; returns a negative value otherwise.
120c5e268c6Sopenharmony_ci     *
121c5e268c6Sopenharmony_ci     * @since 3.2
122c5e268c6Sopenharmony_ci     * @version 1.0
123c5e268c6Sopenharmony_ci     */
124c5e268c6Sopenharmony_ci    SetGnssReferenceInfo([in] struct GnssRefInfo refInfo);
125c5e268c6Sopenharmony_ci
126c5e268c6Sopenharmony_ci    /*
127c5e268c6Sopenharmony_ci     * @brief Delete the specified auxiliary data.
128c5e268c6Sopenharmony_ci     *
129c5e268c6Sopenharmony_ci     * @param data Indicates the type of auxiliary data to be deleted. For details, see {@link GnssAuxiliaryData}.
130c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if deleted successfully; returns a negative value otherwise.
131c5e268c6Sopenharmony_ci     *
132c5e268c6Sopenharmony_ci     * @since 3.2
133c5e268c6Sopenharmony_ci     * @version 1.0
134c5e268c6Sopenharmony_ci     */
135c5e268c6Sopenharmony_ci    DeleteAuxiliaryData([in] enum GnssAuxiliaryData data);
136c5e268c6Sopenharmony_ci
137c5e268c6Sopenharmony_ci    /*
138c5e268c6Sopenharmony_ci     * @brief Ingesting Predict Gnss Data.
139c5e268c6Sopenharmony_ci     *
140c5e268c6Sopenharmony_ci     * @param data Indicates Predict Gnss Data.
141c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if ingesting successfully; returns a negative value otherwise.
142c5e268c6Sopenharmony_ci     *
143c5e268c6Sopenharmony_ci     * @since 3.2
144c5e268c6Sopenharmony_ci     * @version 1.0
145c5e268c6Sopenharmony_ci     */
146c5e268c6Sopenharmony_ci    SetPredictGnssData([in] String data);
147c5e268c6Sopenharmony_ci
148c5e268c6Sopenharmony_ci    /*
149c5e268c6Sopenharmony_ci     * @brief Obtain the number of locations that can be cached by the GNSS module.
150c5e268c6Sopenharmony_ci     *
151c5e268c6Sopenharmony_ci     * @param size Indicates an output parameter used to receive the number of locations that can be
152c5e268c6Sopenharmony_ci     * cached by the GNSS module.
153c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if obtain size successfully; returns a negative value otherwise.
154c5e268c6Sopenharmony_ci     *
155c5e268c6Sopenharmony_ci     * @since 3.2
156c5e268c6Sopenharmony_ci     * @version 1.0
157c5e268c6Sopenharmony_ci     */
158c5e268c6Sopenharmony_ci    GetCachedGnssLocationsSize([out] int size);
159c5e268c6Sopenharmony_ci
160c5e268c6Sopenharmony_ci    /*
161c5e268c6Sopenharmony_ci     * @brief Request to obtain all the location information in the GNSS cache at a time and clear the cache buffer.
162c5e268c6Sopenharmony_ci     * The cache location is reported through callback.
163c5e268c6Sopenharmony_ci     *
164c5e268c6Sopenharmony_ci     * @return Returns <b>0</b> if sending request successfully; returns a negative value otherwise.
165c5e268c6Sopenharmony_ci     *
166c5e268c6Sopenharmony_ci     * @since 3.2
167c5e268c6Sopenharmony_ci     * @version 1.0
168c5e268c6Sopenharmony_ci     */
169c5e268c6Sopenharmony_ci    GetCachedGnssLocations();
170c5e268c6Sopenharmony_ci}