EngineHubProxyBase.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. #include <ContextBase.h>
  39. namespace loc_core {
  40. using namespace loc_util;
  41. class EngineHubProxyBase {
  42. public:
  43. inline EngineHubProxyBase() {
  44. }
  45. inline virtual ~EngineHubProxyBase() {}
  46. // gnss session related functions
  47. inline virtual bool gnssStartFix() {
  48. return false;
  49. }
  50. inline virtual bool gnssStopFix() {
  51. return false;
  52. }
  53. inline virtual bool gnssSetFixMode(const LocPosMode &params) {
  54. (void) params;
  55. return false;
  56. }
  57. inline virtual bool gnssDeleteAidingData(const GnssAidingData &aidingData) {
  58. (void) aidingData;
  59. return false;
  60. }
  61. // GNSS reports
  62. inline virtual bool gnssReportPosition(const UlpLocation &location,
  63. const GpsLocationExtended &locationExtended,
  64. enum loc_sess_status status) {
  65. (void) location;
  66. (void) locationExtended;
  67. (void) status;
  68. return false;
  69. }
  70. inline virtual bool gnssReportSv(const GnssSvNotification& svNotify) {
  71. (void) svNotify;
  72. return false;
  73. }
  74. inline virtual bool gnssReportSvMeasurement(const GnssSvMeasurementSet& svMeasurementSet) {
  75. (void) svMeasurementSet;
  76. return false;
  77. }
  78. inline virtual bool gnssReportSvPolynomial(const GnssSvPolynomial& svPolynomial) {
  79. (void) svPolynomial;
  80. return false;
  81. }
  82. inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) {
  83. (void) svEphemeris;
  84. return false;
  85. }
  86. inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) {
  87. (void) systemInfo;
  88. return false;
  89. }
  90. inline virtual bool gnssReportKlobucharIonoModel(const GnssKlobucharIonoModel& ionoModel) {
  91. (void) ionoModel;
  92. return false;
  93. }
  94. inline virtual bool gnssReportAdditionalSystemInfo(
  95. const GnssAdditionalSystemInfo& additionalSystemInfo) {
  96. (void) additionalSystemInfo;
  97. return false;
  98. }
  99. inline virtual bool configLeverArm(const LeverArmConfigInfo& configInfo) {
  100. (void) configInfo;
  101. return false;
  102. }
  103. inline virtual bool configDeadReckoningEngineParams(
  104. const DeadReckoningEngineConfig& dreConfig) {
  105. (void) dreConfig;
  106. return false;
  107. }
  108. inline virtual bool configEngineRunState(
  109. PositioningEngineMask engType, LocEngineRunState engState) {
  110. (void) engType;
  111. (void) engState;
  112. return false;
  113. }
  114. };
  115. typedef std::function<void(int count, EngineLocationInfo* locationArr)>
  116. GnssAdapterReportEnginePositionsEventCb;
  117. typedef std::function<void(const GnssSvNotification& svNotify,
  118. bool fromEngineHub)>
  119. GnssAdapterReportSvEventCb;
  120. typedef std::function<void(const GnssAidingDataSvMask& svDataMask)>
  121. GnssAdapterReqAidingDataCb;
  122. typedef std::function<void(bool nHzNeeded, bool nHzMeasNeeded)>
  123. GnssAdapterUpdateNHzRequirementCb;
  124. typedef std::function<void(const std::unordered_map<LocationQwesFeatureType, bool> &featureMap)>
  125. GnssAdapterUpdateQwesFeatureStatusCb;
  126. // potential parameters: message queue: MsgTask * msgTask;
  127. // callback function to report back dr and ppe position and sv report
  128. typedef EngineHubProxyBase* (getEngHubProxyFn)(
  129. const MsgTask * msgTask,
  130. const ContextBase * context,
  131. IOsObserver* osObserver,
  132. EngineServiceInfo& engServiceInfo,
  133. GnssAdapterReportEnginePositionsEventCb positionEventCb,
  134. GnssAdapterReqAidingDataCb reqAidingDataCb,
  135. GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb,
  136. GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb);
  137. } // namespace loc_core
  138. #endif // ENGINE_HUB_PROXY_BASE_H