summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevron Rees <tripzero.kev@gmail.com>2013-10-26 17:11:47 -0700
committerKevron Rees <tripzero.kev@gmail.com>2013-10-26 17:11:47 -0700
commitbe45a7350609dfd216dadfabee336e85a1331c13 (patch)
tree1e82412af7bcf5b72c918e7c2882a3b0b7a878f5
parent9520e8e1374b1a1e7a4ab677270fbf86b64c3da7 (diff)
downloadautomotive-message-broker-be45a7350609dfd216dadfabee336e85a1331c13.tar.gz
added a few more zone options. made zones a class. change propertyChanged signature and removed old function
-rw-r--r--ambd/core.cpp5
-rw-r--r--lib/abstractpropertytype.h44
-rw-r--r--lib/abstractroutingengine.h41
-rw-r--r--lib/abstractsink.h17
-rw-r--r--lib/vehicleproperty.cpp54
-rw-r--r--lib/vehicleproperty.h48
-rw-r--r--plugins/database/databasesink.cpp4
-rw-r--r--plugins/database/databasesink.h2
-rw-r--r--plugins/dbus/abstractproperty.h2
-rw-r--r--plugins/dbus/dbusplugin.cpp4
-rw-r--r--plugins/dbus/dbusplugin.h2
-rw-r--r--plugins/dbus/drivingsafety.h12
-rw-r--r--plugins/demosink/demosinkplugin.cpp2
-rw-r--r--plugins/demosink/demosinkplugin.h2
-rw-r--r--plugins/exampleplugin.cpp18
-rw-r--r--plugins/examplesink.cpp2
-rw-r--r--plugins/examplesink.h2
-rw-r--r--plugins/gpsd/gpsdplugin.cpp2
-rw-r--r--plugins/gpsd/gpsdplugin.h4
-rw-r--r--plugins/gpsnmea/gpsnmea.h1
-rw-r--r--plugins/testplugin/testplugin.cpp8
-rw-r--r--plugins/websocketsink/websocketsink.cpp2
-rw-r--r--plugins/websocketsink/websocketsink.h2
23 files changed, 125 insertions, 155 deletions
diff --git a/ambd/core.cpp b/ambd/core.cpp
index 13d02421..fd7e487a 100644
--- a/ambd/core.cpp
+++ b/ambd/core.cpp
@@ -185,7 +185,7 @@ void Core::updateProperty(AbstractPropertyType *value, const string &uuid)
value->sourceUuid = uuid;
}
- sink->propertyChanged(value, uuid);
+ sink->propertyChanged(value);
}
}
}
@@ -331,7 +331,8 @@ void Core::subscribeToProperty(VehicleProperty::Property property, string source
void Core::subscribeToProperty(VehicleProperty::Property, string sourceUuidFilter, Zone::Type zoneFilter, AbstractSink *self)
{
-
+ /// TODO: implement
+ throw std::runtime_error("Not implemented");
}
void Core::unsubscribeToProperty(VehicleProperty::Property property, AbstractSink* self)
diff --git a/lib/abstractpropertytype.h b/lib/abstractpropertytype.h
index 10c0498b..ebe1cf57 100644
--- a/lib/abstractpropertytype.h
+++ b/lib/abstractpropertytype.h
@@ -34,28 +34,36 @@
#include <debugout.h>
#include <boost/algorithm/string.hpp>
-namespace Zone {
-
-enum Type {
- None = 0,
- Front = 1,
- Middle = 1 << 1,
- Right = 1 << 2,
- Left = 1 << 3,
- Rear = 1 << 4,
- Center = 1 << 5
-};
+class Zone {
+
+public:
-const Zone::Type FrontRight = Zone::Type(Front | Right);
-const Zone::Type FrontLeft = Zone::Type(Front | Left);
-const Zone::Type MiddleRight = Zone::Type(Middle | Right);
-const Zone::Type MiddleLeft = Zone::Type(Middle | Left);
-const Zone::Type RearRight = Zone::Type(Rear | Right);
-const Zone::Type RearLeft = Zone::Type(Rear | Left);
+ typedef int Type;
+
+ enum {
+ None = 0,
+ Front = 1,
+ Middle = 1 << 1,
+ Right = 1 << 2,
+ Left = 1 << 3,
+ Rear = 1 << 4,
+ Center = 1 << 5,
+ LeftSide = 1 << 6,
+ RightSide = 1 << 7,
+ FrontSide = 1 << 8,
+ BackSide = 1 << 9
+ };
+
+static const Zone::Type FrontRight = Zone::Type(Front | Right);
+static const Zone::Type FrontLeft = Zone::Type(Front | Left);
+static const Zone::Type MiddleRight = Zone::Type(Middle | Right);
+static const Zone::Type MiddleLeft = Zone::Type(Middle | Left);
+static const Zone::Type RearRight = Zone::Type(Rear | Right);
+static const Zone::Type RearLeft = Zone::Type(Rear | Left);
typedef std::list<Zone::Type> ZoneList;
-}
+};
class AbstractPropertyType
{
diff --git a/lib/abstractroutingengine.h b/lib/abstractroutingengine.h
index 955283d4..f6273bd2 100644
--- a/lib/abstractroutingengine.h
+++ b/lib/abstractroutingengine.h
@@ -377,11 +377,46 @@ public:
* \see AsyncPropertyReply
* \param request the request containing the property and the value to set
* \return a pointer to the reply which is owned by the caller of this method
+ * \example
*/
virtual AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request) = 0;
- virtual void subscribeToProperty(VehicleProperty::Property, AbstractSink* self) = 0;
- virtual void subscribeToProperty(VehicleProperty::Property, std::string sourceUuidFilter, AbstractSink *self) = 0;
- virtual void subscribeToProperty(VehicleProperty::Property, std::string sourceUuidFilter, Zone::Type zoneFilter, AbstractSink *self) = 0;
+
+ /*!
+ * \brief subscribeToProperty subscribe to changes made to a property value.
+ * \param propertyName name of the property to request a subscription for.
+ * \param self pointer to the sink who is subscribing.
+ * \example
+ * //somewhere in the sink:
+ * routingEngine->subscribeToProperty(VehicleProperty::EngineSpeed, this);
+ *
+ * //... elsewhere in the sink, this will be called when a property changes:
+ * void MySink::propertyChanged(const AbstractPropertyType* property)
+ * {
+ * if(property->name == VehicleProperty::EngineSpeed)
+ * {
+ * ...
+ * }
+ * }
+ */
+ virtual void subscribeToProperty(VehicleProperty::Property propertyName, AbstractSink* self) = 0;
+
+ /*!
+ * \brief subscribeToProperty subscribe to changes made to a property value.
+ * \param propertyName name of the property to request a subscription for.
+ * \param sourceUuidFilter source UUID to filter. Only property updates from this source will be sent to the sink.
+ * \param self pointer to the sink who is subscribing.
+ */
+ virtual void subscribeToProperty(VehicleProperty::Property propertyName, std::string sourceUuidFilter, AbstractSink *self) = 0;
+
+ /*!
+ * \brief subscribeToProperty subscribe to changes made to a property value.
+ * \param propertyName name of the property to request a subscription for.
+ * \param sourceUuidFilter source UUID to filter. Only property updates from this source will be sent to the sink.
+ * \param zoneFilter zone to filter. Only updates from this zone will be passed to the sink.
+ * \param self pointer to the sink who is subscribing.
+ */
+ virtual void subscribeToProperty(VehicleProperty::Property propertyName, std::string sourceUuidFilter, Zone::Type zoneFilter, AbstractSink *self) = 0;
+
virtual void unsubscribeToProperty(VehicleProperty::Property, AbstractSink* self) = 0;
virtual PropertyInfo getPropertyInfo(VehicleProperty::Property, std::string sourceUuid) = 0;
diff --git a/lib/abstractsink.h b/lib/abstractsink.h
index 40bd9eea..cf9c7de8 100644
--- a/lib/abstractsink.h
+++ b/lib/abstractsink.h
@@ -50,22 +50,13 @@ public:
*/
virtual const string uuid() = 0;
-
- /// Deprecated:
- virtual void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, string uuid)
- {
- DebugOut(DebugOut::Warning)<<"propertyChanged(VehicleProperty::Property, AbstractPropertyType*,string) is deprecated. Use propertyChanged(AbstractPropertyType*, const string &)"<<endl;
- propertyChanged(value, uuid);
- }
-
- /*! propertyChanged is called when a subscribed to property changes.
- * @see AbstractRoutingEngine::subscribeToPropertyChanges()
- * @param value value of the property that changed. this is a temporary pointer that will be destroyed.
+ /*! \brief propertyChanged is called when a subscribed to property changes.
+ * \see AbstractRoutingEngine::subscribeToPropertyChanges()
+ * \param value value of the property that changed. this is a temporary pointer that will be destroyed.
* Do not destroy it. If you need to store the value use value.anyValue(), value.value<T>() or
* value->copy() to copy.
- * @param uuid Unique identifier representing the source
*/
- virtual void propertyChanged(AbstractPropertyType* value, const string &uuid) {}
+ virtual void propertyChanged(AbstractPropertyType *value){ (void)value; }
/*! supportedChanged() is called when the supported properties changes
* @arg supportedProperties the new list of supported properties.
diff --git a/lib/vehicleproperty.cpp b/lib/vehicleproperty.cpp
index 3ab20c0f..c45bdd93 100644
--- a/lib/vehicleproperty.cpp
+++ b/lib/vehicleproperty.cpp
@@ -126,6 +126,7 @@ const VehicleProperty::Property VehicleProperty::TractionControlSystem = "Tracti
const VehicleProperty::Property VehicleProperty::VehicleTopSpeedLimit = "VehicleTopSpeedLimit";
const VehicleProperty::Property VehicleProperty::DoorStatus = "DoorStatus";
const VehicleProperty::Property VehicleProperty::DoorLockStatus = "DoorLockStatus";
+const VehicleProperty::Property VehicleProperty::ChildLockStatus = "ChildLockStatus";
const VehicleProperty::Property VehicleProperty::SeatBeltStatus = "SeatBeltStatus";
const VehicleProperty::Property VehicleProperty::WindowLockStatus = "WindowLockStatus";
const VehicleProperty::Property VehicleProperty::OccupantStatus = "OccupantStatus";
@@ -249,53 +250,14 @@ VehicleProperty::VehicleProperty()
REGISTERPROPERTY(TractionControlSystem,false);
REGISTERPROPERTY(VehicleTopSpeedLimit,0);
- registerPropertyPriv(DoorStatus,[]()
- {
- DoorStatusType* t = new DoorStatusType();
- t->append(Door::Driver,Door::Closed);
-
- return t;
- });
-
- registerPropertyPriv(DoorLockStatus,[]()
- {
- DoorLockStatusType* t = new DoorLockStatusType();
- t->append(Door::Driver,false);
-
- return t;
- });
-
- registerPropertyPriv(SeatBeltStatus,[]()
- {
- SeatBeltStatusType* t = new SeatBeltStatusType();
- t->append(Seat::Driver,false);
-
- return t;
- });
- registerPropertyPriv(OccupantStatus,[]()
- {
- OccupantStatusType* t = new OccupantStatusType();
- t->append(Seat::Driver,false);
-
- return t;
- });
-
- registerPropertyPriv(WindowLockStatus,[]()
- {
- WindowLockStatusType* t = new WindowLockStatusType();
- t->append(Window::Driver,false);
-
- return t;
- });
-
- registerPropertyPriv(ObstacleDistance,[]()
- {
- ObstacleDistanceType* t = new ObstacleDistanceType();
- t->append(DistanceSensor::LeftFront,0);
-
- return t;
- });
+ REGISTERPROPERTY(DoorStatus, Door::Closed);
+ REGISTERPROPERTY(DoorLockStatus, false);
+ REGISTERPROPERTY(ChildLockStatus, false);
+ REGISTERPROPERTY(SeatBeltStatus, false);
+ REGISTERPROPERTY(OccupantStatus, Seat::Vacant);
+ REGISTERPROPERTY(WindowLockStatus, false);
+ REGISTERPROPERTY(ObstacleDistance, 0);
REGISTERPROPERTY(RainSensor,0);
REGISTERPROPERTY(WindshieldWiper,Window::Off);
diff --git a/lib/vehicleproperty.h b/lib/vehicleproperty.h
index 0f03ff5b..5803b069 100644
--- a/lib/vehicleproperty.h
+++ b/lib/vehicleproperty.h
@@ -166,40 +166,20 @@ enum Status
}
-namespace Door {
-enum Location
+namespace Door
{
- Driver=0,
- Passenger,
- LeftRear,
- RightRear,
- Trunk,
- FuelCap,
- Hood
-};
-
enum Status
{
Closed = 0,
Open,
Ajar
};
-
}
namespace Seat
{
-enum Location
-{
- Driver = 0,
- FrontMiddle = 1,
- Passenger,
- LeftRear,
- MiddleRear,
- RightRear
-};
-enum Status
+enum Occupant
{
Vacant = 0,
Child,
@@ -419,7 +399,7 @@ public:
static const Property AccelerationZ;
PROPERTYTYPE(AccelerationZ, AccelerationZType, BasicPropertyType<uint16_t>, uint16_t)
- /**< Mass Air Flow. TODO: units */
+ /**< Mass Air Flow. grams/sec */
static const Property MassAirFlow;
PROPERTYTYPE(MassAirFlow, MassAirFlowType, BasicPropertyType<uint16_t>, uint16_t)
//typedef BasicPropertyType<uint16_t> MassAirFlowType;
@@ -694,29 +674,25 @@ public:
PROPERTYTYPEBASIC(AirbagStatus, Airbag::Status)
static const Property DoorStatus;
- PROPERTYTYPENOVAL(DoorStatus, DoorStatusType,
- MapPropertyType<BasicPropertyType<Door::Location> BOOST_PP_COMMA() BasicPropertyType<Door::Status> >)
- //typedef MapPropertyType<BasicPropertyType<Door::Location>, BasicPropertyType<Door::Status> > DoorStatusType;
+ PROPERTYTYPEBASIC(DoorStatus, Door::Status)
static const Property DoorLockStatus;
- PROPERTYTYPENOVAL(DoorLockStatus, DoorLockStatusType,
- MapPropertyType<BasicPropertyType<Door::Location> BOOST_PP_COMMA() BasicPropertyType<bool> > )
+ PROPERTYTYPEBASIC(DoorLockStatus, bool)
+
+ static const Property ChildLockStatus;
+ PROPERTYTYPEBASIC(ChildLockStatus, bool)
static const Property SeatBeltStatus;
- PROPERTYTYPENOVAL(SeatBeltStatus, SeatBeltStatusType,
- MapPropertyType<BasicPropertyType<Seat::Location> BOOST_PP_COMMA() BasicPropertyType<bool> >)
+ PROPERTYTYPEBASIC(SeatBeltStatus, bool)
static const Property WindowLockStatus;
- PROPERTYTYPENOVAL(WindowLockStatus, WindowLockStatusType,
- MapPropertyType<BasicPropertyType<Window::Location> BOOST_PP_COMMA() BasicPropertyType<bool> > )
+ PROPERTYTYPEBASIC(WindowLockStatus, bool )
static const Property OccupantStatus;
- PROPERTYTYPENOVAL(OccupantStatus, OccupantStatusType,
- MapPropertyType<BasicPropertyType<Seat::Location> BOOST_PP_COMMA() BasicPropertyType<bool> > )
+ PROPERTYTYPEBASIC(OccupantStatus, Seat::Occupant)
static const Property ObstacleDistance;
- PROPERTYTYPENOVAL(ObstacleDistance, ObstacleDistanceType,
- MapPropertyType<BasicPropertyType<DistanceSensor::Location> BOOST_PP_COMMA() BasicPropertyType<double> > )
+ PROPERTYTYPEBASIC(ObstacleDistance, double)
static const Property RainSensor;
PROPERTYTYPEBASIC(RainSensor, uint16_t)
diff --git a/plugins/database/databasesink.cpp b/plugins/database/databasesink.cpp
index 60ff7e05..00698695 100644
--- a/plugins/database/databasesink.cpp
+++ b/plugins/database/databasesink.cpp
@@ -372,7 +372,7 @@ void DatabaseSink::setDatabaseFileName(string filename)
routingEngine->setSupported(mSupported, this);
}
-void DatabaseSink::propertyChanged(AbstractPropertyType *value, const std::string &uuid)
+void DatabaseSink::propertyChanged(AbstractPropertyType *value)
{
VehicleProperty::Property property = value->name;
@@ -388,7 +388,7 @@ void DatabaseSink::propertyChanged(AbstractPropertyType *value, const std::strin
DBObject* obj = new DBObject;
obj->key = property;
obj->value = value->toString();
- obj->source = uuid;
+ obj->source = value->sourceUuid;
obj->time = value->timestamp;
obj->sequence = value->sequence;
diff --git a/plugins/database/databasesink.h b/plugins/database/databasesink.h
index 7b6dc0fa..cd4c28fc 100644
--- a/plugins/database/databasesink.h
+++ b/plugins/database/databasesink.h
@@ -150,7 +150,7 @@ public:
DatabaseSink(AbstractRoutingEngine* engine, map<string, string> config);
~DatabaseSink();
virtual void supportedChanged(PropertyList supportedProperties);
- virtual void propertyChanged(AbstractPropertyType *value, const std::string &uuid);
+ virtual void propertyChanged(AbstractPropertyType *value);
const std::string uuid();
///source role:
diff --git a/plugins/dbus/abstractproperty.h b/plugins/dbus/abstractproperty.h
index 4eb3f7fd..00ea8f53 100644
--- a/plugins/dbus/abstractproperty.h
+++ b/plugins/dbus/abstractproperty.h
@@ -97,7 +97,7 @@ public:
PropertyInfo info = routingEngine->getPropertyInfo(val->name, val->sourceUuid);
- mValue = val->copy();
+ mValue = val;
mAnyValue = val->anyValue();
mTimestamp = val->timestamp;
if(info.isValid())
diff --git a/plugins/dbus/dbusplugin.cpp b/plugins/dbus/dbusplugin.cpp
index c51ca264..19f71d2e 100644
--- a/plugins/dbus/dbusplugin.cpp
+++ b/plugins/dbus/dbusplugin.cpp
@@ -61,7 +61,7 @@ void DBusSink::supportedChanged(PropertyList supportedProperties)
unregisterObject();
}
-void DBusSink::propertyChanged(AbstractPropertyType *value, const std::string &uuid)
+void DBusSink::propertyChanged(AbstractPropertyType *value)
{
VehicleProperty::Property property = value->name;
@@ -69,7 +69,7 @@ void DBusSink::propertyChanged(AbstractPropertyType *value, const std::string &u
return;
AbstractProperty* prop = propertyDBusMap[property];
- prop->setValue(value);
+ prop->setValue(value->copy());
mTime = value->timestamp;
}
diff --git a/plugins/dbus/dbusplugin.h b/plugins/dbus/dbusplugin.h
index 67bb12ad..789a801b 100644
--- a/plugins/dbus/dbusplugin.h
+++ b/plugins/dbus/dbusplugin.h
@@ -36,7 +36,7 @@ public:
DBusSink(std::string objectName, AbstractRoutingEngine* engine, GDBusConnection* connection, map<string, string> config);
virtual ~DBusSink() { }
virtual void supportedChanged(PropertyList supportedProperties);
- virtual void propertyChanged(AbstractPropertyType *value, const std::string &uuid);
+ virtual void propertyChanged(AbstractPropertyType *value);
virtual const std::string uuid();
std::list<VehicleProperty::Property> wantsProperties()
diff --git a/plugins/dbus/drivingsafety.h b/plugins/dbus/drivingsafety.h
index e97ee4d2..80ff1496 100644
--- a/plugins/dbus/drivingsafety.h
+++ b/plugins/dbus/drivingsafety.h
@@ -118,14 +118,14 @@ public:
* @access readonly
* @attributeComment \brief MUST returns dictionary of Door (byte) and Status (byte). See DOORLOCATION_* and DOORSTATUS_*
**/
- wantPropertyVariant(VehicleProperty::DoorStatus, "DoorStatus", "a(yy)", AbstractProperty::Read);
+ wantPropertyVariant(VehicleProperty::DoorStatus, "DoorStatus", "b", AbstractProperty::Read);
/** @attributeName DoorLockStatus
* @type object
* @access readonly
* @attributeComment \brief MUST returns dictionary of Door (byte) and Status (bool locked = true, unlocked = false). See DOORLOCATION_*.
**/
- wantPropertyVariant(VehicleProperty::DoorLockStatus, "DoorLockStatus", "a(yb)", AbstractProperty::Read);
+ wantPropertyVariant(VehicleProperty::DoorLockStatus, "DoorLockStatus", "b", AbstractProperty::Read);
/** @attributeName ChildLockStatus
* @type boolean
@@ -134,7 +134,7 @@ public:
* @attributeComment Setting this to 'true' will prevent the rear doors from being opened
* @attributeComment from the inside.
**/
- wantPropertyVariant(VehicleProperty::DoorLockStatus, "ChildLockStatus", "b", AbstractProperty::Read);
+ wantPropertyVariant(VehicleProperty::ChildLockStatus, "ChildLockStatus", "b", AbstractProperty::Read);
}
@@ -161,7 +161,7 @@ public:
* @access readonly
* @attributeComment \brief MUST returns dictionary of Seat Belt (byte, see SEATBELTLOCATION) and Status (bool: Fasten = true, Unfastened = false)
**/
- wantPropertyVariant(VehicleProperty::SeatBeltStatus, "SeatBeltStatus", "a(yb)", AbstractProperty::Read);
+ wantPropertyVariant(VehicleProperty::SeatBeltStatus, "SeatBeltStatus", "b", AbstractProperty::Read);
@@ -194,7 +194,7 @@ public:
* @access readonly
* @attributeComment \brief MUST returns dictionary of Occupant (byte see OCCUPANTLOCATION) and Status (byte, see OCCUPANTSTATUS_*)
**/
- wantPropertyVariant(VehicleProperty::OccupantStatus, "OccupantStatus", "a(yy)", AbstractProperty::Read);
+ wantPropertyVariant(VehicleProperty::OccupantStatus, "OccupantStatus", "i", AbstractProperty::Read);
@@ -222,7 +222,7 @@ public:
* @access readonly
* @attributeComment \brief MUST returns dictionary of Distance Sensor (byte, see DISTANCESENSORLOCATION) and distance (double) in m.
**/
- wantPropertyVariant(VehicleProperty::ObstacleDistance, "ObstacleDistance", "a{yd}", AbstractProperty::Read);
+ wantPropertyVariant(VehicleProperty::ObstacleDistance, "ObstacleDistance", "d", AbstractProperty::Read);
diff --git a/plugins/demosink/demosinkplugin.cpp b/plugins/demosink/demosinkplugin.cpp
index b76d98e1..38f86fec 100644
--- a/plugins/demosink/demosinkplugin.cpp
+++ b/plugins/demosink/demosinkplugin.cpp
@@ -76,7 +76,7 @@ const string DemoSink::uuid()
return "5b0e8a04-d6d7-43af-b827-1663627a25d9";
}
-void DemoSink::propertyChanged(AbstractPropertyType *value, const string &uuid)
+void DemoSink::propertyChanged(AbstractPropertyType *value)
{
VehicleProperty::Property property = value->name;
diff --git a/plugins/demosink/demosinkplugin.h b/plugins/demosink/demosinkplugin.h
index c19331dc..f77e413b 100644
--- a/plugins/demosink/demosinkplugin.h
+++ b/plugins/demosink/demosinkplugin.h
@@ -33,7 +33,7 @@ public:
const string uuid();
- void propertyChanged(AbstractPropertyType* value, const string &uuid);
+ void propertyChanged( AbstractPropertyType* value);
void supportedChanged(PropertyList);
friend class WheelPrivate;
diff --git a/plugins/exampleplugin.cpp b/plugins/exampleplugin.cpp
index 49f332df..63bedd88 100644
--- a/plugins/exampleplugin.cpp
+++ b/plugins/exampleplugin.cpp
@@ -65,15 +65,15 @@ ExampleSourcePlugin::ExampleSourcePlugin(AbstractRoutingEngine* re, map<string,
addPropertySupport(VehicleProperty::AirbagStatus, Zone::FrontLeft);
Zone::ZoneList airbagZones;
- airbagZones.push_back(Zone::FrontLeft);
- airbagZones.push_back(Zone::FrontRight);
- airbagZones.push_back(Zone::RearLeft);
- airbagZones.push_back(Zone::RearRight);
-
- airbagStatus[Zone::FrontLeft] = Airbag::Active;
- airbagStatus[Zone::FrontRight] = Airbag::Inactive;
- airbagStatus[Zone::RearLeft] = Airbag::Deployed;
- airbagStatus[Zone::RearRight] = Airbag::Deployed;
+ airbagZones.push_back(Zone::FrontLeft | Zone::FrontSide);
+ airbagZones.push_back(Zone::FrontRight | Zone::FrontSide);
+ airbagZones.push_back(Zone::RearLeft | Zone::LeftSide);
+ airbagZones.push_back(Zone::RearRight | Zone::RightSide);
+
+ airbagStatus[Zone::FrontLeft | Zone::FrontSide] = Airbag::Active;
+ airbagStatus[Zone::FrontRight | Zone::FrontSide] = Airbag::Inactive;
+ airbagStatus[Zone::RearLeft | Zone::LeftSide] = Airbag::Deployed;
+ airbagStatus[Zone::RearRight | Zone::RightSide] = Airbag::Deployed;
PropertyInfo airbagInfo(0,airbagZones);
diff --git a/plugins/examplesink.cpp b/plugins/examplesink.cpp
index ef05d160..26a1bec1 100644
--- a/plugins/examplesink.cpp
+++ b/plugins/examplesink.cpp
@@ -194,7 +194,7 @@ void ExampleSink::supportedChanged(PropertyList supportedProperties)
g_timeout_add(10000, getRangedCb, routingEngine);
}
-void ExampleSink::propertyChanged(AbstractPropertyType* value, const string &uuid)
+void ExampleSink::propertyChanged(AbstractPropertyType *value)
{
VehicleProperty::Property property = value->name;
DebugOut()<<property<<" value: "<<value->toString()<<endl;
diff --git a/plugins/examplesink.h b/plugins/examplesink.h
index 1ef85972..3013c0c4 100644
--- a/plugins/examplesink.h
+++ b/plugins/examplesink.h
@@ -30,7 +30,7 @@ public:
ExampleSink(AbstractRoutingEngine* engine, map<string, string> config);
virtual PropertyList subscriptions();
virtual void supportedChanged(PropertyList supportedProperties);
- virtual void propertyChanged(AbstractPropertyType* value, const std::string &uuid);
+ virtual void propertyChanged( AbstractPropertyType* value);
virtual const std::string uuid();
};
diff --git a/plugins/gpsd/gpsdplugin.cpp b/plugins/gpsd/gpsdplugin.cpp
index 6e50edcf..e234516d 100644
--- a/plugins/gpsd/gpsdplugin.cpp
+++ b/plugins/gpsd/gpsdplugin.cpp
@@ -116,7 +116,7 @@ extern "C" AbstractSource * create(AbstractRoutingEngine* routingengine, map<str
}
-string GpsdPlugin::uuid()
+const string GpsdPlugin::uuid()
{
return "326011dd-65cd-4be6-a75e-3e8d46a05b5e";
}
diff --git a/plugins/gpsd/gpsdplugin.h b/plugins/gpsd/gpsdplugin.h
index caaf33b5..6d9bdc2f 100644
--- a/plugins/gpsd/gpsdplugin.h
+++ b/plugins/gpsd/gpsdplugin.h
@@ -51,7 +51,7 @@ public:
GpsdPlugin(AbstractRoutingEngine* re, map<string, string> config);
~GpsdPlugin();
- string uuid();
+ const string uuid();
void getPropertyAsync(AsyncPropertyReply *reply);
void getRangePropertyAsync(AsyncRangePropertyReply *reply);
AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
@@ -60,8 +60,6 @@ public:
PropertyList supported();
int supportedOperations();
-
- void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, string uuid) {}
void supportedChanged(PropertyList) {}
void updateProperty();
diff --git a/plugins/gpsnmea/gpsnmea.h b/plugins/gpsnmea/gpsnmea.h
index c260604a..3791f7c5 100644
--- a/plugins/gpsnmea/gpsnmea.h
+++ b/plugins/gpsnmea/gpsnmea.h
@@ -45,7 +45,6 @@ public:
int supportedOperations();
- void propertyChanged(VehicleProperty::Property property, AbstractPropertyType* value, string uuid) {}
void supportedChanged(PropertyList) {}
PropertyInfo getPropertyInfo(VehicleProperty::Property property)
diff --git a/plugins/testplugin/testplugin.cpp b/plugins/testplugin/testplugin.cpp
index d3298d50..2cdc2fd1 100644
--- a/plugins/testplugin/testplugin.cpp
+++ b/plugins/testplugin/testplugin.cpp
@@ -55,15 +55,15 @@ TestPlugin::TestPlugin(AbstractRoutingEngine *re, map<string, string> config)
: AbstractSource(re, config)
{
DebugOut() << "Testing MapPropertyType... " << endl;
- MapPropertyType<BasicPropertyType<Door::Location>,BasicPropertyType<Door::Status>> propmap("something");
- MapPropertyType<BasicPropertyType<Door::Location>,BasicPropertyType<Door::Status>> propmaptwo("something");
- propmap.append(Door::LeftRear,Door::Ajar);
+ MapPropertyType<BasicPropertyType<Zone::Type>,BasicPropertyType<Door::Status>> propmap("something");
+ MapPropertyType<BasicPropertyType<Zone::Type>,BasicPropertyType<Door::Status>> propmaptwo("something");
+ propmap.append(Zone::RearLeft,Door::Ajar);
GVariant *var = propmap.toVariant();
gsize dictsize = g_variant_n_children(var);
//DebugOut() << var << endl;
propmaptwo.fromVariant(var);
- g_assert(propmap.toString() == propmap.toString());
+ g_assert(propmaptwo.toString() == propmap.toString());
DebugOut() << "Testing ListPropertyType... " << endl;
VehicleProperty::TripMetersType* tfirst = new VehicleProperty::TripMetersType();
diff --git a/plugins/websocketsink/websocketsink.cpp b/plugins/websocketsink/websocketsink.cpp
index 5b09ef6f..a9597a10 100644
--- a/plugins/websocketsink/websocketsink.cpp
+++ b/plugins/websocketsink/websocketsink.cpp
@@ -45,7 +45,7 @@ const string WebSocketSink::uuid()
{
return m_uuid;
}
-void WebSocketSink::propertyChanged(AbstractPropertyType *value, const string &uuid)
+void WebSocketSink::propertyChanged(AbstractPropertyType *value)
{
VehicleProperty::Property property = value->name;
diff --git a/plugins/websocketsink/websocketsink.h b/plugins/websocketsink/websocketsink.h
index 9c7a2888..94d4b695 100644
--- a/plugins/websocketsink/websocketsink.h
+++ b/plugins/websocketsink/websocketsink.h
@@ -30,7 +30,7 @@ public:
WebSocketSink(AbstractRoutingEngine* re,libwebsocket *wsi,string uuid,VehicleProperty::Property property,std::string ambdproperty);
~WebSocketSink();
const string uuid() ;
- void propertyChanged(AbstractPropertyType *value, const std::string &uuid);
+ void propertyChanged(AbstractPropertyType *value);
void supportedChanged(PropertyList supportedProperties);
PropertyList subscriptions();
libwebsocket *socket() { return m_wsi; }