blob: 5156b3279b71ec4890709e2eac257e4ba9d4800e [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
21/*
22 * Extended interface for GNSS Measurements support.
23 */
24interface IGnssMeasurement {
25 enum GnssMeasurementStatus : int32_t {
26 SUCCESS = 0,
27 ERROR_ALREADY_INIT = -100,
28 ERROR_GENERIC = -101
29 };
30
31 /*
32 * Initializes the interface and registers the callback routines with the HAL.
33 * After a successful call to 'setCallback' the HAL must begin to provide updates at
34 * an average output rate of 1Hz (occasional
35 * intra-measurement time offsets in the range from 0-2000msec can be
36 * tolerated.)
37 *
38 * @param callback Handle to GnssMeasurement callback interface.
39 *
40 * @return initRet Returns SUCCESS if successful.
41 * Returns ERROR_ALREADY_INIT if a callback has already been
42 * registered without a corresponding call to 'close'.
43 * Returns ERROR_GENERIC for any other error. The HAL must
44 * not generate any other updates upon returning this error code.
45 */
46 setCallback(IGnssMeasurementCallback callback) generates (int32_t 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};