Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2018, 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 | #ifndef ENGINE_HUB_PROXY_BASE_H |
| 30 | #define ENGINE_HUB_PROXY_BASE_H |
| 31 | |
| 32 | namespace loc_core { |
| 33 | |
| 34 | class EngineHubProxyBase { |
| 35 | public: |
| 36 | inline EngineHubProxyBase() { |
| 37 | } |
| 38 | inline virtual ~EngineHubProxyBase() {} |
| 39 | |
| 40 | // gnss session related functions |
| 41 | inline virtual bool gnssStartFix() { |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 42 | return false; |
| 43 | } |
| 44 | |
| 45 | inline virtual bool gnssStopFix() { |
| 46 | return false; |
| 47 | } |
| 48 | |
| 49 | inline virtual bool gnssSetFixMode(const LocPosMode ¶ms) { |
| 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 Sharma | 5a8d171 | 2018-08-22 09:45:25 -0700 | [diff] [blame] | 83 | |
| 84 | inline virtual bool gnssReportSvEphemeris(const GnssSvEphemerisReport& svEphemeris) { |
| 85 | (void) svEphemeris; |
| 86 | return false; |
| 87 | } |
Wei Chen | 21b9c4e | 2018-09-19 10:59:28 -0700 | [diff] [blame^] | 88 | |
| 89 | inline virtual bool gnssReportSystemInfo(const LocationSystemInfo& systemInfo) { |
| 90 | (void) systemInfo; |
| 91 | return false; |
| 92 | } |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 93 | }; |
| 94 | |
| 95 | typedef std::function<void(const UlpLocation& ulpLocation, |
| 96 | const GpsLocationExtended& locationExtended, |
| 97 | enum loc_sess_status status, |
| 98 | LocPosTechMask techMask, |
Bhavna Sharma | e5c31f3 | 2018-03-30 17:10:59 -0700 | [diff] [blame] | 99 | bool fromEngineHub)> |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 100 | GnssAdapterReportPositionEventCb; |
| 101 | |
Bhavna Sharma | e5c31f3 | 2018-03-30 17:10:59 -0700 | [diff] [blame] | 102 | typedef std::function<void(const GnssSvNotification& svNotify, |
Bhavna Sharma | e5c31f3 | 2018-03-30 17:10:59 -0700 | [diff] [blame] | 103 | bool fromEngineHub)> |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 104 | GnssAdapterReportSvEventCb; |
| 105 | |
Bhavna Sharma | 5a8d171 | 2018-08-22 09:45:25 -0700 | [diff] [blame] | 106 | typedef std::function<void(const GnssAidingDataSvMask& svDataMask)> |
| 107 | GnssAdapterReqAidingDataCb; |
| 108 | |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 109 | // potential parameters: message queue: MsgTask * msgTask; |
| 110 | // callback function to report back dr and ppe position and sv report |
| 111 | typedef EngineHubProxyBase* (getEngHubProxyFn)(const MsgTask * msgTask, |
Kevin Tang | b47eea6 | 2018-03-07 10:19:24 -0800 | [diff] [blame] | 112 | IOsObserver* osObserver, |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 113 | GnssAdapterReportPositionEventCb positionEventCb, |
Bhavna Sharma | 5a8d171 | 2018-08-22 09:45:25 -0700 | [diff] [blame] | 114 | GnssAdapterReportSvEventCb svEventCb, |
| 115 | GnssAdapterReqAidingDataCb reqAidingDataCb); |
Bhavna Sharma | 5b2f224 | 2018-01-29 14:32:06 +0530 | [diff] [blame] | 116 | |
| 117 | } // namespace loc_core |
| 118 | |
| 119 | #endif // ENGINE_HUB_PROXY_BASE_H |