attribute boolean SteeringWheelHeater;
/** SeatHeater
- * \brief Must return seat heater status: on (true) / off (false).
+ * \brief Must return seat heater status: 0-100%.
**/
- attribute boolean SeatHeater;
+ attribute unsigned short SeatHeater;
/** SeatCooler
* \brief Must return seat heater status: on (true) / off (false).
});
REGISTERPROPERTY(SteeringWheelHeater,false);
- REGISTERPROPERTY(SeatHeater, false);
+ REGISTERPROPERTY(SeatHeater, 0);
REGISTERPROPERTY(SeatCooler, false);
registerPropertyPriv(WindowStatus, []()
{
//typedef BasicPropertyType<bool> SteeringWheelHeaterType;
static const Property SeatHeater;
- PROPERTYTYPEBASIC(SeatHeater,bool)
+ PROPERTYTYPEBASIC(SeatHeater,int)
//typedef BasicPropertyType<bool> SeatHeaterType;
static const Property SeatCooler;
///see which properties are supported:
introspectionXml +=
- "<property type='"+ property->signature() + "' name='"+ pn +"' access='"+access+"' />"
+ "<property type='"+ string(property->signature()) + "' name='"+ pn +"' access='"+access+"' />"
"<method name='Get" + pn + "'>"
" <arg type='v' direction='out' name='value' />"
" <arg type='d' direction='out' name='timestamp' />"
#include "abstractproperty.h"
#include "abstractdbusinterface.h"
-AbstractProperty::AbstractProperty(string pn, string sig, Access access, AbstractDBusInterface* interface)
- : mPropertyName(pn), mSignature(sig), mAccess(access), mInterface(interface), mValue(NULL), mZoneFilter(Zone::None), mUpdateFrequency(0)
+AbstractProperty::AbstractProperty(string pn, Access access, AbstractDBusInterface* interface)
+ : mPropertyName(pn), mAccess(access), mInterface(interface), mValue(NULL), mZoneFilter(Zone::None), mUpdateFrequency(0)
{
}
ReadWrite
};
- AbstractProperty(string propertyName, string signature, Access access, AbstractDBusInterface* interface);
+ AbstractProperty(string propertyName, Access access, AbstractDBusInterface* interface);
virtual void setSetterFunction(SetterFunc setterFunc)
{
mSetterFunc = setterFunc;
}
- virtual string signature()
+ virtual const char* signature()
{
- return mSignature;
+ GVariant* var = toGVariant();
+ if(!var) return "";
+
+ const char * s = g_variant_get_type_string(var);
+ g_variant_unref(var);
+ return s;
}
virtual string name()
string mPropertyName;
VehicleProperty::Property mAmbPropertyName;
- string mSignature;
SetterFunc mSetterFunc;
Access mAccess;
AbstractPropertyType* mValue;
#include "listplusplus.h"
VariantType::VariantType(AbstractRoutingEngine* re, std::string signature, VehicleProperty::Property ambPropertyName, std::string propertyName, Access access, AbstractDBusInterface *interface)
- :AbstractProperty(propertyName, signature, access, interface), mInitialized(false)
+ :AbstractProperty(propertyName, access, interface), mInitialized(false)
{
mAmbPropertyName = ambPropertyName;
routingEngine = re;