1 /* Copyright (c) 2013-2016, 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 ULP_PROXY_BASE_H 30 #define ULP_PROXY_BASE_H 31 32 #include <gps_extended.h> 33 #include "fused_location_extended.h" 34 namespace loc_core { 35 36 class LocAdapterBase; 37 38 class UlpProxyBase { 39 public: 40 LocPosMode mPosMode; 41 bool mFixSet; UlpProxyBase()42 inline UlpProxyBase() { 43 mPosMode.mode = LOC_POSITION_MODE_INVALID; 44 mFixSet = false; 45 } ~UlpProxyBase()46 inline virtual ~UlpProxyBase() {} sendStartFix()47 inline virtual bool sendStartFix() { mFixSet = true; return false; } sendStopFix()48 inline virtual bool sendStopFix() { mFixSet = false; return false; } sendFixMode(LocPosMode & params)49 inline virtual bool sendFixMode(LocPosMode ¶ms) { 50 mPosMode = params; 51 return false; 52 } 53 reportPosition(UlpLocation & location,GpsLocationExtended & locationExtended,void * locationExt,enum loc_sess_status status,LocPosTechMask loc_technology_mask)54 inline virtual bool reportPosition(UlpLocation &location, 55 GpsLocationExtended &locationExtended, 56 void* locationExt, 57 enum loc_sess_status status, 58 LocPosTechMask loc_technology_mask) { 59 (void)location; 60 (void)locationExtended; 61 (void)locationExt; 62 (void)status; 63 (void)loc_technology_mask; 64 return false; 65 } reportSv(GnssSvStatus & svStatus,GpsLocationExtended & locationExtended,void * svExt)66 inline virtual bool reportSv(GnssSvStatus &svStatus, 67 GpsLocationExtended &locationExtended, 68 void* svExt) { 69 (void)svStatus; 70 (void)locationExtended; 71 (void)svExt; 72 return false; 73 } reportSvMeasurement(GnssSvMeasurementSet & svMeasurementSet)74 inline virtual bool reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet) { 75 (void)svMeasurementSet; 76 return false; 77 } 78 reportSvPolynomial(GnssSvPolynomial & svPolynomial)79 inline virtual bool reportSvPolynomial(GnssSvPolynomial &svPolynomial) 80 { 81 (void)svPolynomial; 82 return false; 83 } reportStatus(GpsStatusValue status)84 inline virtual bool reportStatus(GpsStatusValue status) { 85 86 (void)status; 87 return false; 88 } setAdapter(LocAdapterBase * adapter)89 inline virtual void setAdapter(LocAdapterBase* adapter) { 90 91 (void)adapter; 92 } setCapabilities(unsigned long capabilities)93 inline virtual void setCapabilities(unsigned long capabilities) { 94 95 (void)capabilities; 96 } reportBatchingSession(FlpExtBatchOptions & options,bool active)97 inline virtual bool reportBatchingSession(FlpExtBatchOptions &options, 98 bool active) { 99 100 (void)options; 101 (void)active; 102 return false; 103 } reportPositions(const FlpExtLocation * locations,int32_t number_of_locations)104 inline virtual bool reportPositions(const FlpExtLocation* locations, 105 int32_t number_of_locations) { 106 (void)locations; 107 (void)number_of_locations; 108 return false; 109 } reportDeleteAidingData(GpsAidingData aidingData)110 inline virtual bool reportDeleteAidingData(GpsAidingData aidingData) 111 { 112 (void)aidingData; 113 return false; 114 } reportNmea(const char * nmea,int length)115 inline virtual bool reportNmea(const char* nmea, int length) 116 { 117 (void)nmea; 118 (void)length; 119 return false; 120 } 121 }; 122 123 } // namespace loc_core 124 125 #endif // ULP_PROXY_BASE_H 126