summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevron Rees <kevron_m_rees@linux.intel.com>2013-04-03 09:25:45 -0700
committerKevron Rees <kevron_m_rees@linux.intel.com>2013-04-03 09:25:45 -0700
commitfa2741d828b92f981641b0f13d2d7c75be01f041 (patch)
tree5ef755b21c2017ea946ff5df4a02b41e6ac9cd80
parent6dd9fef5874595672463daf132fc4e2601a329a2 (diff)
downloadautomotive-message-broker-fa2741d828b92f981641b0f13d2d7c75be01f041.tar.gz
more additions to dbus interface
-rw-r--r--docs/environment.txt39
-rw-r--r--lib/vehicleproperty.cpp49
-rw-r--r--lib/vehicleproperty.h76
-rw-r--r--plugins/dbus/environmentproperties.h244
-rw-r--r--plugins/dbus/parking.h1
5 files changed, 396 insertions, 13 deletions
diff --git a/docs/environment.txt b/docs/environment.txt
index 1d15b587..526479e4 100644
--- a/docs/environment.txt
+++ b/docs/environment.txt
@@ -1,4 +1,4 @@
-Environment hierarchy
+ Environment hierarchy
=================
Service org.automotive
@@ -47,19 +47,16 @@ Properties
Fastest = 5,
Auto = 10
-Interface org.automotive.HVACFan
-Object path /org/automotive/environment/HVACFan
+Interface org.automotive.HVAC
+Object path /org/automotive/environment/HVAC
Properties
-
- struct{ byte, byte, byte } HVACFan [readwrite]
-
+
byte AirflowDirection [readwrite]
Front Panel = 0,
Floor Duct = 1,
- Front + Floor = 2,
- Front = 3,
- Defroster + Floor = 4
+ Front = 0x02,
+ Defroster = 0x04
byte FanSpeed [readwrite]
@@ -102,6 +99,11 @@ Properties
bool SeatCooler [readwrite]
Seat cooler on (true) / off (false)
+
+
+Interface org.automotive.WindowStatus
+Object path /org/automotive/environment/WindowStatus
+Properties
dict{ byte, byte } WindowStatus [readwrite]
@@ -112,12 +114,25 @@ Properties
Driver = 0,
Passenger = 1,
LeftRear = 2,
- RightRear = 3
+ RightRear = 3,
+ Rear = 4
+
+Interface org.automotive.Sunroof
+Object path /org/automotive/environment/Sunroof
+Properties
- struct{ byte, byte } Sunroof [readwrite]
+ byte Openness [readwrite]
- Percent of sunroof openness (0: Closed - 100: Fully Opened) (byte) and percent of tilt (0: Closed - 100: Maximum Tilt) (byte)
+ Percent of sunroof openness (0: Closed - 100: Fully Opened).
+
+ byte Tilt [readwrite]
+
+ Percent of tilt (0: Closed - 100: Maximum Tilt).
+Interface org.automotive.ConvertibleRoof
+Object path /org/automotive/environment/ConvertibleRoof
+Properties
+
bool ConvertibleRoof [readwrite]
Convertible roof on (true) / off (false)
diff --git a/lib/vehicleproperty.cpp b/lib/vehicleproperty.cpp
index d8b20358..e4162451 100644
--- a/lib/vehicleproperty.cpp
+++ b/lib/vehicleproperty.cpp
@@ -60,6 +60,7 @@ const VehicleProperty::Property VehicleProperty::AirIntakeTemperature = "AirInta
const VehicleProperty::Property VehicleProperty::BatteryVoltage = "BatteryVoltage";
const VehicleProperty::Property VehicleProperty::BatteryCurrent = "BatteryCurrent";
const VehicleProperty::Property VehicleProperty::InteriorTemperature = "InteriorTemperature";
+const VehicleProperty::Property VehicleProperty::ExteriorTemperature = "ExteriorTemperature";
const VehicleProperty::Property VehicleProperty::EngineOilTemperature = "EngineOilTemperature";
const VehicleProperty::Property VehicleProperty::VIN = "VIN";
const VehicleProperty::Property VehicleProperty::WMI = "WMI";
@@ -130,6 +131,22 @@ const VehicleProperty::Property VehicleProperty::SeatBeltStatus = "SeatBeltStatu
const VehicleProperty::Property VehicleProperty::WindowLockStatus = "WindowLockStatus";
const VehicleProperty::Property VehicleProperty::OccupantStatus = "OccupantStatus";
const VehicleProperty::Property VehicleProperty::ObstacleDistance = "ObstacleDistance";
+const VehicleProperty::Property VehicleProperty::RainSensor = "RainSensor";
+const VehicleProperty::Property VehicleProperty::WindshieldWiper = "WindshieldWiper";
+const VehicleProperty::Property VehicleProperty::AirflowDirection = "AirflowDirection";
+const VehicleProperty::Property VehicleProperty::FanSpeed = "FanSpeed";
+const VehicleProperty::Property VehicleProperty::TargetTemperature = "TargetTemperature";
+const VehicleProperty::Property VehicleProperty::AirConditioning = "AirConditioning";
+const VehicleProperty::Property VehicleProperty::AirRecirculation = "AirRecirculation";
+const VehicleProperty::Property VehicleProperty::Heater = "Heater";
+const VehicleProperty::Property VehicleProperty::Defrost = "Defrost";
+const VehicleProperty::Property VehicleProperty::SteeringWheelHeater = "SteeringWheelHeater";
+const VehicleProperty::Property VehicleProperty::SeatHeater = "SeatHeater";
+const VehicleProperty::Property VehicleProperty::SeatCooler = "SeatCooler";
+const VehicleProperty::Property VehicleProperty::WindowStatus = "WindowStatus";
+const VehicleProperty::Property VehicleProperty::Sunroof = "Sunroof";
+const VehicleProperty::Property VehicleProperty::SunroofTilt = "SunroofTilt";
+const VehicleProperty::Property VehicleProperty::ConvertibleRoof = "ConvertibleRoof";
std::list<VehicleProperty::Property> VehicleProperty::mCapabilities;
@@ -162,6 +179,7 @@ VehicleProperty::VehicleProperty()
registerPropertyPriv(BatteryVoltage, [](){ return new BatteryVoltageType(0); });
REGISTERPROPERTY(BatteryCurrent,0);
registerPropertyPriv(InteriorTemperature, [](){ return new InteriorTemperatureType(0); });
+ REGISTERPROPERTY(ExteriorTemperature,0);
registerPropertyPriv(VIN, [](){ return new VINType(""); });
registerPropertyPriv(WMI, [](){ return new WMIType(""); });
REGISTERPROPERTYWITHTYPE(TirePressureLeftFront, TirePressureType, 0);
@@ -282,6 +300,37 @@ VehicleProperty::VehicleProperty()
return t;
});
+ REGISTERPROPERTY(RainSensor,0);
+ REGISTERPROPERTY(WindshieldWiper,Window::Off);
+ REGISTERPROPERTY(AirflowDirection,HVAC::Front);
+ REGISTERPROPERTY(FanSpeed,0);
+ REGISTERPROPERTY(TargetTemperature,0);
+ REGISTERPROPERTY(AirConditioning,false);
+ REGISTERPROPERTY(AirRecirculation,false);
+ REGISTERPROPERTY(Heater,false);
+
+ registerPropertyPriv(Defrost, []()
+ {
+ DefrostType *d = new DefrostType();
+ d->append(Window::Windshield,false);
+
+ return d;
+ });
+
+ REGISTERPROPERTY(SteeringWheelHeater,false);
+ REGISTERPROPERTY(SeatHeater, false);
+ REGISTERPROPERTY(SeatCooler, false);
+ registerPropertyPriv(WindowStatus, []()
+ {
+ WindowStatusType* d = new WindowStatusType();
+ d->append(Window::Driver,100);
+
+ return d;
+ });
+ REGISTERPROPERTY(Sunroof,0);
+ REGISTERPROPERTY(SunroofTilt,0);
+ REGISTERPROPERTY(ConvertibleRoof,false);
+
}
void VehicleProperty::factory()
diff --git a/lib/vehicleproperty.h b/lib/vehicleproperty.h
index 9f95b3f7..fcc32b76 100644
--- a/lib/vehicleproperty.h
+++ b/lib/vehicleproperty.h
@@ -221,8 +221,20 @@ enum Location
Passenger,
LeftRear,
RightRear,
- Sunroof
+ Sunroof,
+ Windshield,
+ SideMirrorLeft,
+ SideMirrorRight
};
+
+enum WiperSpeed
+{
+ Off = 0,
+ Slowest = 1,
+ Fastest = 5,
+ Auto = 10
+};
+
}
namespace DistanceSensor
@@ -239,6 +251,18 @@ enum Location
};
}
+namespace HVAC
+{
+enum AirflowDirection
+{
+ FrontPanel=0,
+ FloorDuct = 1,
+ Front = 1 << 1,
+ Defroster = 1 << 2
+
+};
+}
+
class VehicleProperty
{
@@ -356,6 +380,9 @@ public:
static const Property InteriorTemperature;
typedef BasicPropertyType<int> InteriorTemperatureType;
+ static const Property ExteriorTemperature;
+ typedef BasicPropertyType<int> ExteriorTemperatureType;
+
/**< Engine Oil Temperature in degrees celcius */
static const Property EngineOilTemperature;
typedef BasicPropertyType<int> EngineOilTemperatureType;
@@ -552,6 +579,53 @@ public:
static const Property ObstacleDistance;
typedef MapPropertyType<BasicPropertyType<DistanceSensor::Location>, BasicPropertyType<double> > ObstacleDistanceType;
+ static const Property RainSensor;
+ typedef BasicPropertyType<uint16_t> RainSensorType;
+
+ static const Property WindshieldWiper;
+ typedef BasicPropertyType<Window::WiperSpeed> WindshieldWiperType;
+
+ static const Property AirflowDirection;
+ typedef BasicPropertyType<HVAC::AirflowDirection> AirflowDirectionType;
+
+ static const Property FanSpeed;
+ typedef BasicPropertyType<uint16_t> FanSpeedType;
+
+ static const Property TargetTemperature;
+ typedef BasicPropertyType<int> TargetTemperatureType;
+
+ static const Property AirConditioning;
+ typedef BasicPropertyType<bool> AirConditioningType;
+
+ static const Property AirRecirculation;
+ typedef BasicPropertyType<bool> AirRecirculationType;
+
+ static const Property Heater;
+ typedef BasicPropertyType<bool> HeaterType;
+
+ static const Property Defrost;
+ typedef MapPropertyType<BasicPropertyType<Window::Location>, BasicPropertyType<bool> > DefrostType;
+
+ static const Property SteeringWheelHeater;
+ typedef BasicPropertyType<bool> SteeringWheelHeaterType;
+
+ static const Property SeatHeater;
+ typedef BasicPropertyType<bool> SeatHeaterType;
+
+ static const Property SeatCooler;
+ typedef BasicPropertyType<bool> SeatCoolerType;
+
+ static const Property WindowStatus;
+ typedef MapPropertyType<BasicPropertyType<Window::Location>, BasicPropertyType<uint16_t> > WindowStatusType;
+
+ static const Property Sunroof;
+ typedef BasicPropertyType<uint16_t> SunroofType;
+
+ static const Property SunroofTilt;
+ typedef BasicPropertyType<uint16_t> SunroofTiltType;
+
+ static const Property ConvertibleRoof;
+ typedef BasicPropertyType<bool> ConvertibleRoofType;
/** END PROPERTIES **/
diff --git a/plugins/dbus/environmentproperties.h b/plugins/dbus/environmentproperties.h
index 79d9fac4..07859d88 100644
--- a/plugins/dbus/environmentproperties.h
+++ b/plugins/dbus/environmentproperties.h
@@ -23,4 +23,248 @@ public:
}
};
+/** @interface Temperature : VehiclePropertyType **/
+class Temperature: public DBusSink
+{
+public:
+ Temperature(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.InteriorTemperature","/org/automotive/environment/InteriorTemperature", re, connection, map<string, string>())
+ {
+ /**
+ * @attributeName Interior
+ * @type signed long
+ * @access readonly
+ * @attributeComment \brief Must return the temperature of the interior of the vehicle in celcius.
+ */
+ wantProperty<int>(VehicleProperty::InteriorTemperature, "Interior", "i", AbstractProperty::Read);
+
+ /**
+ * @attributeName Exterior
+ * @type signed long
+ * @access readonly
+ * @attributeComment \brief Must return the temperature of the exterior of the vehicle in celcius.
+ */
+ wantProperty<int>(VehicleProperty::ExteriorTemperature, "Exterior", "i", AbstractProperty::Read);
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface RainSensor : VehiclePropertyType **/
+class RainSensor: public DBusSink
+{
+public:
+ RainSensor(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.InteriorTemperature","/org/automotive/environment/InteriorTemperature", re, connection, map<string, string>())
+ {
+ /**
+ * @attributeName RainSensor
+ * @type unsigned short
+ * @access readonly
+ * @attributeComment \brief Must return level of rain intensity 0: No Rain - 10: Heaviest Rain.
+ */
+ wantProperty<uint16_t>(VehicleProperty::RainSensor, "RainSensor", "q", AbstractProperty::Read);
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface WindshieldWiper : VehiclePropertyType **/
+class WindshieldWiper: public DBusSink
+{
+public:
+ WindshieldWiper(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.WindshieldWiper","/org/automotive/environment/WindshieldWiper", re, connection, map<string, string>())
+ {
+ /**
+ * @enum const unsigned short WIPERSPEED_OFF = 0;
+ * @enum const unsigned short WIPERSPEED_SLOWEST= 1;
+ * @enum const unsigned short WIPERSPEED_FASTEST = 5;
+ * @enum const unsigned short WIPERSPEED_AUTO = 10;
+ **/
+
+ /**
+ * @attributeName WindshieldWiper
+ * @type unsigned short
+ * @access readonly
+ * @attributeComment \brief Must return Level of windshield whiper speed (see WIPERSPEED_*)
+ */
+ wantProperty<Window::WiperSpeed>(VehicleProperty::RainSensor, "WindshieldWiper", "y", AbstractProperty::ReadWrite);
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface HVAC : VehiclePropertyType **/
+class HVACProperty: public DBusSink
+{
+public:
+ HVACProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.HVAC","/org/automotive/environment/HVAC", re, connection, map<string, string>())
+ {
+ /**
+ * @enum const unsigned short AIRFLOWDIRECTION_FRONTPANEL = 0;
+ * @enum const unsigned short AIRFLOWDIRECTION_FLOORDUCT= 1;
+ * @enum const unsigned short AIRFLOWDIRECTION_FRONT = 0x02;
+ * @enum const unsigned short AIRFLOWDIRECTION_DEFROSTER = 0x04;
+ **/
+
+ /**
+ * @attributeName AirflowDirection
+ * @type unsigned short
+ * @access readwrite
+ * @attributeComment \brief Must return airflow direction. See AIRFLOWDIRECTION_*.
+ */
+ wantProperty<HVAC::AirflowDirection>(VehicleProperty::AirflowDirection, "AirflowDirection", "y", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName FanSpeed
+ * @type unsigned short
+ * @access readwrite
+ * @attributeComment \brief Must return speed of the fan (0-7)
+ */
+ wantProperty<uint16_t>(VehicleProperty::FanSpeed, "FanSpeed", "y", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName TargetTemperature
+ * @type unsigned short
+ * @access readwrite
+ * @attributeComment \brief Must return target desired temperature in celcius.
+ */
+ wantProperty<uint16_t>(VehicleProperty::TargetTemperature, "TargetTemperature", "y", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName AirConditioning
+ * @type boolean
+ * @access readwrite
+ * @attributeComment \brief Must return air conditioning on (true) / off (false).
+ */
+ wantProperty<bool>(VehicleProperty::AirConditioning, "AirConditioning", "b", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName AirRecirculation
+ * @type boolean
+ * @access readwrite
+ * @attributeComment \brief Must return air recirculation on (true) / off (false).
+ */
+ wantProperty<bool>(VehicleProperty::AirRecirculation, "AirRecirculation", "b", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName Heater
+ * @type boolean
+ * @access readwrite
+ * @attributeComment \brief Must return heater on (true) / off (false).
+ */
+ wantProperty<bool>(VehicleProperty::Heater, "Heater", "b", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName Defrost
+ * @type boolean
+ * @access readwrite
+ * @attributeComment \brief Must return air recirculation on (true) / off (false).
+ */
+ wantProperty<bool>(VehicleProperty::AirRecirculation, "AirRecirculation", "b", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName Defrost
+ * @type object
+ * @access readwrite
+ * @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);
+
+ /**
+ * @attributeName SteeringWheelHeater
+ * @type boolean
+ * @access readwrite
+ * @attributeComment \brief Must return air recirculation on (true) / off (false).
+ */
+ wantProperty<bool>(VehicleProperty::SteeringWheelHeater, "SteeringWheelHeater", "b", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName SeatHeater
+ * @type boolean
+ * @access readwrite
+ * @attributeComment \brief Must return seat heater status: on (true) / off (false).
+ */
+ wantProperty<bool>(VehicleProperty::SeatHeater, "SeatHeater", "b", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName SeatCooler
+ * @type boolean
+ * @access readwrite
+ * @attributeComment \brief Must return seat heater status: on (true) / off (false).
+ */
+ wantProperty<bool>(VehicleProperty::SeatCooler, "SeatCooler", "b", AbstractProperty::ReadWrite);
+
+ supportedChanged(re->supported());
+ }
+};
+
+/** @interface WindowStatus : VehiclePropertyType **/
+class WindowStatus: public DBusSink
+{
+public:
+ WindowStatus(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.WindowStatus","/org/automotive/environment/WindowStatus", re, connection, map<string, string>())
+ {
+ /**
+ * @enum const unsigned short WINDOWLOCATION_DRIVER= 0;
+ * @enum const unsigned short WINDOWLOCATION_PASSENGER = 1;
+ * @enum const unsigned short WINDOWLOCATION_LEFTREAR = 2;
+ * @enum const unsigned short WINDOWLOCATION_RIGHTREAR = 3;
+ * @enum const unsigned short WINDOWLOCATION_REAR = 4;
+ **/
+
+ /**
+ * @attributeName WindowStatus
+ * @type object
+ * @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);
+ }
+};
+
+/** @interface Sunroof : VehiclePropertyType **/
+class Sunroof: public DBusSink
+{
+public:
+ Sunroof(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.Sunroof","/org/automotive/environment/Sunroof", re, connection, map<string, string>())
+ {
+ /**
+ * @attributeName Openness
+ * @type unsigned short
+ * @access readwrite
+ * @attributeComment \brief Must return window status for sunroof openness percentage.
+ */
+ wantPropertyVariant(VehicleProperty::Sunroof, "Openness", "y", AbstractProperty::ReadWrite);
+
+ /**
+ * @attributeName Tilt
+ * @type unsigned short
+ * @access readwrite
+ * @attributeComment \brief Must return tilt status for sunroof percentage.
+ */
+ wantPropertyVariant(VehicleProperty::SunroofTilt, "Tilt", "y", AbstractProperty::ReadWrite);
+
+ }
+};
+
+/** @interface ConvertibleRoof : VehiclePropertyType **/
+class ConvertibleRoof: public DBusSink
+{
+public:
+ ConvertibleRoof(AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("org.automotive.ConvertibleRoof","/org/automotive/environment/ConvertibleRoof", re, connection, map<string, string>())
+ {
+ /**
+ * @attributeName Openness
+ * @type unsigned short
+ * @access readwrite
+ * @attributeComment \brief Must return window status for sunroof openness percentage.
+ */
+ wantPropertyVariant(VehicleProperty::ConvertibleRoof, "ConvertibleRoof", "b", AbstractProperty::ReadWrite);
+ }
+};
#endif
diff --git a/plugins/dbus/parking.h b/plugins/dbus/parking.h
index b438750a..da5c5e3d 100644
--- a/plugins/dbus/parking.h
+++ b/plugins/dbus/parking.h
@@ -17,6 +17,7 @@ public:
/** @attributeName SecurityAlert
* @type boolean
* @access readonly
+ * @attributeComment \brief MUST return
**/
wantProperty<Security::Status>(VehicleProperty::SecurityAlertStatus,"SecurityAlert", "i", AbstractProperty::Read);