blob: f7fe4d2f4419cd3d5fae7225c016085e43041699 [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
31
32namespace loc_core {
33
34class EngineHubProxyBase {
35public:
36 inline EngineHubProxyBase() {
37 }
38 inline virtual ~EngineHubProxyBase() {}
39
40 // gnss session related functions
41 inline virtual bool gnssStartFix() {
Bhavna Sharma5b2f2242018-01-29 14:32:06 +053042 return false;
43 }
44
45 inline virtual bool gnssStopFix() {
46 return false;
47 }
48
49 inline virtual bool gnssSetFixMode(const LocPosMode &params) {
50 (void) params;
51 return false;
52 }
53
54 inline virtual bool gnssDeleteAidingData(const GnssAidingData &aidingData) {
55 (void) aidingData;
56 return false;
57 }
58
59 // GNSS reports
60 inline virtual bool gnssReportPosition(const UlpLocation &location,
61 const GpsLocationExtended &locationExtended,
62 enum loc_sess_status status) {
63 (void) location;
64 (void) locationExtended;
65 (void) status;
66 return false;
67 }
68
69 inline virtual bool gnssReportSv(const GnssSvNotification& svNotify) {
70 (void) svNotify;
71 return false;
72 }
73
74 inline virtual bool gnssReportSvMeasurement(const GnssSvMeasurementSet& svMeasurementSet) {
75 (void) svMeasurementSet;
76 return false;
77 }
78
79 inline virtual bool gnssReportSvPolynomial(const GnssSvPolynomial& svPolynomial) {
80 (void) svPolynomial;
81 return false;
82 }
Bhavna Sharma5a8d1712018-08-22 09:45:25 -070083
84 inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) {
85 (void) svEphemeris;
86 return false;
87 }
Wei Chen21b9c4e2018-09-19 10:59:28 -070088
89 inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) {
90 (void) systemInfo;
91 return false;
92 }
Bhavna Sharma7445c502019-01-15 16:29:48 -080093
94 inline virtual bool gnssReportKlobucharIonoModel(const GnssKlobucharIonoModel& ionoModel) {
95 (void) ionoModel;
96 return false;
97 }
98
99 inline virtual bool gnssReportAdditionalSystemInfo(
100 const GnssAdditionalSystemInfo& additionalSystemInfo) {
101 (void) additionalSystemInfo;
102 return false;
103 }
Wei Chen688372b2019-08-16 14:59:23 -0700104
105 inline virtual bool configLeverArm(const LeverArmConfigInfo& configInfo) {
106 (void) configInfo;
107 return false;
108 }
Wei Chen0907ae12020-03-16 16:28:24 -0700109
Wei (GPS SD) Chen381d7032020-07-24 16:17:22 -0700110 inline virtual bool configDeadReckoningEngineParams(
111 const DeadReckoningEngineConfig& dreConfig) {
112 (void) dreConfig;
Wei Chen0907ae12020-03-16 16:28:24 -0700113 return false;
114 }
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530115};
116
Wei Chena28f8132019-07-18 15:50:55 -0700117typedef std::function<void(int count, EngineLocationInfo* locationArr)>
118 GnssAdapterReportEnginePositionsEventCb;
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530119
Bhavna Sharmae5c31f32018-03-30 17:10:59 -0700120typedef std::function<void(const GnssSvNotification& svNotify,
Bhavna Sharmae5c31f32018-03-30 17:10:59 -0700121 bool fromEngineHub)>
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530122 GnssAdapterReportSvEventCb;
123
Bhavna Sharma5a8d1712018-08-22 09:45:25 -0700124typedef std::function<void(const GnssAidingDataSvMask& svDataMask)>
125 GnssAdapterReqAidingDataCb;
126
Bhavna Sharma006ab972019-10-02 16:29:38 -0700127typedef std::function<void(bool nHzNeeded, bool nHzMeasNeeded)>
128 GnssAdapterUpdateNHzRequirementCb;
129
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530130// potential parameters: message queue: MsgTask * msgTask;
131// callback function to report back dr and ppe position and sv report
Wei Chena28f8132019-07-18 15:50:55 -0700132typedef EngineHubProxyBase* (getEngHubProxyFn)(
133 const MsgTask * msgTask,
134 IOsObserver* osObserver,
135 GnssAdapterReportEnginePositionsEventCb positionEventCb,
136 GnssAdapterReportSvEventCb svEventCb,
Bhavna Sharma006ab972019-10-02 16:29:38 -0700137 GnssAdapterReqAidingDataCb reqAidingDataCb,
138 GnssAdapterUpdateNHzRequirementCb updateNHzRequirementCb);
Bhavna Sharma5b2f2242018-01-29 14:32:06 +0530139
140} // namespace loc_core
141
142#endif // ENGINE_HUB_PROXY_BASE_H