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")
class AbstractSink;
class AbstractSource;
class AsyncPropertyReply;
+class AsyncRangePropertyReply;
typedef std::function<void (AsyncPropertyReply*)> GetPropertyCompletedSignal;
+typedef std::function<void (AsyncRangePropertyReply*)> GetRangedPropertyCompletedSignal;
class PropertyValueTime {
public:
AbstractPropertyType* value;
};
-class AsyncRangePropertyRequest: public AsyncPropertyRequest
+class AsyncRangePropertyRequest
{
public:
AsyncRangePropertyRequest()
}
- 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;
this->end = request.end;
}
+ VehicleProperty::Property property;
+ GetRangedPropertyCompletedSignal completed;
time_t begin;
time_t end;
};
{
public:
AsyncRangePropertyReply(AsyncRangePropertyRequest request)
- :AsyncRangePropertyRequest(request)
+ :AsyncRangePropertyRequest(request), success(false)
{
}
std::list<PropertyValueTime*> values;
+ bool success;
};
class AbstractRoutingEngine
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);
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];
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)
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();