blob: fad83d2bd0d2bcad14aadfee2c35a6b77d16d365 [file] [log] [blame]
Hridya Valsarajue596a712016-09-22 14:07:22 -07001/*
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 IGnssMeasurementCallback;
20
Andreas Huber40d3a9b2017-03-28 16:19:16 -070021/**
Hridya Valsarajue596a712016-09-22 14:07:22 -070022 * Extended interface for GNSS Measurements support.
23 */
24interface IGnssMeasurement {
Hridya Valsaraju529331c2016-11-22 08:17:23 -080025 @export(name="", value_prefix="GPS_MEASUREMENT_")
Hridya Valsarajue596a712016-09-22 14:07:22 -070026 enum GnssMeasurementStatus : int32_t {
27 SUCCESS = 0,
28 ERROR_ALREADY_INIT = -100,
29 ERROR_GENERIC = -101
30 };
31
Andreas Huber40d3a9b2017-03-28 16:19:16 -070032 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070033 * 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 at
35 * an average output rate of 1Hz (occasional
36 * intra-measurement time offsets in the range from 0-2000msec can be
37 * tolerated.)
38 *
39 * @param callback Handle to GnssMeasurement callback interface.
40 *
41 * @return initRet Returns SUCCESS if successful.
42 * Returns ERROR_ALREADY_INIT if a callback has already been
43 * registered without a corresponding call to 'close'.
44 * Returns ERROR_GENERIC for any other error. The HAL must
45 * not generate any other updates upon returning this error code.
46 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070047 setCallback(IGnssMeasurementCallback callback) generates (GnssMeasurementStatus initRet);
Hridya Valsarajue596a712016-09-22 14:07:22 -070048
Andreas Huber40d3a9b2017-03-28 16:19:16 -070049 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070050 * Stops updates from the HAL, and unregisters the callback routines.
51 * After a call to close(), the previously registered callbacks must be
52 * considered invalid by the HAL.
53 * If close() is invoked without a previous setCallback, this function must perform
54 * no work.
55 */
56 close();
57
58};