1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2024 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 5.0 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 5.0 38c5e268c6Sopenharmony_ci * @version 2.0 39c5e268c6Sopenharmony_ci */ 40c5e268c6Sopenharmony_ci 41c5e268c6Sopenharmony_cipackage ohos.hdi.location.gnss.v2_0; 42c5e268c6Sopenharmony_ci 43c5e268c6Sopenharmony_ciimport ohos.hdi.location.gnss.v2_0.IGnssCallback; 44c5e268c6Sopenharmony_ciimport ohos.hdi.location.gnss.v2_0.GnssTypes; 45c5e268c6Sopenharmony_ciimport ohos.hdi.location.gnss.v2_0.IGnssMeasurementCallback; 46c5e268c6Sopenharmony_ci 47c5e268c6Sopenharmony_ci/* 48c5e268c6Sopenharmony_ci * @brief Defines the functions for performing basic operations on GNSS. 49c5e268c6Sopenharmony_ci * 50c5e268c6Sopenharmony_ci * The functions include Start the GNSS chip, start the navigation, 51c5e268c6Sopenharmony_ci * set the GNSS working mode, inject reference information, Delete auxiliary data, inject PGNSS data, 52c5e268c6Sopenharmony_ci * obtain the number of GNSS cache locations, and obtain all cache locations. 53c5e268c6Sopenharmony_ci * 54c5e268c6Sopenharmony_ci * @since 5.0 55c5e268c6Sopenharmony_ci */ 56c5e268c6Sopenharmony_ciinterface IGnssInterface { 57c5e268c6Sopenharmony_ci /* 58c5e268c6Sopenharmony_ci * @brief Setting GNSS configuration parameters. 59c5e268c6Sopenharmony_ci * 60c5e268c6Sopenharmony_ci * @param para Indicates GNSS configuration parameters, including basic GNSS parameters and GNSS cache 61c5e268c6Sopenharmony_ci * function configuration parameters. For details, see {@link GnssConfigPara}. 62c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If the setting is successful; returns a negative value otherwise. 63c5e268c6Sopenharmony_ci * 64c5e268c6Sopenharmony_ci * @since 5.0 65c5e268c6Sopenharmony_ci * @version 2.0 66c5e268c6Sopenharmony_ci */ 67c5e268c6Sopenharmony_ci SetGnssConfigPara([in] struct GnssConfigPara para); 68c5e268c6Sopenharmony_ci 69c5e268c6Sopenharmony_ci /* 70c5e268c6Sopenharmony_ci * @brief Enable the GNSS module and transmit the callback of the upper layer to the GNSS module. 71c5e268c6Sopenharmony_ci * 72c5e268c6Sopenharmony_ci * @param callback Indicates Callback function sent by the upper layer to the GNSS driver. The GNSS driver returns 73c5e268c6Sopenharmony_ci * location results and satellite status information by the callbacks. For details, see {@link IGnssCallback}. 74c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the GNSS is successfully enabled; returns a negative value otherwise. 75c5e268c6Sopenharmony_ci * 76c5e268c6Sopenharmony_ci * @since 5.0 77c5e268c6Sopenharmony_ci * @version 2.0 78c5e268c6Sopenharmony_ci */ 79c5e268c6Sopenharmony_ci EnableGnss([in] IGnssCallback callbackObj); 80c5e268c6Sopenharmony_ci 81c5e268c6Sopenharmony_ci /* 82c5e268c6Sopenharmony_ci * @brief Disable the GNSS module. 83c5e268c6Sopenharmony_ci * 84c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the GNSS is successfully disabled; returns a negative value otherwise. 85c5e268c6Sopenharmony_ci * 86c5e268c6Sopenharmony_ci * @since 5.0 87c5e268c6Sopenharmony_ci * @version 2.0 88c5e268c6Sopenharmony_ci */ 89c5e268c6Sopenharmony_ci DisableGnss(); 90c5e268c6Sopenharmony_ci 91c5e268c6Sopenharmony_ci /* 92c5e268c6Sopenharmony_ci * @brief Start the navigation function. 93c5e268c6Sopenharmony_ci * 94c5e268c6Sopenharmony_ci * @param type Indicates the GNSS startup type, which is used to distinguish between common GNSS positioning 95c5e268c6Sopenharmony_ci * and GNSS caching function. For details, see {@link GnssStartType}. 96c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the GNSS navigation is successfully started; returns a negative value otherwise. 97c5e268c6Sopenharmony_ci * 98c5e268c6Sopenharmony_ci * @since 5.0 99c5e268c6Sopenharmony_ci * @version 2.0 100c5e268c6Sopenharmony_ci */ 101c5e268c6Sopenharmony_ci StartGnss([in] enum GnssStartType type); 102c5e268c6Sopenharmony_ci 103c5e268c6Sopenharmony_ci /* 104c5e268c6Sopenharmony_ci * @brief Stop the navigation function. 105c5e268c6Sopenharmony_ci * 106c5e268c6Sopenharmony_ci * @param type Indicates the GNSS startup type, which is used to distinguish between common GNSS positioning 107c5e268c6Sopenharmony_ci * and GNSS caching function. For details, see {@link GnssStartType}. 108c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the GNSS navigation is successfully stopped; returns a negative value otherwise. 109c5e268c6Sopenharmony_ci * 110c5e268c6Sopenharmony_ci * @since 5.0 111c5e268c6Sopenharmony_ci * @version 2.0 112c5e268c6Sopenharmony_ci */ 113c5e268c6Sopenharmony_ci StopGnss([in] enum GnssStartType type); 114c5e268c6Sopenharmony_ci 115c5e268c6Sopenharmony_ci /* 116c5e268c6Sopenharmony_ci * @brief Inject reference information to the GNSS module. 117c5e268c6Sopenharmony_ci * 118c5e268c6Sopenharmony_ci * @param refInfo Indicates the GNSS reference information structure, including the reference time and reference 119c5e268c6Sopenharmony_ci * location. For details, see {@link GnssRefInfo}. 120c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if ingestion succeeded; returns a negative value otherwise. 121c5e268c6Sopenharmony_ci * 122c5e268c6Sopenharmony_ci * @since 5.0 123c5e268c6Sopenharmony_ci * @version 2.0 124c5e268c6Sopenharmony_ci */ 125c5e268c6Sopenharmony_ci SetGnssReferenceInfo([in] struct GnssRefInfo refInfo); 126c5e268c6Sopenharmony_ci 127c5e268c6Sopenharmony_ci /* 128c5e268c6Sopenharmony_ci * @brief Delete the specified auxiliary data. 129c5e268c6Sopenharmony_ci * 130c5e268c6Sopenharmony_ci * @param data Indicates the type of auxiliary data to be deleted. For details, see {@link GnssAuxiliaryDataType}. 131c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if deleted successfully; returns a negative value otherwise. 132c5e268c6Sopenharmony_ci * 133c5e268c6Sopenharmony_ci * @since 5.0 134c5e268c6Sopenharmony_ci * @version 2.0 135c5e268c6Sopenharmony_ci */ 136c5e268c6Sopenharmony_ci DeleteAuxiliaryData([in] unsigned short data); 137c5e268c6Sopenharmony_ci 138c5e268c6Sopenharmony_ci /* 139c5e268c6Sopenharmony_ci * @brief Ingesting Predict Gnss Data. 140c5e268c6Sopenharmony_ci * 141c5e268c6Sopenharmony_ci * @param data Indicates Predict Gnss Data. 142c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if ingesting successfully; returns a negative value otherwise. 143c5e268c6Sopenharmony_ci * 144c5e268c6Sopenharmony_ci * @since 5.0 145c5e268c6Sopenharmony_ci * @version 2.0 146c5e268c6Sopenharmony_ci */ 147c5e268c6Sopenharmony_ci SetPredictGnssData([in] String data); 148c5e268c6Sopenharmony_ci 149c5e268c6Sopenharmony_ci /* 150c5e268c6Sopenharmony_ci * @brief Obtain the number of locations that can be cached by the GNSS module. 151c5e268c6Sopenharmony_ci * 152c5e268c6Sopenharmony_ci * @param size Indicates an output parameter used to receive the number of locations that can be 153c5e268c6Sopenharmony_ci * cached by the GNSS module. 154c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if obtain size successfully; returns a negative value otherwise. 155c5e268c6Sopenharmony_ci * 156c5e268c6Sopenharmony_ci * @since 5.0 157c5e268c6Sopenharmony_ci * @version 2.0 158c5e268c6Sopenharmony_ci */ 159c5e268c6Sopenharmony_ci GetCachedGnssLocationsSize([out] int size); 160c5e268c6Sopenharmony_ci 161c5e268c6Sopenharmony_ci /* 162c5e268c6Sopenharmony_ci * @brief Request to obtain all the location information in the GNSS cache at a time and clear the cache buffer. 163c5e268c6Sopenharmony_ci * The cache location is reported through callback. 164c5e268c6Sopenharmony_ci * 165c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if sending request successfully; returns a negative value otherwise. 166c5e268c6Sopenharmony_ci * @since 5.0 167c5e268c6Sopenharmony_ci * @version 2.0 168c5e268c6Sopenharmony_ci */ 169c5e268c6Sopenharmony_ci GetCachedGnssLocations(); 170c5e268c6Sopenharmony_ci 171c5e268c6Sopenharmony_ci /* 172c5e268c6Sopenharmony_ci * @brief Send NI user response command. 173c5e268c6Sopenharmony_ci * 174c5e268c6Sopenharmony_ci * @param gnssNiNotificationId Indicates the id of GNSS NI notifications. 175c5e268c6Sopenharmony_ci * @param userResponse Indicates user reponse command. 176c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if sending response successfully; returns a negative value otherwise. 177c5e268c6Sopenharmony_ci * 178c5e268c6Sopenharmony_ci * @since 5.0 179c5e268c6Sopenharmony_ci * @version 2.0 180c5e268c6Sopenharmony_ci */ 181c5e268c6Sopenharmony_ci SendNiUserResponse([in] int gnssNiNotificationId, [in] enum GnssNiResponseCmd userResponse); 182c5e268c6Sopenharmony_ci 183c5e268c6Sopenharmony_ci /* 184c5e268c6Sopenharmony_ci * @brief Send network initiated message. 185c5e268c6Sopenharmony_ci * 186c5e268c6Sopenharmony_ci * @param msg Indicates the network initiated message. 187c5e268c6Sopenharmony_ci * @param length Indicates length of network initiated message. 188c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if sending message successfully; returns a negative value otherwise. 189c5e268c6Sopenharmony_ci * 190c5e268c6Sopenharmony_ci * @since 5.0 191c5e268c6Sopenharmony_ci * @version 2.0 192c5e268c6Sopenharmony_ci */ 193c5e268c6Sopenharmony_ci SendNetworkInitiatedMsg([in] String msg, [in] int length); 194c5e268c6Sopenharmony_ci 195c5e268c6Sopenharmony_ci /* 196c5e268c6Sopenharmony_ci * @brief Enable GNSS measurement and listen to measurement information. 197c5e268c6Sopenharmony_ci * 198c5e268c6Sopenharmony_ci * @param callbackObj Indicates callback for reporting GNSS Measurement information. 199c5e268c6Sopenharmony_ci * For details, see {@link IGnssMeasurementCallback}. 200c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the GNSS Measurement is successfully enabled; returns a negative value otherwise. 201c5e268c6Sopenharmony_ci * 202c5e268c6Sopenharmony_ci * @since 5.0 203c5e268c6Sopenharmony_ci * @version 1.0 204c5e268c6Sopenharmony_ci */ 205c5e268c6Sopenharmony_ci EnableGnssMeasurement([in] IGnssMeasurementCallback callbackObj); 206c5e268c6Sopenharmony_ci 207c5e268c6Sopenharmony_ci /* 208c5e268c6Sopenharmony_ci * @brief Disable GNSS measurement reporting. 209c5e268c6Sopenharmony_ci * 210c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the GNSS Measurement is successfully disabled; returns a negative value otherwise. 211c5e268c6Sopenharmony_ci * 212c5e268c6Sopenharmony_ci * @since 5.0 213c5e268c6Sopenharmony_ci * @version 1.0 214c5e268c6Sopenharmony_ci */ 215c5e268c6Sopenharmony_ci DisableGnssMeasurement(); 216c5e268c6Sopenharmony_ci} 217c5e268c6Sopenharmony_ci/** @} */