blob: e86158f09f899ba3f26090ff118b5131bc5a9c97 [file] [log] [blame]
Yu-Han Yang9c6c20b2018-11-06 14:12:49 -08001/*
2 * Copyright (C) 2018 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#ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSS_H
18#define ANDROID_HARDWARE_GNSS_V2_0_GNSS_H
19
20#include <android/hardware/gnss/2.0/IGnss.h>
21#include <hidl/MQDescriptor.h>
22#include <hidl/Status.h>
23
24namespace android {
25namespace hardware {
26namespace gnss {
27namespace V2_0 {
28namespace implementation {
29
30using ::android::sp;
31using ::android::hardware::hidl_array;
32using ::android::hardware::hidl_memory;
33using ::android::hardware::hidl_string;
34using ::android::hardware::hidl_vec;
35using ::android::hardware::Return;
36using ::android::hardware::Void;
37
38struct Gnss : public IGnss {
39 // Methods from V1_0::IGnss follow.
40 Return<bool> setCallback(const sp<V1_0::IGnssCallback>& callback) override;
41 Return<bool> start() override;
42 Return<bool> stop() override;
43 Return<void> cleanup() override;
44 Return<bool> injectTime(int64_t timeMs, int64_t timeReferenceMs,
45 int32_t uncertaintyMs) override;
46 Return<bool> injectLocation(double latitudeDegrees, double longitudeDegrees,
47 float accuracyMeters) override;
48 Return<void> deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override;
49 Return<bool> setPositionMode(V1_0::IGnss::GnssPositionMode mode,
50 V1_0::IGnss::GnssPositionRecurrence recurrence,
51 uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
52 uint32_t preferredTimeMs) override;
53 Return<sp<V1_0::IAGnssRil>> getExtensionAGnssRil() override;
54 Return<sp<V1_0::IGnssGeofencing>> getExtensionGnssGeofencing() override;
55 Return<sp<V1_0::IAGnss>> getExtensionAGnss() override;
56 Return<sp<V1_0::IGnssNi>> getExtensionGnssNi() override;
57 Return<sp<V1_0::IGnssMeasurement>> getExtensionGnssMeasurement() override;
58 Return<sp<V1_0::IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override;
59 Return<sp<V1_0::IGnssXtra>> getExtensionXtra() override;
60 Return<sp<V1_0::IGnssConfiguration>> getExtensionGnssConfiguration() override;
61 Return<sp<V1_0::IGnssDebug>> getExtensionGnssDebug() override;
62 Return<sp<V1_0::IGnssBatching>> getExtensionGnssBatching() override;
63
64 // Methods from V1_1::IGnss follow.
65 Return<bool> setCallback_1_1(const sp<V1_1::IGnssCallback>& callback) override;
66 Return<bool> setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode,
67 V1_0::IGnss::GnssPositionRecurrence recurrence,
68 uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
69 uint32_t preferredTimeMs, bool lowPowerMode) override;
70 Return<sp<V1_1::IGnssConfiguration>> getExtensionGnssConfiguration_1_1() override;
71 Return<sp<V1_1::IGnssMeasurement>> getExtensionGnssMeasurement_1_1() override;
72 Return<bool> injectBestLocation(const V1_0::GnssLocation& location) override;
73
74 // Methods from V2_0::IGnss follow.
Anil Admal4e50a4c2018-12-19 15:22:13 -080075 Return<sp<V2_0::IGnssConfiguration>> getExtensionGnssConfiguration_2_0() override;
Anil Admal3a405c52018-11-14 09:35:14 -080076 Return<sp<V2_0::IAGnss>> getExtensionAGnss_2_0() override;
Anil Admalb02bcc12018-11-14 10:23:45 -080077 Return<sp<V2_0::IAGnssRil>> getExtensionAGnssRil_2_0() override;
Yu-Han Yang9c6c20b2018-11-06 14:12:49 -080078 Return<sp<V2_0::IGnssMeasurement>> getExtensionGnssMeasurement_2_0() override;
gomo1da4b5c2018-12-02 02:49:10 -080079 Return<bool> setCallback_2_0(const sp<V2_0::IGnssCallback>& callback) override;
80 Return<sp<measurement_corrections::V1_0::IMeasurementCorrections>>
81 getExtensionMeasurementCorrections() override;
Yu-Han Yang9c6c20b2018-11-06 14:12:49 -080082
83 private:
gomo1da4b5c2018-12-02 02:49:10 -080084 static sp<V2_0::IGnssCallback> sGnssCallback_2_0;
85 static sp<V1_1::IGnssCallback> sGnssCallback_1_1;
Yu-Han Yang9c6c20b2018-11-06 14:12:49 -080086};
87
88} // namespace implementation
89} // namespace V2_0
90} // namespace gnss
91} // namespace hardware
92} // namespace android
93
Anil Admal3a405c52018-11-14 09:35:14 -080094#endif // ANDROID_HARDWARE_GNSS_V2_0_GNSS_H