blob: 468a8f05d5648609ebc27cb90e3a942e52bd0460 [file] [log] [blame]
Wei Chen0907ae12020-03-16 16:28:24 -07001/* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
Bhavna Sharma5b2f2242018-01-29 14:32:06 +05302 *
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 Munagalaf000bce2020-09-18 16:18:12 +053031#ifdef NO_UNORDERED_SET_OR_MAP
32 #include <map>
33#else
34 #include <unordered_map>
35#endif
Bhavna Sharma5b2f2242018-01-29 14:32:06 +053036
37namespace loc_core {
38
Kevin Tang68eb0162020-08-13 22:02:18 -070039using namespace loc_util;
40
Bhavna Sharma5b2f2242018-01-29 14:32:06 +053041class EngineHubProxyBase {
42public:
43 inline EngineHubProxyBase() {
44 }
45 inline virtual ~EngineHubProxyBase() {}
46
47 // gnss session related functions
48 inline virtual bool gnssStartFix() {
Bhavna Sharma5b2f2242018-01-29 14:32:06 +053049 return false;
50 }
51
52 inline virtual bool gnssStopFix() {
53 return false;
54 }
55
56 inline virtual bool gnssSetFixMode(const LocPosMode &params) {
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 Sharma5a8d1712018-08-22 09:45:25 -070090
91 inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) {
92 (void) svEphemeris;
93 return false;
94 }
Wei Chen21b9c4e2018-09-19 10:59:28 -070095
96 inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) {
97 (void) systemInfo;
98 return false;
99 }
Bhavna Sharma7445c502019-01-15 16:29:48 -0800100
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 Chen688372b2019-08-16 14:59:23 -0700111
112 inline virtual bool configLeverArm(const LeverArmConfigInfo& configInfo) {
113 (void) configInfo;
114 return false;
115 }
Wei Chen0907ae12020-03-16 16:28:24 -0700116
Wei (GPS SD) Chen381d7032020-07-24 16:17:22 -0700117 inline virtual bool configDeadReckoningEngineParams(
118 const DeadReckoningEngineConfig& dreConfig) {
119 (void) dreConfig;
Wei Chen0907ae12020-03-16 16:28:24 -0700120 return false;
121 }
Wei (GPS SD) Chen8a9f02f2020-10-05 13:41:19 -0700122
123 inline virtual bool configEngineRunState(
124 PositioningEngineMask engType, LocEngineRunState engState) {
125 (void) engType;
126 (void) engState;
127 return false;
128 }
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530129};
130
Wei Chena28f8132019-07-18 15:50:55 -0700131typedef std::function<void(int count, EngineLocationInfo* locationArr)>
132 GnssAdapterReportEnginePositionsEventCb;
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530133
Bhavna Sharmae5c31f32018-03-30 17:10:59 -0700134typedef std::function<void(const GnssSvNotification& svNotify,
Bhavna Sharmae5c31f32018-03-30 17:10:59 -0700135 bool fromEngineHub)>
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530136 GnssAdapterReportSvEventCb;
137
Bhavna Sharma5a8d1712018-08-22 09:45:25 -0700138typedef std::function<void(const GnssAidingDataSvMask& svDataMask)>
139 GnssAdapterReqAidingDataCb;
140
Bhavna Sharma006ab972019-10-02 16:29:38 -0700141typedef std::function<void(bool nHzNeeded, bool nHzMeasNeeded)>
142 GnssAdapterUpdateNHzRequirementCb;
143
Naresh Munagalaf000bce2020-09-18 16:18:12 +0530144typedef std::function<void(const std::unordered_map<LocationQwesFeatureType, bool> &featureMap)>
145 GnssAdapterUpdateQwesFeatureStatusCb;
146
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530147// potential parameters: message queue: MsgTask * msgTask;
148// callback function to report back dr and ppe position and sv report
Wei Chena28f8132019-07-18 15:50:55 -0700149typedef EngineHubProxyBase* (getEngHubProxyFn)(
150 const MsgTask * msgTask,
151 IOsObserver* osObserver,
152 GnssAdapterReportEnginePositionsEventCb positionEventCb,
153 GnssAdapterReportSvEventCb svEventCb,
Bhavna Sharma006ab972019-10-02 16:29:38 -0700154 GnssAdapterReqAidingDataCb reqAidingDataCb,
Naresh Munagalaf000bce2020-09-18 16:18:12 +0530155 GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb,
156 GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb);
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530157
158} // namespace loc_core
159
160#endif // ENGINE_HUB_PROXY_BASE_H