EngineHubProxyBase.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  2. *
  3. * Redistribution and use in source and binary forms, with or without
  4. * modification, are permitted provided that the following conditions are
  5. * met:
  6. * * Redistributions of source code must retain the above copyright
  7. * notice, this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above
  9. * copyright notice, this list of conditions and the following
  10. * disclaimer in the documentation and/or other materials provided
  11. * with the distribution.
  12. * * Neither the name of The Linux Foundation, nor the names of its
  13. * contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  17. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  20. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  23. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  25. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  26. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. *
  28. */
  29. #include <loc_pla.h>
  30. #ifndef ENGINE_HUB_PROXY_BASE_H
  31. #define ENGINE_HUB_PROXY_BASE_H
  32. #ifdef NO_UNORDERED_SET_OR_MAP
  33. #include <map>
  34. #define unordered_map map
  35. #else
  36. #include <unordered_map>
  37. #endif
  38. namespace loc_core {
  39. using namespace loc_util;
  40. class EngineHubProxyBase {
  41. public:
  42. inline EngineHubProxyBase() {
  43. }
  44. inline virtual ~EngineHubProxyBase() {}
  45. // gnss session related functions
  46. inline virtual bool gnssStartFix() {
  47. return false;
  48. }
  49. inline virtual bool gnssStopFix() {
  50. return false;
  51. }
  52. inline virtual bool gnssSetFixMode(const LocPosMode &params) {
  53. (void) params;
  54. return false;
  55. }
  56. inline virtual bool gnssDeleteAidingData(const GnssAidingData &aidingData) {
  57. (void) aidingData;
  58. return false;
  59. }
  60. // GNSS reports
  61. inline virtual bool gnssReportPosition(const UlpLocation &location,
  62. const GpsLocationExtended &locationExtended,
  63. enum loc_sess_status status) {
  64. (void) location;
  65. (void) locationExtended;
  66. (void) status;
  67. return false;
  68. }
  69. inline virtual bool gnssReportSv(const GnssSvNotification& svNotify) {
  70. (void) svNotify;
  71. return false;
  72. }
  73. inline virtual bool gnssReportSvMeasurement(const GnssSvMeasurementSet& svMeasurementSet) {
  74. (void) svMeasurementSet;
  75. return false;
  76. }
  77. inline virtual bool gnssReportSvPolynomial(const GnssSvPolynomial& svPolynomial) {
  78. (void) svPolynomial;
  79. return false;
  80. }
  81. inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) {
  82. (void) svEphemeris;
  83. return false;
  84. }
  85. inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) {
  86. (void) systemInfo;
  87. return false;
  88. }
  89. inline virtual bool gnssReportKlobucharIonoModel(const GnssKlobucharIonoModel& ionoModel) {
  90. (void) ionoModel;
  91. return false;
  92. }
  93. inline virtual bool gnssReportAdditionalSystemInfo(
  94. const GnssAdditionalSystemInfo& additionalSystemInfo) {
  95. (void) additionalSystemInfo;
  96. return false;
  97. }
  98. inline virtual bool configLeverArm(const LeverArmConfigInfo& configInfo) {
  99. (void) configInfo;
  100. return false;
  101. }
  102. inline virtual bool configDeadReckoningEngineParams(
  103. const DeadReckoningEngineConfig& dreConfig) {
  104. (void) dreConfig;
  105. return false;
  106. }
  107. inline virtual bool configEngineRunState(
  108. PositioningEngineMask engType, LocEngineRunState engState) {
  109. (void) engType;
  110. (void) engState;
  111. return false;
  112. }
  113. };
  114. typedef std::function<void(int count, EngineLocationInfo* locationArr)>
  115. GnssAdapterReportEnginePositionsEventCb;
  116. typedef std::function<void(const GnssSvNotification& svNotify,
  117. bool fromEngineHub)>
  118. GnssAdapterReportSvEventCb;
  119. typedef std::function<void(const GnssAidingDataSvMask& svDataMask)>
  120. GnssAdapterReqAidingDataCb;
  121. typedef std::function<void(bool nHzNeeded, bool nHzMeasNeeded)>
  122. GnssAdapterUpdateNHzRequirementCb;
  123. typedef std::function<void(const std::unordered_map<LocationQwesFeatureType, bool> &featureMap)>
  124. GnssAdapterUpdateQwesFeatureStatusCb;
  125. // potential parameters: message queue: MsgTask * msgTask;
  126. // callback function to report back dr and ppe position and sv report
  127. typedef EngineHubProxyBase* (getEngHubProxyFn)(
  128. const MsgTask * msgTask,
  129. IOsObserver* osObserver,
  130. EngineServiceInfo& engServiceInfo,
  131. GnssAdapterReportEnginePositionsEventCb positionEventCb,
  132. GnssAdapterReqAidingDataCb reqAidingDataCb,
  133. GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb,
  134. GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb);
  135. } // namespace loc_core
  136. #endif // ENGINE_HUB_PROXY_BASE_H