- websocket source may want to implement a timeout on Get/Set/GetRanged calls and reply with success=false (TEST)
- enable ssl on websocket by default with option to turn it off
- investigate and enable use of provisioning in ssl websockets
-- support custom vendor properties in dbus sink
+- add API to get number of sources per a given property
+- DBus support for objects with multiple sources (ie battery(n)Voltage where 'n' is a battery source)
=================
Service org.automotive
-Interface org.automotive.maintenance
-Object path /
-Properties uint32 Odometer [readonly]
+
+Interface org.automotive.odometer
+Object path /org/automotive/maintenance/odometer
+Properties:
+
+ uint32 Odometer [readonly]
Distance in km
-
- byte TransmissionFluid [readonly]
+
+Interface org.automotive.fluid
+Object path /org/automotive/maintenance/fluid
+Properties:
+
+
+ byte Transmission [readonly]
Remaining percentage
- byte BrakeFluid [readonly]
+ byte Brake [readonly]
Remaining percentage
- byte WasherFluid [readonly]
+ byte Washer [readonly]
Remaining percentage
+
+Interface org.automotive.batteryStatus
+Object path /org/automotive/maintenance/batteryStatus
+Properties:
- struct{ double, double } BatteryStatus [readonly]
+ double Voltage [readonly]
- Voltage (double)
- Current (double)
+ double Current [readonly]
+
+
+Interface org.automotive.tirePressure
+Object path /org/automotive/maintenance/tirePressure
+Properties:
- dict{ byte, double } TirePressure [readonly]
+ double LeftFront [readonly]
- Tire (byte), Pressure (kPa)
- Tire:
- LeftFront = 0,
- RightFront = 1,
- LeftRear = 2,
- RightRear = 3
-
- dict( byte, double } TireTemperature [readonly]
-
- Tire (byte), Temperature (C)
- Tire:
- LeftFront = 0,
- RightFront = 1,
- LeftRear = 2,
- RightRear = 3
+ Pressure (kPa)
+
+ double RightFront [readonly]
+
+ double LeftRear [readonly]
+
+ double RightRear [readonly]
+
+
+Interface org.automotive.tireTemperature
+Object path /org/automotive/maintenance/tireTemperature
+Properties:
+
+ double LeftFront [readonly]
+
+ Temperature of tire in Celsius (C)
+
+ double RightFront [readonly]
+
+ double LeftRear [readonly]
+
+ double RightRear [readonly]
=================
Service org.automotive
-Interface org.automotive.parking
-Object path /
+Object path: /org/automotive/parking/*
-Properties byte SecurityAlert [readonly]
+
+
+Interface org.automotive.securityAlert
+Object path /org/automotive/parking/securityAlert
+Properties:
+ byte SecurityAlert [readonly]
- returns status of security alert:
+ returns status of security alert:
+
+ Idle = 0,
+ Armed = 1,
+ Alarm Detected = 2
- Idle = 0,
- Armed = 1,
- Alarm Detected = 2
+Interface org.automotive.parkingBrake
+Object path /org/automotive/parking/parkingBrake
+Properties:
- bool ParkingBrake
+ bool ParkingBrake
- returns whether the parking break is active (true)/inactive (false)
+ returns whether the parking break is active (true)/inactive (false)
- bool ParkingLights
+
+Interface org.automotive.parkingLights
+Object path /org/automotive/parking/parkingLights
+Properties:
+
+ bool ParkingLights
- returns whether the parking lights are active (true) or inactive (false)
-
- bool HazardLights
+ returns whether the parking lights are active (true) or inactive (false)
+
+Interface org.automotive.hazardLights
+Object path /org/automotive/parking/hazardLights
+Properties:
+
+ bool HazardLights
- returns whether the hazard lights are active (true)/inactive (false)
+ returns whether the hazard lights are active (true) or inactive (false)
+
-
\ No newline at end of file
const VehicleProperty::Property VehicleProperty::ButtonEvent = "ButtonEvent";
const VehicleProperty::Property VehicleProperty::AirIntakeTemperature = "AirIntakeTemperature";
const VehicleProperty::Property VehicleProperty::BatteryVoltage = "BatteryVoltage";
+const VehicleProperty::Property VehicleProperty::BatteryCurrent = "BatteryCurrent";
const VehicleProperty::Property VehicleProperty::InteriorTemperature = "InteriorTemperature";
const VehicleProperty::Property VehicleProperty::EngineOilTemperature = "EngineOilTemperature";
const VehicleProperty::Property VehicleProperty::VIN = "VIN";
const VehicleProperty::Property VehicleProperty::FrontWheelRadius = "FrontWheelRadius";
const VehicleProperty::Property VehicleProperty::RearWheelRadius = "RearWheelRadius";
const VehicleProperty::Property VehicleProperty::WheelTrack = "WheelTrack";
+const VehicleProperty::Property VehicleProperty::Odometer = "Odometer";
+const VehicleProperty::Property VehicleProperty::TransmissionFluidLevel = "TransmissionFluidLevel";
+const VehicleProperty::Property VehicleProperty::BrakeFluidLevel = "BrakeFluidLevel";
+const VehicleProperty::Property VehicleProperty::WasherFluidLevel = "WasherFluidLevel";
+const VehicleProperty::Property VehicleProperty::SecurityAlertStatus = "SecurityAlertStatus";
+const VehicleProperty::Property VehicleProperty::ParkingBrakeStatus = "ParkingBrakeStatus";
+const VehicleProperty::Property VehicleProperty::ParkingLightStatus = "ParkingLightStatus";
+const VehicleProperty::Property VehicleProperty::HazardLightStatus = "HazardLightStatus";
+
std::list<VehicleProperty::Property> VehicleProperty::mCapabilities;
std::list<VehicleProperty::Property> VehicleProperty::mCustomProperties;
registerPropertyPriv(ButtonEvent, [](){ return new ButtonEventType(ButtonEvents::NoButton); });
REGISTERPROPERTY(AirIntakeTemperature,0)
registerPropertyPriv(BatteryVoltage, [](){ return new BatteryVoltageType(0); });
+ REGISTERPROPERTY(BatteryCurrent,0);
registerPropertyPriv(InteriorTemperature, [](){ return new InteriorTemperatureType(0); });
registerPropertyPriv(VIN, [](){ return new VINType(""); });
registerPropertyPriv(WMI, [](){ return new WMIType(""); });
REGISTERPROPERTYWITHTYPE(FrontWheelRadius, WheelRadiusType, 0);
REGISTERPROPERTYWITHTYPE(RearWheelRadius, WheelRadiusType, 0);
REGISTERPROPERTY(WheelTrack,0);
-
+ REGISTERPROPERTY(Odometer,0);
+ REGISTERPROPERTY(TransmissionFluidLevel,0);
+ REGISTERPROPERTY(BrakeFluidLevel,0);
+ REGISTERPROPERTY(WasherFluidLevel,0);
+ REGISTERPROPERTY(SecurityAlertStatus,0);
+ REGISTERPROPERTY(ParkingBrakeStatus,false);
+ REGISTERPROPERTY(ParkingLightStatus,false);
+ REGISTERPROPERTY(HazardLightStatus,false);
}
};
}
+namespace Security {
+enum Status
+{
+ Idle = 0,
+ Armed,
+ AlarmDetected
+};
+}
class VehicleProperty
static const Property BatteryVoltage;
typedef BasicPropertyType<double> BatteryVoltageType;
+ static const Property BatteryCurrent;
+ typedef BasicPropertyType<double> BatteryCurrentType;
+
/**< Interior Air Temperature in degrees celcius */
static const Property InteriorTemperature;
typedef BasicPropertyType<int> InteriorTemperatureType;
static const Property WheelTrack;
typedef BasicPropertyType<uint> WheelTrackType;
+ static const Property Odometer;
+ typedef BasicPropertyType<uint> OdometerType;
+
+ /**< Transmission Fluid Level 0-100%.
+ **/
+ static const Property TransmissionFluidLevel;
+ typedef BasicPropertyType<uint16_t> TransmissionFluidLevelType;
+
+ /**< Brake Fluid Level 0-100%.
+ **/
+ static const Property BrakeFluidLevel;
+ typedef BasicPropertyType<uint16_t> BrakeFluidLevelType;
+
+ /**< Washer Fluid Level 0-100%.
+ **/
+ static const Property WasherFluidLevel;
+ typedef BasicPropertyType<uint16_t> WasherFluidLevelType;
+
+ /**< Securty Alert Status
+ * status of security alert
+ * @see Security::Status
+ */
+ static const Property SecurityAlertStatus;
+ typedef BasicPropertyType<Security::Status> SecurityAlertStatusType;
+
+ /**< Parking Brake Status
+ * status of parking break active (true) or inactive (false)
+ */
+ static const Property ParkingBrakeStatus;
+ typedef BasicPropertyType<bool> ParkingBrakeStatusType;
+
+ /**< Parking Light Status
+ * status of parking lights active (true) or inactive (false)
+ */
+ static const Property ParkingLightStatus;
+ typedef BasicPropertyType<bool> ParkingLightStatusType;
+
+ /**< Hazard Lights Status
+ * status of parking lights active (true) or inactive (false)
+ */
+ static const Property HazardLightStatus;
+ typedef BasicPropertyType<bool> HazardLightStatusType;
+
+
/** END PROPERTIES **/
pkg_check_modules(gio REQUIRED gio-2.0)
-set(dbussinkplugin_headers dbusplugin.h abstractproperty.h abstractdbusinterface.h dbusinterfacemanager.h basicproperty.h properties.h varianttype.h custompropertyinterface.h environmentproperties.h vehicleinfo.h)
-set(dbussinkplugin_sources dbusplugin.cpp abstractproperty.cpp abstractdbusinterface.cpp dbusinterfacemanager.cpp basicproperty.cpp properties.cpp varianttype.cpp custompropertyinterface.cpp environmentproperties.cpp vehicleinfo.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)
+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)
add_library(dbussinkplugin MODULE ${dbussinkplugin_sources})
set_target_properties(dbussinkplugin PROPERTIES PREFIX "")
///properties:
#include "accelerationproperty.h"
-#include "properties.h"
+#include "runningstatus.h"
#include "custompropertyinterface.h"
#include "environmentproperties.h"
#include "vehicleinfo.h"
+#include "maintenance.h"
+#include "parking.h"
#define ConstructProperty(property) \
new property(iface->re, connection);
ConstructProperty(SizeProperty);
ConstructProperty(DoorsProperty);
ConstructProperty(WheelInformationProperty);
+ ConstructProperty(OdometerProperty);
+ ConstructProperty(BatteryProperty);
+ ConstructProperty(SecurityAlertProperty);
+ ConstructProperty(ParkingBrakeProperty);
+ ConstructProperty(ParkingLightProperty);
+ ConstructProperty(HazardLightProperty);
PropertyList list = VehicleProperty::customProperties();
--- /dev/null
+#include "maintenance.h"
--- /dev/null
+#ifndef _MAINTENANCE_H_
+#define _MAINTENANCE_H_
+
+
+#include "dbusplugin.h"
+#include "abstractdbusinterface.h"
+#include "abstractroutingengine.h"
+
+
+class OdometerProperty: public DBusSink
+{
+public:
+ OdometerProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.odometer","/org/automotive/maintenance/odometer", re, connection, map<string, string>())
+ {
+ wantProperty<uint>(VehicleProperty::Odometer,"Odometer", "i", AbstractProperty::Read);
+
+ supportedChanged(re->supported());
+ }
+};
+
+class BatteryProperty: public DBusSink
+{
+public:
+ BatteryProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.battery","/org/automotive/maintenance/battery", re, connection, map<string, string>())
+ {
+ wantProperty<double>(VehicleProperty::BatteryVoltage,"Voltage", "d", AbstractProperty::Read);
+ wantProperty<double>(VehicleProperty::BatteryCurrent,"Current", "d", AbstractProperty::Read);
+ supportedChanged(re->supported());
+ }
+};
+
+
+class TirePressureProperty: public DBusSink
+{
+public:
+ TirePressureProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.tirePressure","/org/automotive/maintenance/tirePressure", re, connection, map<string, string>())
+ {
+ wantProperty<double>(VehicleProperty::TirePressureLeftFront,"LeftFront", "d", AbstractProperty::Read);
+ wantProperty<double>(VehicleProperty::TirePressureRightFront,"RightFront", "d", AbstractProperty::Read);
+ wantProperty<double>(VehicleProperty::TirePressureLeftRear,"LeftRear", "d", AbstractProperty::Read);
+ wantProperty<double>(VehicleProperty::TirePressureRightRear,"RightRear", "d", AbstractProperty::Read);
+ supportedChanged(re->supported());
+ }
+};
+
+class TireTemperatureProperty: public DBusSink
+{
+public:
+ TireTemperatureProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.tireTemperature","/org/automotive/maintenance/tireTemperature", re, connection, map<string, string>())
+ {
+ wantProperty<double>(VehicleProperty::TireTemperatureLeftFront,"LeftFront", "d", AbstractProperty::Read);
+ wantProperty<double>(VehicleProperty::TireTemperatureRightFront,"RightFront", "d", AbstractProperty::Read);
+ wantProperty<double>(VehicleProperty::TireTemperatureLeftRear,"LeftRear", "d", AbstractProperty::Read);
+ wantProperty<double>(VehicleProperty::TireTemperatureRightRear,"RightRear", "d", AbstractProperty::Read);
+ supportedChanged(re->supported());
+ }
+};
+
+#endif
--- /dev/null
+#ifndef _PARKING_H_
+#define _PARKING_H_
+
+
+#include "dbusplugin.h"
+#include "abstractdbusinterface.h"
+#include "abstractroutingengine.h"
+
+class SecurityAlertProperty: public DBusSink
+{
+public:
+ SecurityAlertProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.securityAlert","/org/automotive/parking/securityAlert", re, connection, map<string, string>())
+ {
+ wantProperty<bool>(VehicleProperty::SecurityAlertStatus,"SecurityAlert", "b", AbstractProperty::Read);
+
+ supportedChanged(re->supported());
+ }
+};
+
+
+class ParkingBrakeProperty: public DBusSink
+{
+public:
+ ParkingBrakeProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.parkingBrake","/org/automotive/parking/parkingBrake", re, connection, map<string, string>())
+ {
+ wantProperty<bool>(VehicleProperty::ParkingBrakeStatus,"ParkingBrake", "b", AbstractProperty::Read);
+
+ supportedChanged(re->supported());
+ }
+};
+
+class ParkingLightProperty: public DBusSink
+{
+public:
+ ParkingLightProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.parkingLight","/org/automotive/parking/parkingLight", re, connection, map<string, string>())
+ {
+ wantProperty<bool>(VehicleProperty::ParkingLightStatus,"ParkingLight", "b", AbstractProperty::Read);
+
+ supportedChanged(re->supported());
+ }
+};
+
+
+class HazardLightProperty: public DBusSink
+{
+public:
+ HazardLightProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.parkingLight","/org/automotive/parking/parkingLight", re, connection, map<string, string>())
+ {
+ wantProperty<bool>(VehicleProperty::HazardLightStatus,"HazardLight", "b", AbstractProperty::Read);
+
+ supportedChanged(re->supported());
+ }
+};
+
+#endif
};
-class TirePressureProperty: public DBusSink
-{
-public:
- TirePressureProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
- :DBusSink("org.automotive.tirePressure","/org/automotive/maintainance/tirePressure", re, connection, map<string, string>())
- {
- wantProperty<double>(VehicleProperty::TirePressureLeftFront,"LeftFront", "d", AbstractProperty::Read);
- wantProperty<double>(VehicleProperty::TirePressureRightFront,"RightFront", "d", AbstractProperty::Read);
- wantProperty<double>(VehicleProperty::TirePressureLeftRear,"LeftRear", "d", AbstractProperty::Read);
- wantProperty<double>(VehicleProperty::TirePressureRightRear,"RightRear", "d", AbstractProperty::Read);
- supportedChanged(re->supported());
- }
-};
-
class VehiclePowerModeProperty: public DBusSink
{
public:
}
};
-class TireTemperatureProperty: public DBusSink
-{
-public:
- TireTemperatureProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
- :DBusSink("org.automotive.tireTemperature","/org/automotive/maintainance/tireTemperature", re, connection, map<string, string>())
- {
- wantProperty<double>(VehicleProperty::TireTemperatureLeftFront,"LeftFront", "d", AbstractProperty::Read);
- wantProperty<double>(VehicleProperty::TireTemperatureRightFront,"RightFront", "d", AbstractProperty::Read);
- wantProperty<double>(VehicleProperty::TireTemperatureLeftRear,"LeftRear", "d", AbstractProperty::Read);
- wantProperty<double>(VehicleProperty::TireTemperatureRightRear,"RightRear", "d", AbstractProperty::Read);
- supportedChanged(re->supported());
- }
-};
-
class CruiseControlProperty: public DBusSink
{