Yu-Han Yang | c06b536 | 2019-10-25 14:14:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | |
| 17 | package android.hardware.gnss@2.1; |
| 18 | |
| 19 | import @2.0::IGnssCallback; |
| 20 | |
| 21 | /** |
| 22 | * This interface is required for the HAL to communicate certain information |
| 23 | * like status and location info back to the platform, the platform implements |
| 24 | * the interfaces and passes a handle to the HAL. |
| 25 | */ |
| 26 | interface IGnssCallback extends @2.0::IGnssCallback { |
Sasha Kuznetsov | 768de57 | 2020-02-11 06:00:10 +0000 | [diff] [blame] | 27 | /** |
| 28 | * Flags for the gnssSetCapabilities callback. |
| 29 | */ |
| 30 | @export(name = "", value_prefix = "GPS_CAPABILITY_") |
| 31 | enum Capabilities : @2.0::IGnssCallback.Capabilities { |
| 32 | /** |
| 33 | * GNSS supports measurement corrections |
| 34 | */ |
| 35 | ANTENNA_INFO = 1 << 11, |
| 36 | }; |
Yu-Han Yang | c06b536 | 2019-10-25 14:14:35 -0700 | [diff] [blame] | 37 | |
Sasha Kuznetsov | 768de57 | 2020-02-11 06:00:10 +0000 | [diff] [blame] | 38 | /** |
Yu-Han Yang | 99b6d96 | 2020-02-13 14:19:09 -0800 | [diff] [blame] | 39 | * Callback to inform framework of the GNSS HAL implementation's capabilities. |
| 40 | * |
| 41 | * @param capabilities Capability parameter is a bit field of the Capabilities enum. |
| 42 | */ |
| 43 | gnssSetCapabilitiesCb_2_1(bitfield<Capabilities> capabilities); |
| 44 | |
| 45 | /** |
Sasha Kuznetsov | 768de57 | 2020-02-11 06:00:10 +0000 | [diff] [blame] | 46 | * Extends a GnssSvInfo, adding a basebandCN0DbHz. |
| 47 | */ |
Yu-Han Yang | c06b536 | 2019-10-25 14:14:35 -0700 | [diff] [blame] | 48 | struct GnssSvInfo { |
| 49 | /** |
| 50 | * GNSS satellite information for a single satellite and frequency. |
| 51 | */ |
| 52 | @2.0::IGnssCallback.GnssSvInfo v2_0; |
| 53 | |
| 54 | /** |
| 55 | * Baseband Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. It contains |
| 56 | * the measured C/N0 value for the signal measured at the baseband. |
| 57 | * |
| 58 | * This is typically a few dB weaker than the value estimated for C/N0 at the antenna port, |
| 59 | * which is reported in cN0DbHz. |
| 60 | * |
| 61 | * If a signal has separate components (e.g. Pilot and Data channels) and the receiver only |
| 62 | * processes one of the components, then the reported basebandCN0DbHz reflects only the |
| 63 | * component that is processed. |
| 64 | * |
| 65 | * This value is mandatory. Like cN0DbHz, it may be reported as 0 for satellites being |
| 66 | * reported that may be searched for, but not yet tracked. |
| 67 | */ |
| 68 | double basebandCN0DbHz; |
| 69 | }; |
| 70 | |
| 71 | /** |
| 72 | * Callback for the HAL to pass a vector of GnssSvInfo back to the client. |
| 73 | * |
| 74 | * @param svInfoList SV info list information from HAL. |
| 75 | */ |
| 76 | gnssSvStatusCb_2_1(vec<GnssSvInfo> svInfoList); |
| 77 | }; |