Wei Chen | 0907ae1 | 2020-03-16 16:28:24 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 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 | #ifndef ENGINE_HUB_PROXY_BASE_H |
| 30 | #define ENGINE_HUB_PROXY_BASE_H |
Naresh Munagala | f000bce | 2020-09-18 16:18:12 +0530 | [diff] [blame] | 31 | #ifdef NO_UNORDERED_SET_OR_MAP |
| 32 | #include <map> |
| 33 | #else |
| 34 | #include <unordered_map> |
| 35 | #endif |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 36 | |
| 37 | namespace loc_core { |
| 38 | |
Kevin Tang | 68eb016 | 2020-08-13 22:02:18 -0700 | [diff] [blame] | 39 | using namespace loc_util; |
| 40 | |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 41 | class EngineHubProxyBase { |
| 42 | public: |
| 43 | inline EngineHubProxyBase() { |
| 44 | } |
| 45 | inline virtual ~EngineHubProxyBase() {} |
| 46 | |
| 47 | // gnss session related functions |
| 48 | inline virtual bool gnssStartFix() { |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 49 | return false; |
| 50 | } |
| 51 | |
| 52 | inline virtual bool gnssStopFix() { |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | inline virtual bool gnssSetFixMode(const LocPosMode ¶ms) { |
| 57 | (void) params; |
| 58 | return false; |
| 59 | } |
| 60 | |
| 61 | inline virtual bool gnssDeleteAidingData(const GnssAidingData &aidingData) { |
| 62 | (void) aidingData; |
| 63 | return false; |
| 64 | } |
| 65 | |
| 66 | // GNSS reports |
| 67 | inline virtual bool gnssReportPosition(const UlpLocation &location, |
| 68 | const GpsLocationExtended &locationExtended, |
| 69 | enum loc_sess_status status) { |
| 70 | (void) location; |
| 71 | (void) locationExtended; |
| 72 | (void) status; |
| 73 | return false; |
| 74 | } |
| 75 | |
| 76 | inline virtual bool gnssReportSv(const GnssSvNotification& svNotify) { |
| 77 | (void) svNotify; |
| 78 | return false; |
| 79 | } |
| 80 | |
| 81 | inline virtual bool gnssReportSvMeasurement(const GnssSvMeasurementSet& svMeasurementSet) { |
| 82 | (void) svMeasurementSet; |
| 83 | return false; |
| 84 | } |
| 85 | |
| 86 | inline virtual bool gnssReportSvPolynomial(const GnssSvPolynomial& svPolynomial) { |
| 87 | (void) svPolynomial; |
| 88 | return false; |
| 89 | } |
Bhavna Sharma | 5a8d171 | 2018-08-22 09:45:25 -0700 | [diff] [blame] | 90 | |
| 91 | inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) { |
| 92 | (void) svEphemeris; |
| 93 | return false; |
| 94 | } |
Wei Chen | 21b9c4e | 2018-09-19 10:59:28 -0700 | [diff] [blame] | 95 | |
| 96 | inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) { |
| 97 | (void) systemInfo; |
| 98 | return false; |
| 99 | } |
Bhavna Sharma | 7445c50 | 2019-01-15 16:29:48 -0800 | [diff] [blame] | 100 | |
| 101 | inline virtual bool gnssReportKlobucharIonoModel(const GnssKlobucharIonoModel& ionoModel) { |
| 102 | (void) ionoModel; |
| 103 | return false; |
| 104 | } |
| 105 | |
| 106 | inline virtual bool gnssReportAdditionalSystemInfo( |
| 107 | const GnssAdditionalSystemInfo& additionalSystemInfo) { |
| 108 | (void) additionalSystemInfo; |
| 109 | return false; |
| 110 | } |
Wei Chen | 688372b | 2019-08-16 14:59:23 -0700 | [diff] [blame] | 111 | |
| 112 | inline virtual bool configLeverArm(const LeverArmConfigInfo& configInfo) { |
| 113 | (void) configInfo; |
| 114 | return false; |
| 115 | } |
Wei Chen | 0907ae1 | 2020-03-16 16:28:24 -0700 | [diff] [blame] | 116 | |
Wei (GPS SD) Chen | 381d703 | 2020-07-24 16:17:22 -0700 | [diff] [blame] | 117 | inline virtual bool configDeadReckoningEngineParams( |
| 118 | const DeadReckoningEngineConfig& dreConfig) { |
| 119 | (void) dreConfig; |
Wei Chen | 0907ae1 | 2020-03-16 16:28:24 -0700 | [diff] [blame] | 120 | return false; |
| 121 | } |
Wei (GPS SD) Chen | 8a9f02f | 2020-10-05 13:41:19 -0700 | [diff] [blame] | 122 | |
| 123 | inline virtual bool configEngineRunState( |
| 124 | PositioningEngineMask engType, LocEngineRunState engState) { |
| 125 | (void) engType; |
| 126 | (void) engState; |
| 127 | return false; |
| 128 | } |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 129 | }; |
| 130 | |
Wei Chen | a28f813 | 2019-07-18 15:50:55 -0700 | [diff] [blame] | 131 | typedef std::function<void(int count, EngineLocationInfo* locationArr)> |
| 132 | GnssAdapterReportEnginePositionsEventCb; |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 133 | |
Bhavna Sharma | e5c31f3 | 2018-03-30 17:10:59 -0700 | [diff] [blame] | 134 | typedef std::function<void(const GnssSvNotification& svNotify, |
Bhavna Sharma | e5c31f3 | 2018-03-30 17:10:59 -0700 | [diff] [blame] | 135 | bool fromEngineHub)> |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 136 | GnssAdapterReportSvEventCb; |
| 137 | |
Bhavna Sharma | 5a8d171 | 2018-08-22 09:45:25 -0700 | [diff] [blame] | 138 | typedef std::function<void(const GnssAidingDataSvMask& svDataMask)> |
| 139 | GnssAdapterReqAidingDataCb; |
| 140 | |
Bhavna Sharma | 006ab97 | 2019-10-02 16:29:38 -0700 | [diff] [blame] | 141 | typedef std::function<void(bool nHzNeeded, bool nHzMeasNeeded)> |
| 142 | GnssAdapterUpdateNHzRequirementCb; |
| 143 | |
Naresh Munagala | f000bce | 2020-09-18 16:18:12 +0530 | [diff] [blame] | 144 | typedef std::function<void(const std::unordered_map<LocationQwesFeatureType, bool> &featureMap)> |
| 145 | GnssAdapterUpdateQwesFeatureStatusCb; |
| 146 | |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 147 | // potential parameters: message queue: MsgTask * msgTask; |
| 148 | // callback function to report back dr and ppe position and sv report |
Wei Chen | a28f813 | 2019-07-18 15:50:55 -0700 | [diff] [blame] | 149 | typedef EngineHubProxyBase* (getEngHubProxyFn)( |
| 150 | const MsgTask * msgTask, |
| 151 | IOsObserver* osObserver, |
| 152 | GnssAdapterReportEnginePositionsEventCb positionEventCb, |
| 153 | GnssAdapterReportSvEventCb svEventCb, |
Bhavna Sharma | 006ab97 | 2019-10-02 16:29:38 -0700 | [diff] [blame] | 154 | GnssAdapterReqAidingDataCb reqAidingDataCb, |
Naresh Munagala | f000bce | 2020-09-18 16:18:12 +0530 | [diff] [blame] | 155 | GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb, |
| 156 | GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb); |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 157 | |
| 158 | } // namespace loc_core |
| 159 | |
| 160 | #endif // ENGINE_HUB_PROXY_BASE_H |