1/*
2 * Copyright (c) 2024 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 HdiGnss
18 * @{
19 *
20 * @brief Provides unified APIs for GNSS services to access GNSS drivers.
21 *
22 * A GNSS service can obtain a GNSS driver object or agent and then call APIs provided by this object or agent to
23 * access GNSS devices, thereby Start the GNSS chip, start the navigation,
24 * set the GNSS working mode, inject reference information, obtain the positioning result, obtain the nmea,
25 * obtain the satellite status information, and obtain the cache location information.
26 *
27 * @since 5.0
28 */
29
30/*
31 * @file IGnssCallback.idl
32 *
33 * @brief Declares the callbacks for obtain the positioning result, obtain the working status of the GNSS module,
34 * obtain the nmea, obtain GNSS capability, obtain the satellite status information, and obtain the cache location,
35 * and request upper-layer ingest reference information, Request upper-layer to inject PGNSS data.
36 *
37 * @since 5.0
38 * @version 2.0
39 */
40
41package ohos.hdi.location.gnss.v2_0;
42
43import ohos.hdi.location.gnss.v2_0.GnssTypes;
44
45/*
46 * @brief Defines the callbacks for obtain the positioning result, obtain the working status of the GNSS module,
47 * obtain the nmea, obtain GNSS capability, obtain the satellite status information, and obtain the cache location,
48 * and request upper-layer ingest reference information, Request upper-layer to inject PGNSS data.
49 *
50 * @since 5.0
51 */
52[callback] interface IGnssCallback {
53    /*
54     * @brief Location reporting.
55     *
56     * @param location Indicates GNSS location result. For details, see {@link Location}.
57     * @return Returns <b>0</b> If the location reporting is successful; returns a negative value otherwise.
58     *
59     * @since 5.0
60     * @version 2.0
61     */
62    ReportLocation([in] struct LocationInfo location);
63
64    /*
65     * @brief Reporting the working status of the GNSS module.
66     *
67     * @param status Indicates the working status of the GNSS module. For details, see {@link GnssWorkingStatus}.
68     * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise.
69     *
70     * @since 5.0
71     * @version 2.0
72     */
73    ReportGnssWorkingStatus([in] enum GnssWorkingStatus status);
74
75    /*
76     * @brief Reporting NMEA.
77     *
78     * @param timestamp Indicates the timestamp when the NMEA is reported. Milliseconds since January 1, 1970.
79     * @param nmea Indicates NMEA sentences, follows standard NMEA 0183.
80     * @param length Indicates length of NMEA sentences.
81     * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise.
82     *
83     * @since 5.0
84     * @version 2.0
85     */
86    ReportNmea([in] long timestamp, [in] String nmea, [in] int length);
87
88    /*
89     * @brief GNSS capability reporting.
90     *
91     * @param capabilities Indicates the GNSS capability. For details, see {@link GnssCapabilities}.
92     * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise.
93     *
94     * @since 5.0
95     * @version 2.0
96     */
97    ReportGnssCapabilities([in] unsigned int capabilities);
98
99    /*
100     * @brief Satellite status information reporting.
101     *
102     * @param info Indicates the satellite status information structure reported by the GNSS chip.
103     * For details, see {@link SatelliteStatusInfo}.
104     * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise.
105     *
106     * @since 5.0
107     * @version 2.0
108     */
109    ReportSatelliteStatusInfo([in] struct SatelliteStatusInfo info);
110
111    /*
112     * @brief Request upper-layer ingest reference information.
113     *
114     * @param type Indicates the GNSS reference information type. For details, see {@link GnssRefInfoType}.
115     * @return Returns <b>0</b> If sending request is successful; returns a negative value otherwise.
116     *
117     * @since 5.0
118     * @version 2.0
119     */
120    RequestGnssReferenceInfo([in] enum GnssRefInfoType type);
121
122    /*
123     * @brief Request upper-layer to inject PGNSS data.
124     *
125     * @return Returns <b>0</b> If sending request is successful; returns a negative value otherwise.
126     *
127     * @since 5.0
128     * @version 2.0
129     */
130    RequestPredictGnssData();
131
132    /*
133     * @brief Report all location information cached by the bottom-layer GNSS module to the upper layer.
134     *
135     * @param gnssLocations Indicates all locations of the GNSS chip cache. For details, see {@link Location}.
136     * @return Returns <b>0</b> If the reporting is successful; returns a negative value otherwise.
137     *
138     * @since 5.0
139     * @version 2.0
140     */
141    ReportCachedLocation([in] struct LocationInfo[] gnssLocations);
142
143    /*
144     * @brief Report GNSS Ni notification.
145     *
146     * @param notification Indicates the GNSS Ni notification.
147     * @return Returns <b>0</b> if reporting is successfully; returns a negative value otherwise.
148     *
149     * @since 5.0
150     * @version 2.0
151     */
152     ReportGnssNiNotification([in] struct GnssNiNotificationRequest notification);
153}
154/** @} */