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 IGnssCallback.idl 32c5e268c6Sopenharmony_ci * 33c5e268c6Sopenharmony_ci * @brief Declares the callbacks for obtain the positioning result, obtain the working status of the GNSS module, 34c5e268c6Sopenharmony_ci * obtain the nmea, obtain GNSS capability, obtain the satellite status information, and obtain the cache location, 35c5e268c6Sopenharmony_ci * and request upper-layer ingest reference information, Request upper-layer to inject PGNSS data. 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.GnssTypes; 44c5e268c6Sopenharmony_ci 45c5e268c6Sopenharmony_ci/* 46c5e268c6Sopenharmony_ci * @brief Defines the callbacks for obtain the positioning result, obtain the working status of the GNSS module, 47c5e268c6Sopenharmony_ci * obtain the nmea, obtain GNSS capability, obtain the satellite status information, and obtain the cache location, 48c5e268c6Sopenharmony_ci * and request upper-layer ingest reference information, Request upper-layer to inject PGNSS data. 49c5e268c6Sopenharmony_ci * 50c5e268c6Sopenharmony_ci * @since 3.2 51c5e268c6Sopenharmony_ci */ 52c5e268c6Sopenharmony_ci[callback] interface IGnssCallback { 53c5e268c6Sopenharmony_ci /* 54c5e268c6Sopenharmony_ci * @brief Location reporting. 55c5e268c6Sopenharmony_ci * 56c5e268c6Sopenharmony_ci * @param location Indicates GNSS location result. For details, see {@link Location}. 57c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If the location reporting is successful; returns a negative value otherwise. 58c5e268c6Sopenharmony_ci * 59c5e268c6Sopenharmony_ci * @since 3.2 60c5e268c6Sopenharmony_ci * @version 1.0 61c5e268c6Sopenharmony_ci */ 62c5e268c6Sopenharmony_ci ReportLocation([in] struct LocationInfo location); 63c5e268c6Sopenharmony_ci 64c5e268c6Sopenharmony_ci /* 65c5e268c6Sopenharmony_ci * @brief Reporting the working status of the GNSS module. 66c5e268c6Sopenharmony_ci * 67c5e268c6Sopenharmony_ci * @param status Indicates the working status of the GNSS module. For details, see {@link GnssWorkingStatus}. 68c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise. 69c5e268c6Sopenharmony_ci * 70c5e268c6Sopenharmony_ci * @since 3.2 71c5e268c6Sopenharmony_ci * @version 1.0 72c5e268c6Sopenharmony_ci */ 73c5e268c6Sopenharmony_ci ReportGnssWorkingStatus([in] enum GnssWorkingStatus status); 74c5e268c6Sopenharmony_ci 75c5e268c6Sopenharmony_ci /* 76c5e268c6Sopenharmony_ci * @brief Reporting NMEA. 77c5e268c6Sopenharmony_ci * 78c5e268c6Sopenharmony_ci * @param timestamp Indicates the timestamp when the NMEA is reported. Milliseconds since January 1, 1970. 79c5e268c6Sopenharmony_ci * @param nmea Indicates NMEA sentences, follows standard NMEA 0183. 80c5e268c6Sopenharmony_ci * @param length Indicates length of NMEA sentences. 81c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise. 82c5e268c6Sopenharmony_ci * 83c5e268c6Sopenharmony_ci * @since 3.2 84c5e268c6Sopenharmony_ci * @version 1.0 85c5e268c6Sopenharmony_ci */ 86c5e268c6Sopenharmony_ci ReportNmea([in] long timestamp, [in] String nmea, [in] int length); 87c5e268c6Sopenharmony_ci 88c5e268c6Sopenharmony_ci /* 89c5e268c6Sopenharmony_ci * @brief GNSS capability reporting. 90c5e268c6Sopenharmony_ci * 91c5e268c6Sopenharmony_ci * @param capabilities Indicates the GNSS capability. For details, see {@link GnssCapabilities}. 92c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise. 93c5e268c6Sopenharmony_ci * 94c5e268c6Sopenharmony_ci * @since 3.2 95c5e268c6Sopenharmony_ci * @version 1.0 96c5e268c6Sopenharmony_ci */ 97c5e268c6Sopenharmony_ci ReportGnssCapabilities([in] enum GnssCapabilities capabilities); 98c5e268c6Sopenharmony_ci 99c5e268c6Sopenharmony_ci /* 100c5e268c6Sopenharmony_ci * @brief Satellite status information reporting. 101c5e268c6Sopenharmony_ci * 102c5e268c6Sopenharmony_ci * @param info Indicates the satellite status information structure reported by the GNSS chip. 103c5e268c6Sopenharmony_ci * For details, see {@link SatelliteStatusInfo}. 104c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise. 105c5e268c6Sopenharmony_ci * 106c5e268c6Sopenharmony_ci * @since 3.2 107c5e268c6Sopenharmony_ci * @version 1.0 108c5e268c6Sopenharmony_ci */ 109c5e268c6Sopenharmony_ci ReportSatelliteStatusInfo([in] struct SatelliteStatusInfo info); 110c5e268c6Sopenharmony_ci 111c5e268c6Sopenharmony_ci /* 112c5e268c6Sopenharmony_ci * @brief Request upper-layer ingest reference information. 113c5e268c6Sopenharmony_ci * 114c5e268c6Sopenharmony_ci * @param type Indicates the GNSS reference information type. For details, see {@link GnssRefInfoType}. 115c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If sending request is successful; returns a negative value otherwise. 116c5e268c6Sopenharmony_ci * 117c5e268c6Sopenharmony_ci * @since 3.2 118c5e268c6Sopenharmony_ci * @version 1.0 119c5e268c6Sopenharmony_ci */ 120c5e268c6Sopenharmony_ci RequestGnssReferenceInfo([in] enum GnssRefInfoType type); 121c5e268c6Sopenharmony_ci 122c5e268c6Sopenharmony_ci /* 123c5e268c6Sopenharmony_ci * @brief Request upper-layer to inject PGNSS data. 124c5e268c6Sopenharmony_ci * 125c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If sending request is successful; returns a negative value otherwise. 126c5e268c6Sopenharmony_ci * 127c5e268c6Sopenharmony_ci * @since 3.2 128c5e268c6Sopenharmony_ci * @version 1.0 129c5e268c6Sopenharmony_ci */ 130c5e268c6Sopenharmony_ci RequestPredictGnssData(); 131c5e268c6Sopenharmony_ci 132c5e268c6Sopenharmony_ci /* 133c5e268c6Sopenharmony_ci * @brief Report all location information cached by the bottom-layer GNSS module to the upper layer. 134c5e268c6Sopenharmony_ci * 135c5e268c6Sopenharmony_ci * @param gnssLocations Indicates all locations of the GNSS chip cache. For details, see {@link Location}. 136c5e268c6Sopenharmony_ci * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise. 137c5e268c6Sopenharmony_ci * 138c5e268c6Sopenharmony_ci * @since 3.2 139c5e268c6Sopenharmony_ci * @version 1.0 140c5e268c6Sopenharmony_ci */ 141c5e268c6Sopenharmony_ci ReportCachedLocation([in] struct LocationInfo[] gnssLocations); 142c5e268c6Sopenharmony_ci}