1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.gnss@1.0;
18
19import IGnssNavigationMessageCallback;
20
21/**
22 * Extended interface for GNSS navigation message reporting support.
23 */
24interface IGnssNavigationMessage {
25    @export(name="", value_prefix="GPS_NAVIGATION_MESSAGE_")
26    enum GnssNavigationMessageStatus : int32_t {
27        SUCCESS = 0,
28        ERROR_ALREADY_INIT = -100,
29        ERROR_GENERIC = -101
30    };
31
32    /**
33     * Initializes the interface and registers the callback routines with the HAL.
34     * After a successful call to 'setCallback' the HAL must begin to provide updates as
35     * they become available.
36     * @param callback handle to IGnssNavigationMessageCallack interface.
37     *
38     * @return initRet Returns SUCCESS if the operation
39     * is successful.
40     * Returns ERROR_ALREADY_INIT if a callback has
41     * already been registered without a corresponding call to close().
42     * Returns ERROR_GENERIC if any other error occurred. It is
43     * expected that the HAL will not generate any updates upon returning
44     * this error code.
45     */
46     setCallback(IGnssNavigationMessageCallback callback) generates (GnssNavigationMessageStatus initRet);
47
48    /**
49     * Stops updates from the HAL, and unregisters the callback routines.
50     * After a call to close(), the previously registered callbacks must be
51     * considered invalid by the HAL.
52     * If close() is invoked without a previous setCallback, this function must perform
53     * no work.
54     */
55    close();
56};
57