• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
3  * Not a Contribution
4  */
5 
6  /* Copyright (C) 2016 The Android Open Source Project
7  *
8  * Licensed under the Apache License, Version 2_0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2_0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 
22 #ifndef ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H
23 #define ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H
24 
25 #include <android/hardware/gnss/2.1/IGnssConfiguration.h>
26 #include <hidl/Status.h>
27 
28 namespace android {
29 namespace hardware {
30 namespace gnss {
31 namespace V2_1 {
32 namespace implementation {
33 
34 using ::android::hardware::Return;
35 using ::android::hardware::Void;
36 using ::android::hardware::hidl_vec;
37 using ::android::hardware::hidl_string;
38 using ::android::hardware::gnss::V2_0::GnssConstellationType;
39 using ::android::sp;
40 
41 /*
42  * Interface for passing GNSS configuration info from platform to HAL.
43  */
44 struct Gnss;
45 struct GnssConfiguration : public V2_1::IGnssConfiguration {
46     GnssConfiguration(Gnss* gnss);
47     ~GnssConfiguration() = default;
48 
49 
50     /*
51      * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow.
52      * These declarations were generated from IGnssConfiguration.hal.
53      */
54     Return<bool> setSuplVersion(uint32_t version) override;
55     Return<bool> setSuplMode(uint8_t mode) override;
56     Return<bool> setSuplEs(bool enabled) override;
57     Return<bool> setLppProfile(uint8_t lppProfileMask) override;
58     Return<bool> setGlonassPositioningProtocol(uint8_t protocol) override;
59     Return<bool> setEmergencySuplPdn(bool enable) override;
60     Return<bool> setGpsLock(uint8_t lock) override;
61 
62     // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow.
63     Return<bool> setBlacklist(
64             const hidl_vec<V1_1::IGnssConfiguration::BlacklistedSource>& blacklist) override;
65 
66     // Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow.
67     Return<bool> setEsExtensionSec(uint32_t emergencyExtensionSeconds) override;
68     // Methods from ::android::hardware::gnss::V2_1::IGnssConfiguration follow.
69     Return<bool> setBlacklist_2_1(
70             const hidl_vec<V2_1::IGnssConfiguration::BlacklistedSource>& blacklist) override;
71 
72  private:
73     Gnss* mGnss = nullptr;
74     bool setBlacklistedSource(
75             GnssSvIdSource& copyToSource,
76             const GnssConfiguration::BlacklistedSource& copyFromSource);
77     bool setBlacklistedSource(
78             GnssSvIdSource& copyToSource, const GnssConstellationType& constellation,
79             const int16_t svid);
80 };
81 
82 }  // namespace implementation
83 }  // namespace V2_1
84 }  // namespace gnss
85 }  // namespace hardware
86 }  // namespace android
87 
88 #endif  // ANDROID_HARDWARE_GNSS_V2_1_GNSSCONFIGURATION_H
89