GnssConfiguration.h 2.7 KB

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