updated tpms plugin so it compiles 44/2344/1
authorKevron Rees <kevron_m_rees@linux.intel.com>
Fri, 26 Oct 2012 23:50:53 +0000 (16:50 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Fri, 26 Oct 2012 23:50:53 +0000 (16:50 -0700)
CMakeLists.txt
lib/abstractroutingengine.h
lib/vehicleproperty.cpp
plugins/tpms/tpmsplugin.cpp
plugins/tpms/tpmsplugin.h

index 6cc1e69..e0d3098 100644 (file)
@@ -18,6 +18,7 @@ set (DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE P
 
 option(use_qtcore "Use QCoreApplication mainloop " OFF)
 option(tpms_plugin "TPMS plugin " OFF)
+option(obd2_plugin "OBD-II plugin" OFF)
 
 find_library(libtool_LIBRARY ltdl DOC "Libtool libraries")
 find_path(libtool_INCLUDE_DIR ltdl.h DOC "Libtool headers")
index b558f40..f39503e 100644 (file)
 class AbstractSink;
 class AbstractSource;
 class AsyncPropertyReply;
+class AsyncRangePropertyReply;
 
 
 typedef std::function<void (AsyncPropertyReply*)> GetPropertyCompletedSignal;
+typedef std::function<void (AsyncRangePropertyReply*)> GetRangedPropertyCompletedSignal;
 
 class PropertyValueTime {
 public:
@@ -100,7 +102,7 @@ public:
        AbstractPropertyType* value;
 };
 
-class AsyncRangePropertyRequest: public AsyncPropertyRequest
+class AsyncRangePropertyRequest
 {
 public:
        AsyncRangePropertyRequest()
@@ -109,15 +111,8 @@ public:
 
        }
 
-       AsyncRangePropertyRequest(const AsyncPropertyRequest &request)
-               :AsyncPropertyRequest(request), begin(0), end(0)
-       {
-               this->property = request.property;
-               this->completed = request.completed;
-       }
-
        AsyncRangePropertyRequest(const AsyncRangePropertyRequest &request)
-               :AsyncPropertyRequest(request)
+
        {
                this->property = request.property;
                this->completed = request.completed;
@@ -125,6 +120,8 @@ public:
                this->end = request.end;
        }
 
+       VehicleProperty::Property property;
+       GetRangedPropertyCompletedSignal completed;
        time_t begin;
        time_t end;
 };
@@ -133,12 +130,13 @@ class AsyncRangePropertyReply: public AsyncRangePropertyRequest
 {
 public:
        AsyncRangePropertyReply(AsyncRangePropertyRequest request)
-               :AsyncRangePropertyRequest(request)
+               :AsyncRangePropertyRequest(request), success(false)
        {
 
        }
 
        std::list<PropertyValueTime*> values;
+       bool success;
 };
 
 class AbstractRoutingEngine
index 063f11b..4ffae17 100644 (file)
@@ -113,6 +113,10 @@ VehicleProperty::VehicleProperty()
        REGISTERPROPERTYWITHTYPE(TirePressureRightFront, TirePressureType, 0);
        REGISTERPROPERTYWITHTYPE(TirePressureLeftRear, TirePressureType, 0);
        REGISTERPROPERTYWITHTYPE(TirePressureRightRear, TirePressureType, 0);
+       REGISTERPROPERTYWITHTYPE(TireTemperatureLeftFront,TireTemperatureType,0);
+       REGISTERPROPERTYWITHTYPE(TireTemperatureRightFront,TireTemperatureType,0);
+       REGISTERPROPERTYWITHTYPE(TireTemperatureLeftRear,TireTemperatureType,0);
+       REGISTERPROPERTYWITHTYPE(TireTemperatureRightRear,TireTemperatureType,0);
        registerProperty( VehiclePowerMode,[](){ return new VehiclePowerModeType(Power::Off); } );
        REGISTERPROPERTYWITHTYPE(TripMeterA,TripMeterType,0);
        REGISTERPROPERTYWITHTYPE(TripMeterB,TripMeterType,0);
@@ -136,19 +140,10 @@ VehicleProperty::VehicleProperty()
 std::list<VehicleProperty::Property> VehicleProperty::capabilities()
 {
        return mCapabilities;
-       mProperties.push_back(TireTemperatureLeftFront);
-       mProperties.push_back(TireTemperatureRightFront);
-       mProperties.push_back(TireTemperatureLeftRear);
-       mProperties.push_back(TireTemperatureRightRear);
 }
 
 AbstractPropertyType* VehicleProperty::getPropertyTypeForPropertyNameValue(VehicleProperty::Property name, std::string value)
 {
-
-       else if(name == TireTemperatureLeftFront) return new TireTemperatureType(value);
-       else if(name == TireTemperatureRightFront) return new TireTemperatureType(value);
-       else if(name == TireTemperatureLeftRear) return new TireTemperatureType(value);
-       else if(name == TireTemperatureRightRear) return new TireTemperatureType(value);
        if(registeredPropertyFactoryMap.count(name) > 0)
        {
                VehicleProperty::PropertyTypeFactoryCallback cb = registeredPropertyFactoryMap[name];
index 3be4ff3..01cb444 100644 (file)
@@ -156,12 +156,18 @@ void TpmsPlugin::getPropertyAsync(AsyncPropertyReply *reply)
       DebugOut() << "TPMS: no such getProperty type: " << reply->property << endl;
       reply->value = nullptr;
       reply->completed(reply);
-    }
+       }
 }
 
-void TpmsPlugin::setProperty(VehicleProperty::Property , AbstractPropertyType *)
+void TpmsPlugin::getRangePropertyAsync(AsyncRangePropertyReply *reply)
 {
+       ///not supported
+       reply->completed(reply);
+}
 
+AsyncPropertyReply *TpmsPlugin::setProperty(AsyncSetPropertyRequest request )
+{
+       return NULL;
 }
 
 void TpmsPlugin::subscribeToPropertyChanges(VehicleProperty::Property property)
index 85bdfbe..189c91b 100644 (file)
@@ -32,7 +32,8 @@ public:
        
        string uuid();
        void getPropertyAsync(AsyncPropertyReply *reply);
-       void setProperty(VehicleProperty::Property, AbstractPropertyType*);
+       void getRangePropertyAsync(AsyncRangePropertyReply *reply);
+       AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
        void subscribeToPropertyChanges(VehicleProperty::Property property);
        void unsubscribeToPropertyChanges(VehicleProperty::Property property);
        PropertyList supported();