returns whether the parking lights are active (true) or inactive (false)
-Interface org.automotive.hazardLights
-Object path /org/automotive/parking/hazardLights
+Interface org.automotive.hazardLightsiiiiiiiiiiiiiooooooooo]Object path /org/automotive/parking/hazardLights
Properties:
bool HazardLights
for(auto itr = mMap.begin(); itr != mMap.end(); itr++)
{
- GVariant **v = g_new(GVariant*,2);
auto &foo = (*itr).first;
- v[0] = const_cast<T&>(foo).toVariant();
- v[1] = (*itr).second.toVariant();
- GVariant* tuple = g_variant_new_tuple(v,2);
+ g_variant_builder_add(¶ms,"{?*}",const_cast<T&>(foo).toVariant(),(*itr).second.toVariant());
- g_variant_builder_add_value(¶ms,tuple);
-
- g_free(v);
}
GVariant* var = g_variant_builder_end(¶ms);
return t;
});
+ registerPropertyPriv(ObstacleDistance,[]()
+ {
+ ObstacleDistanceType* t = new ObstacleDistanceType();
+ t->append(DistanceSensor::LeftFront,0);
+
+ return t;
+ });
+
REGISTERPROPERTY(RainSensor,0);
REGISTERPROPERTY(WindshieldWiper,Window::Off);
REGISTERPROPERTY(AirflowDirection,HVAC::Front);
registerPropertyPriv(Defrost, []()
{
DefrostType *d = new DefrostType();
- d->append(Window::Windshield,false);
+ d->append(Window::Windshield, false);
return d;
});
pkg_check_modules(gio REQUIRED gio-2.0)
-set(dbussinkplugin_headers dbusplugin.h abstractproperty.h abstractdbusinterface.h dbusinterfacemanager.h basicproperty.h runningstatus.h varianttype.h custompropertyinterface.h environmentproperties.h vehicleinfo.h maintenance.h parking.h fakeidlheader.h)
-set(dbussinkplugin_sources dbusplugin.cpp abstractproperty.cpp abstractdbusinterface.cpp dbusinterfacemanager.cpp basicproperty.cpp runningstatus.cpp varianttype.cpp custompropertyinterface.cpp environmentproperties.cpp vehicleinfo.cpp maintenance.cpp parking.cpp)
+set(dbussinkplugin_headers dbusplugin.h abstractproperty.h abstractdbusinterface.h dbusinterfacemanager.h basicproperty.h runningstatus.h varianttype.h
+custompropertyinterface.h environmentproperties.h vehicleinfo.h maintenance.h parking.h fakeidlheader.h drivingsafety.h)
+set(dbussinkplugin_sources dbusplugin.cpp abstractproperty.cpp abstractdbusinterface.cpp dbusinterfacemanager.cpp basicproperty.cpp runningstatus.cpp
+varianttype.cpp custompropertyinterface.cpp environmentproperties.cpp vehicleinfo.cpp maintenance.cpp parking.cpp drivingsafety.cpp)
add_library(dbussinkplugin MODULE ${dbussinkplugin_sources})
set_target_properties(dbussinkplugin PROPERTIES PREFIX "")
#include "vehicleinfo.h"
#include "maintenance.h"
#include "parking.h"
+#include "drivingsafety.h"
#define ConstructProperty(property) \
new property(iface->re, connection);
ConstructProperty(FuelProperty);
ConstructProperty(EngineOilProperty);
ConstructProperty(ExteriorBrightnessProperty);
+ ConstructProperty(Temperature);
+ ConstructProperty(RainSensor);
+ ConstructProperty(WindshieldWiper);
+ ConstructProperty(HVACProperty);
+ ConstructProperty(WindowStatusProperty);
+ ConstructProperty(Sunroof);
+ ConstructProperty(ConvertibleRoof);
ConstructProperty(VehicleId);
ConstructProperty(TransmissionInfoProperty);
ConstructProperty(VehicleTypeProperty);
ConstructProperty(DoorsProperty);
ConstructProperty(WheelInformationProperty);
ConstructProperty(OdometerProperty);
+ ConstructProperty(FluidProperty);
ConstructProperty(BatteryProperty);
ConstructProperty(SecurityAlertProperty);
ConstructProperty(ParkingBrakeProperty);
ConstructProperty(ParkingLightProperty);
ConstructProperty(HazardLightProperty);
ConstructProperty(LocationProperty);
+ ConstructProperty(AntilockBrakingSystemProperty);
+ ConstructProperty(TractionControlSystemProperty);
+ ConstructProperty(VehicleTopSpeedLimitProperty);
+ ConstructProperty(AirbagStatusProperty);
+ ConstructProperty(DoorStatusProperty);
+ ConstructProperty(SeatBeltStatusProperty);
+ ConstructProperty(OccupantStatusProperty);
+ ConstructProperty(ObstacleDistanceProperty);
PropertyList list = VehicleProperty::customProperties();
--- /dev/null
+#include "drivingsafety.h"
+#ifndef DRIVINGSAFETY_H_
+#define DRIVINGSAFETY_H_
+
+#include "dbusplugin.h"
+#include "abstractdbusinterface.h"
+#include "abstractroutingengine.h"
+
+/** @interface AntilockBrakingSystem : VehiclePropertyType **/
+class AntilockBrakingSystemProperty: public DBusSink
+{
+public:
+ AntilockBrakingSystemProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.AntilockBrakingSystem","/org/automotive/drivingSafety/AntilockBrakingSystem", re, connection, map<string, string>())
+ {
+
+ /** @attributeName AntilockBrakingSystem
+ * @type boolean
+ * @access readonly
+ * @attributeComment \brief MUST return whether Antilock Braking System is Idle (false) or Engaged (true)
+ **/
+ wantPropertyVariant(VehicleProperty::AntilockBrakingSystem, "AntilockBrakingSystem", "b", AbstractProperty::Read);
+
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface TractionControlSystem : VehiclePropertyType **/
+class TractionControlSystemProperty: public DBusSink
+{
+public:
+ TractionControlSystemProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.TractionControlSystem","/org/automotive/drivingSafety/TractionControlSystem", re, connection, map<string, string>())
+ {
+
+ /** @attributeName TractionControlSystem
+ * @type boolean
+ * @access readonly
+ * @attributeComment \brief MUST return whether Traction Control System is Off (false) or On (true)
+ **/
+ wantPropertyVariant(VehicleProperty::TractionControlSystem, "TractionControlSystem", "b", AbstractProperty::Read);
+
+
+ supportedChanged(re->supported());
+ }
+};
+
+
+/** @interface VehicleTopSpeedLimit : VehiclePropertyType **/
+class VehicleTopSpeedLimitProperty: public DBusSink
+{
+public:
+ VehicleTopSpeedLimitProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.VehicleTopSpeedLimit","/org/automotive/drivingSafety/VehicleTopSpeedLimit", re, connection, map<string, string>())
+ {
+
+ /** @attributeName VehicleTopSpeedLimit
+ * @type unsigned short
+ * @access readonly
+ * @attributeComment \brief MUST returns top rated speed in km/h. 0 = no limit
+ **/
+ wantPropertyVariant(VehicleProperty::VehicleTopSpeedLimit, "VehicleTopSpeedLimit", "q", AbstractProperty::Read);
+
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface AirbagStatus : VehiclePropertyType **/
+class AirbagStatusProperty: public DBusSink
+{
+public:
+ AirbagStatusProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.AirbagStatus","/org/automotive/drivingSafety/AirbagStatus", re, connection, map<string, string>())
+ {
+
+ /**
+ * @enum const unsigned short AIRBAGLOCATION_DRIVER = 0;
+ * @enum const unsigned short AIRBAGLOCATION_PASSENGER= 1;
+ * @enum const unsigned short AIRBAGLOCATION_LEFTSIDE = 2;
+ * @enum const unsigned short AIRBAGLOCATION_RIGHTSIDE = 3;
+ * @enum const unsigned short AIRBAGSTATUS_INACTIVE = 0;
+ * @enum const unsigned short AIRBAGSTATUS_ACTIVE = 1;
+ * @enum const unsigned short AIRBAGSTATUS_DEPLOYED = 2;
+ **/
+
+ /** @attributeName AirbagStatus
+ * @type object
+ * @access readonly
+ * @attributeComment \brief MUST returns a dictionary of Airbag (byte) and Status (byte) (see AIRBAGLOCATION_* and AIRBAGSTATUS_*)
+ **/
+ wantPropertyVariant(VehicleProperty::AirbagStatus, "AirbagStatus", "a{yy}", AbstractProperty::Read);
+
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface DoorStatus : VehiclePropertyType **/
+class DoorStatusProperty: public DBusSink
+{
+public:
+ DoorStatusProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.DoorStatus","/org/automotive/drivingSafety/DoorStatus", re, connection, map<string, string>())
+ {
+ /**
+ * @enum const unsigned short DOORLOCATION_DRIVER= 0;
+ * @enum const unsigned short DOORLOCATION_PASSENGER = 1;
+ * @enum const unsigned short DOORLOCATION_LEFTREAR = 2;
+ * @enum const unsigned short DOORLOCATION_RIGHTREAR = 3;
+ * @enum const unsigned short DOORLOCATION_TRUNK = 4;
+ * @enum const unsigned short DOORLOCATION_FUELCAP = 5;
+ * @enum const unsigned short DOORLOCATION_HOOD = 6;
+ * @enum const unsigned short DOORSTATUS_CLOSED = 0;
+ * @enum const unsigned short DOORSTATUS_OPEN = 1;
+ * @enum const unsigned short DOORSTATUS_AJAR = 2;
+ **/
+
+
+ /** @attributeName DoorStatus
+ * @type object
+ * @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);
+
+ /** @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);
+
+ /** @attributeName ChildLockStatus
+ * @type boolean
+ * @access readonly
+ * @attributeComment \brief MUST returns Child lock status of rear doors. active = true, inactive = false.
+ * @attributeComment Setting this to 'true' will prevent the rear doors from being opened
+ * @attributeComment from the inside.
+ **/
+ wantPropertyVariant(VehicleProperty::DoorLockStatus, "ChildLockStatus", "b", AbstractProperty::Read);
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface SeatBeltStatus : VehiclePropertyType **/
+class SeatBeltStatusProperty: public DBusSink
+{
+public:
+ SeatBeltStatusProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.SeatBeltStatus","/org/automotive/drivingSafety/SeatBeltStatus", re, connection, map<string, string>())
+ {
+ /**
+ * @enum const unsigned short SEATBELTLOCATION_DRIVER= 0;
+ * @enum const unsigned short SEATBELTLOCATION_MIDDLEFRONT = 1;
+ * @enum const unsigned short SEATBELTLOCATION_PASSENGER = 2;
+ * @enum const unsigned short SEATBELTLOCATION_LEFTREAR = 3;
+ * @enum const unsigned short SEATBELTLOCATION_MIDDLEREAR = 4;
+ * @enum const unsigned short SEATBELTLOCATION_RIGHTREAR = 5;
+ **/
+
+ /** @attributeName SeatBeltStatus
+ * @type object
+ * @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);
+
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface OccupantStatus : VehiclePropertyType **/
+class OccupantStatusProperty: public DBusSink
+{
+public:
+ OccupantStatusProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.OccupantStatus","/org/automotive/drivingSafety/OccupantStatus", re, connection, map<string, string>())
+ {
+
+
+ /**
+ * @enum const unsigned short OCCUPANTLOCATION_DRIVER = 0;
+ * @enum const unsigned short OCCUPANTLOCATION_PASSENGER= 1;
+ * @enum const unsigned short OCCUPANTLOCATION_LEFTSIDE = 2;
+ * @enum const unsigned short OCCUPANTLOCATION_RIGHTSIDE = 3;
+ * @enum const unsigned short OCCUPANTSTATUS_VACANT = 0;
+ * @enum const unsigned short OCCUPANTSTATUS_CHILD = 1;
+ * @enum const unsigned short OCCUPANTSTATUS_ADULT = 2;
+ **/
+
+ /** @attributeName OccupantStatus
+ * @type object
+ * @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);
+
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface ObstacleDistance : VehiclePropertyType **/
+class ObstacleDistanceProperty: public DBusSink
+{
+public:
+ ObstacleDistanceProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.ObstacleDistance","/org/automotive/drivingSafety/ObstacleDistance", re, connection, map<string, string>())
+ {
+ /**
+ * @enum const unsigned short DISTANCESENSORLOCATION_LEFTFRONT = 0;
+ * @enum const unsigned short DISTANCESENSORLOCATION_RIGHTFRONT = 1;
+ * @enum const unsigned short DISTANCESENSORLOCATION_LEFTREAR = 2;
+ * @enum const unsigned short DISTANCESENSORLOCATION_RIGHTREAR = 3;
+ * @enum const unsigned short DISTANCESENSORLOCATION_LEFTBLINDSPOT = 4;
+ * @enum const unsigned short DISTANCESENSORLOCATION_RIGHTBLINDSPOT = 5;
+ **/
+
+ /** @attributeName ObstacleDistance
+ * @type object
+ * @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);
+
+
+ supportedChanged(re->supported());
+ }
+};
+
+#endif
+
* @access readonly
* @attributeComment \brief Must return Level of windshield whiper speed (see WIPERSPEED_*)
*/
- wantProperty<Window::WiperSpeed>(VehicleProperty::RainSensor, "WindshieldWiper", "y", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::RainSensor, "WindshieldWiper", "y", AbstractProperty::ReadWrite);
supportedChanged(re->supported());
}
};
* @access readwrite
* @attributeComment \brief Must return airflow direction. See AIRFLOWDIRECTION_*.
*/
- wantProperty<HVAC::AirflowDirection>(VehicleProperty::AirflowDirection, "AirflowDirection", "y", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::AirflowDirection, "AirflowDirection", "y", AbstractProperty::ReadWrite);
/**
* @attributeName FanSpeed
* @access readwrite
* @attributeComment \brief Must return speed of the fan (0-7)
*/
- wantProperty<uint16_t>(VehicleProperty::FanSpeed, "FanSpeed", "y", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::FanSpeed, "FanSpeed", "y", AbstractProperty::ReadWrite);
/**
* @attributeName TargetTemperature
* @access readwrite
* @attributeComment \brief Must return target desired temperature in celcius.
*/
- wantProperty<uint16_t>(VehicleProperty::TargetTemperature, "TargetTemperature", "y", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::TargetTemperature, "TargetTemperature", "y", AbstractProperty::ReadWrite);
/**
* @attributeName AirConditioning
* @access readwrite
* @attributeComment \brief Must return air conditioning on (true) / off (false).
*/
- wantProperty<bool>(VehicleProperty::AirConditioning, "AirConditioning", "b", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::AirConditioning, "AirConditioning", "b", AbstractProperty::ReadWrite);
/**
* @attributeName AirRecirculation
* @access readwrite
* @attributeComment \brief Must return air recirculation on (true) / off (false).
*/
- wantProperty<bool>(VehicleProperty::AirRecirculation, "AirRecirculation", "b", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::AirRecirculation, "AirRecirculation", "b", AbstractProperty::ReadWrite);
/**
* @attributeName Heater
* @access readwrite
* @attributeComment \brief Must return heater on (true) / off (false).
*/
- wantProperty<bool>(VehicleProperty::Heater, "Heater", "b", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::Heater, "Heater", "b", AbstractProperty::ReadWrite);
/**
* @attributeName Defrost
* @access readwrite
* @attributeComment \brief Must return air recirculation on (true) / off (false).
*/
- wantProperty<bool>(VehicleProperty::AirRecirculation, "AirRecirculation", "b", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::AirRecirculation, "AirRecirculation", "b", AbstractProperty::ReadWrite);
/**
* @attributeName Defrost
* @attributeComment \brief Must return the defrost status of all windows equiped with defrosters. This will return a dictionary of { unsigned short, boolean } that represents
* @attributeComment \brief each window and its defrost status.
*/
- wantPropertyVariant(VehicleProperty::Defrost, "Defrost", "a(y,b)", AbstractProperty::ReadWrite);
+ //wantPropertyVariant(VehicleProperty::Defrost, "Defrost", "a(yb)", AbstractProperty::ReadWrite);
/**
* @attributeName SteeringWheelHeater
* @access readwrite
* @attributeComment \brief Must return air recirculation on (true) / off (false).
*/
- wantProperty<bool>(VehicleProperty::SteeringWheelHeater, "SteeringWheelHeater", "b", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::SteeringWheelHeater, "SteeringWheelHeater", "b", AbstractProperty::ReadWrite);
/**
* @attributeName SeatHeater
* @access readwrite
* @attributeComment \brief Must return seat heater status: on (true) / off (false).
*/
- wantProperty<bool>(VehicleProperty::SeatHeater, "SeatHeater", "b", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::SeatHeater, "SeatHeater", "b", AbstractProperty::ReadWrite);
/**
* @attributeName SeatCooler
* @access readwrite
* @attributeComment \brief Must return seat heater status: on (true) / off (false).
*/
- wantProperty<bool>(VehicleProperty::SeatCooler, "SeatCooler", "b", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::SeatCooler, "SeatCooler", "b", AbstractProperty::ReadWrite);
supportedChanged(re->supported());
}
};
/** @interface WindowStatus : VehiclePropertyType **/
-class WindowStatus: public DBusSink
+class WindowStatusProperty: public DBusSink
{
public:
- WindowStatus(AbstractRoutingEngine* re, GDBusConnection* connection)
+ WindowStatusProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
:DBusSink("org.automotive.WindowStatus","/org/automotive/environment/WindowStatus", re, connection, map<string, string>())
{
/**
* @access readwrite
* @attributeComment \brief Must return window status for each window location. object returned is a dictionary { unsigned short windowlocation, unsigned short percentage opened }
*/
- wantPropertyVariant(VehicleProperty::WindowStatus,"WindowStatus","a(b,b)", AbstractProperty::ReadWrite);
+ wantPropertyVariant(VehicleProperty::WindowStatus,"WindowStatus","a(bb)", AbstractProperty::ReadWrite);
}
};