summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevron Rees <kevron.m.rees@intel.com>2014-12-10 17:09:37 -0800
committerKevron Rees <kevron.m.rees@intel.com>2014-12-10 17:09:37 -0800
commit81b444fe6747864a495493f16fd36faafdf0140e (patch)
tree02a81786807f935a79b5d1d13a7a1b846153af49
parentcfc8c87801b489dfce9ce318970af92e8edb5b8b (diff)
downloadautomotive-message-broker-81b444fe6747864a495493f16fd36faafdf0140e.tar.gz
added driving safety attributes
-rw-r--r--docs/amb.in.idl42
-rw-r--r--lib/vehicleproperty.cpp19
-rw-r--r--lib/vehicleproperty.h63
-rw-r--r--plugins/bluemonkey/config.js4
-rw-r--r--plugins/dbus/dbusinterfacemanager.cpp2
-rw-r--r--plugins/dbus/parking.h35
-rw-r--r--xwalk/vehicle_api.js6
7 files changed, 148 insertions, 23 deletions
diff --git a/docs/amb.in.idl b/docs/amb.in.idl
index df7a8688..41e98717 100644
--- a/docs/amb.in.idl
+++ b/docs/amb.in.idl
@@ -1002,13 +1002,18 @@ interface org.automotive.SecurityAlert extends VehiclePropertyType {
attribute Boolean SecurityAlert readonly
}
-/// Deprecated. Use LightStatus. remove in 0.14
interface org.automotive.ParkingBrake extends VehiclePropertyType {
/*! ParkingBrake
* MUST return status of parking brake: Engaged = true, Disengaged = false.
+ TODO: Deprecated in 0.14. Use Status
*/
attribute Boolean ParkingBrake readonly
+
+ /*!
+ * \brief MUST return the current status of parking brake.
+ */
+ attribute ParkingBrakeStatus Status;
}
/// Deprecated. Use LightStatus. remove in 0.14
@@ -1737,3 +1742,38 @@ interface org.automotive.AtmosphericPressure extends VehiclePropertyType {
* \brief MUST return the current atmospheric pressure outside of the vehicle (Unit: hectopascal)
*/
attribute UInt16 Pressure;
+}
+
+enum LaneDepartureStatus {
+ off = "off",
+ pause = "pause",
+ running = "running"
+};
+
+interface org.automotive.LaneDepartureDetection extends VehiclePropertyType {
+ /*!
+ * \brief MUST return current status of Lane departure warning function.
+ */
+ attribute LaneDepartureStatus Status readonly;
+}
+
+enum AlarmStatus {
+ disarmed = "disarmed",
+ prearmed = "prearmed",
+ armed = "armed",
+ alarmed = "alarmed"
+};
+
+interface org.automotive.Alarm extends VehiclePropertyType {
+ /*!
+ * \brief MUST return the current status of vehicle Alarm System.
+ */
+ attribute AlarmStatus Status;
+}
+
+enum ParkingBrakeStatus {
+ inactive = "inactive",
+ active = "active",
+ error = "error"
+};
+
diff --git a/lib/vehicleproperty.cpp b/lib/vehicleproperty.cpp
index 96b10060..35b58cc6 100644
--- a/lib/vehicleproperty.cpp
+++ b/lib/vehicleproperty.cpp
@@ -102,6 +102,19 @@ const char * ConvertibleRoofW3C::Closing = "closing";
const char * ConvertibleRoofW3C::Opened = "opened";
const char * ConvertibleRoofW3C::Opening = "opening";
+const char * LaneDeparture::W3C::Off = "off";
+const char * LaneDeparture::W3C::Pause = "pause";
+const char * LaneDeparture::W3C::Running = "running";
+
+const char * Security::W3C::Alarmed = "alarmed";
+const char * Security::W3C::Armed = "armed";
+const char * Security::W3C::Disarmed = "disarmed";
+const char * Security::W3C::Prearmed = "prearmed";
+
+const char * ParkingBrake::W3C::Inactive = "inactive";
+const char * ParkingBrake::W3C::Active = "active";
+const char * ParkingBrake::W3C::Error = "error";
+
const VehicleProperty::Property VehicleProperty::NoValue = "NoValue";
const VehicleProperty::Property VehicleProperty::VehicleSpeed = "VehicleSpeed";
const VehicleProperty::Property VehicleProperty::EngineSpeed = "EngineSpeed";
@@ -194,6 +207,7 @@ const VehicleProperty::Property VehicleProperty::WasherFluidLevel = "WasherFluid
const VehicleProperty::Property VehicleProperty::WasherFluidLevelLow = "WasherFluidLevelLow";
const VehicleProperty::Property VehicleProperty::SecurityAlertStatus = "SecurityAlertStatus";
const VehicleProperty::Property VehicleProperty::ParkingBrakeStatus = "ParkingBrakeStatus";
+const VehicleProperty::Property VehicleProperty::ParkingBrakeStatusW3C = "ParkingBrakeStatusW3C";
const VehicleProperty::Property VehicleProperty::ParkingLightStatus = "ParkingLightStatus";
const VehicleProperty::Property VehicleProperty::HazardLightStatus = "HazardLightStatus";
const VehicleProperty::Property VehicleProperty::AirbagStatus = "AirbagStatus";
@@ -282,6 +296,8 @@ const VehicleProperty::Property VehicleProperty::ElectronicStabilityControlEngag
const VehicleProperty::Property VehicleProperty::OccupantIdentificationType = "OccupantIdentificationType";
const VehicleProperty::Property VehicleProperty::OccupantName = "OccupantName";
const VehicleProperty::Property VehicleProperty::AtmosphericPressure = "AtmosphericPressure";
+const VehicleProperty::Property VehicleProperty::LaneDepartureStatus = "LaneDepartureStatus";
+const VehicleProperty::Property VehicleProperty::AlarmStatus = "AlarmStatus";
PropertyList VehicleProperty::mCapabilities;
PropertyList VehicleProperty::mCustomProperties;
@@ -390,6 +406,7 @@ VehicleProperty::VehicleProperty()
REGISTERPROPERTY(WasherFluidLevelLow, false);
REGISTERPROPERTY(SecurityAlertStatus, Security::Idle);
REGISTERPROPERTY(ParkingBrakeStatus, false);
+ REGISTERPROPERTY(ParkingBrakeStatusW3C, "");
REGISTERPROPERTY(ParkingLightStatus, false);
REGISTERPROPERTY(HazardLightStatus, false);
/// TODO: deprecated in 0.14
@@ -496,6 +513,8 @@ VehicleProperty::VehicleProperty()
REGISTERPROPERTY(OccupantIdentificationType, Seat::W3C::Pin);
REGISTERPROPERTY(OccupantName, "");
REGISTERPROPERTY(AtmosphericPressure, 0);
+ REGISTERPROPERTY(LaneDepartureStatus, "");
+ REGISTERPROPERTY(AlarmStatus, "");
}
void VehicleProperty::factory()
diff --git a/lib/vehicleproperty.h b/lib/vehicleproperty.h
index 40c25faa..3effde11 100644
--- a/lib/vehicleproperty.h
+++ b/lib/vehicleproperty.h
@@ -133,7 +133,7 @@ namespace Power {
* Accessory2 = Vehicle is off and key is in Accessory2 position.
* Run = Vehichle is running. Key is in the running position.
*/
-enum PowerModes
+enum Modes
{
Off = 0,
Accessory1 = 1,
@@ -188,6 +188,15 @@ enum Status
Armed,
AlarmDetected
};
+
+namespace W3C
+{
+extern const char * Disarmed;
+extern const char * Prearmed;
+extern const char * Armed;
+extern const char * Alarmed;
+}
+
}
namespace Airbag {
@@ -339,6 +348,26 @@ enum Type
};
}
+namespace LaneDeparture
+{
+namespace W3C
+{
+extern const char * Off;
+extern const char * Pause;
+extern const char * Running;
+}
+}
+
+namespace ParkingBrake
+{
+namespace W3C
+{
+extern const char * Inactive;
+extern const char * Active;
+extern const char * Error;
+}
+}
+
#include <boost/preprocessor/comma.hpp>
#define PROPERTYTYPE(property, propertyType, baseClass, valueType) \
@@ -383,7 +412,6 @@ class VehicleProperty
public:
-
/*!
* \brief factory constructs a static instance of VehicleProperty. This should be called once before VehicleProperty is used in the app
*/
@@ -524,9 +552,6 @@ public:
};
-
-
-
/**< Air intake temperature in degrees celcius */
static const Property AirIntakeTemperature;
PROPERTYTYPE(AirIntakeTemperature, AirIntakeTemperatureType, BasicPropertyType<int>, int)
@@ -588,10 +613,10 @@ public:
PROPERTYTYPEBASIC(TireTemperature, int16_t)
/**< Vehicle Power Mode.
- *@see Power::PowerModes
+ *@see Power::Modes
*/
static const Property VehiclePowerMode;
- PROPERTYTYPE(VehiclePowerMode, VehiclePowerModeType, BasicPropertyType<Power::PowerModes> ,Power::PowerModes)
+ PROPERTYTYPE(VehiclePowerMode, VehiclePowerModeType, BasicPropertyType<Power::Modes>, Power::Modes)
//typedef BasicPropertyType<Power::PowerModes> VehiclePowerModeType;
static const Property TripMeters;
@@ -755,19 +780,23 @@ public:
static const Property WasherFluidLevelLow;
PROPERTYTYPEBASIC(WasherFluidLevelLow, bool)
- /**< Securty Alert Status
- * status of security alert
- * @see Security::Status
- */
+ ///TODO: Depreciated in 0.14. Use AlarmStatus
static const Property SecurityAlertStatus;
PROPERTYTYPEBASIC(SecurityAlertStatus, Security::Status)
/**< Parking Brake Status
* status of parking break active (true) or inactive (false)
+ * TODO: Deprecated in 0.14.
*/
static const Property ParkingBrakeStatus;
PROPERTYTYPEBASIC(ParkingBrakeStatus, bool)
+ /*!
+ * \brief ParkingBrakeStatusW3C use with ParkingBrake::W3C::*
+ */
+ static const Property ParkingBrakeStatusW3C;
+ PROPERTYTYPE(ParkingBrakeStatusW3C, ParkingBrakeStatusW3CType, StringPropertyType, std::string)
+
/**< Parking Light Status
* status of parking lights active (true) or inactive (false)
*/
@@ -1051,6 +1080,17 @@ public:
static const Property AtmosphericPressure;
PROPERTYTYPEBASIC(AtmosphericPressure, uint16_t)
+ static const Property LaneDepartureStatus;
+ PROPERTYTYPE(LaneDepartureStatus, LaneDepartureStatusType, StringPropertyType, std::string)
+
+ /*!
+ * \brief AlarmStatus. Use with Security::W3C*
+ */
+ static const Property AlarmStatus;
+ PROPERTYTYPE(AlarmStatus, AlarmStatusType, StringPropertyType, std::string)
+
+ //static const Property Lane
+
/** END PROPERTIES **/
/*!
@@ -1109,3 +1149,4 @@ private:
#endif // VEHICLEPROPERTY_H
+
diff --git a/plugins/bluemonkey/config.js b/plugins/bluemonkey/config.js
index 12d747dc..e223c59d 100644
--- a/plugins/bluemonkey/config.js
+++ b/plugins/bluemonkey/config.js
@@ -238,6 +238,10 @@ bluemonkey.createCustomProperty("WindowLockStatus", true, Zone.Rear | Zone.Left)
bluemonkey.createCustomProperty("AtmosphericPressure", 1013);
+bluemonkey.createCustomProperty("LaneDepartureStatus", "running");
+bluemonkey.createCustomProperty("AlarmStatus", "prearmed");
+bluemonkey.createCustomProperty("ParkingBrakeStatusW3C", "inactive");
+
var speedProperty = bluemonkey.subscribeTo("VehicleSpeed");
var testTimer = bluemonkey.createTimer();
diff --git a/plugins/dbus/dbusinterfacemanager.cpp b/plugins/dbus/dbusinterfacemanager.cpp
index f133646a..92fca35c 100644
--- a/plugins/dbus/dbusinterfacemanager.cpp
+++ b/plugins/dbus/dbusinterfacemanager.cpp
@@ -269,6 +269,8 @@ void DBusInterfaceManager::registerTypes()
exportProperty<WindshieldWiperStatus>(re, connection);
exportProperty<SideWindowStatusProperty>(re, connection);
exportProperty<AtmosphericPressure>(re, connection);
+ exportProperty<LaneDepartureStatus>(re, connection);
+ exportProperty<AlarmStatus>(re, connection);
PropertyList list = VehicleProperty::customProperties();
PropertyList implemented = AbstractDBusInterface::implementedProperties();
diff --git a/plugins/dbus/parking.h b/plugins/dbus/parking.h
index 7f94a59f..483fd259 100644
--- a/plugins/dbus/parking.h
+++ b/plugins/dbus/parking.h
@@ -6,22 +6,14 @@
#include "abstractdbusinterface.h"
#include "abstractroutingengine.h"
-/** @interface SecurityAlert : VehiclePropertyType **/
+///TODO Deprecated in 0.14. Use AlarmStatus
class SecurityAlertProperty: public DBusSink
{
public:
SecurityAlertProperty(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection)
:DBusSink("SecurityAlert", re, connection, map<string, string>())
{
-
- /** @attributeName SecurityAlert
- * @type boolean
- * @access readonly
- * @attributeComment \brief MUST return
- **/
wantProperty<Security::Status>(VehicleProperty::SecurityAlertStatus,"SecurityAlert", "i", AbstractProperty::Read);
-
-
}
};
@@ -39,11 +31,14 @@ public:
**/
wantProperty<bool>(VehicleProperty::ParkingBrakeStatus,"ParkingBrake", "b", AbstractProperty::Read);
+ wantPropertyVariant(VehicleProperty::ParkingBrakeStatusW3C,"Status", AbstractProperty::Read);
+
}
};
/** @interface ParkingLight : VehiclePropertyType **/
+///TODO: Deprecated in 0.14
class ParkingLightProperty: public DBusSink
{
public:
@@ -56,8 +51,6 @@ public:
* @attributeComment must return status of parking light: Engaged = true, Disengaged = false.
**/
wantProperty<bool>(VehicleProperty::ParkingLightStatus,"ParkingLight", "b", AbstractProperty::Read);
-
-
}
};
@@ -77,4 +70,24 @@ public:
}
};
+class LaneDepartureStatus: public DBusSink
+{
+public:
+ LaneDepartureStatus(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("LaneDepartureDetection", re, connection, map<string, string>())
+ {
+ wantPropertyVariant(VehicleProperty::LaneDepartureStatus, "Status", AbstractProperty::Read);
+ }
+};
+
+class AlarmStatus: public DBusSink
+{
+public:
+ AlarmStatus(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection)
+ :DBusSink("Alarm", re, connection, map<string, string>())
+ {
+ wantPropertyVariant(VehicleProperty::AlarmStatus, "Status", AbstractProperty::ReadWrite);
+ }
+};
+
#endif
diff --git a/xwalk/vehicle_api.js b/xwalk/vehicle_api.js
index 93150a21..9880558f 100644
--- a/xwalk/vehicle_api.js
+++ b/xwalk/vehicle_api.js
@@ -361,3 +361,9 @@ _defineVehicleSignalProperty(exports, 'defrost');
_defineVehicleSignalProperty(exports, 'sunroof');
_defineVehicleSignalProperty(exports, 'atmosphericPressure');
+/// Vision and Parking Interfaces
+_defineVehicleSignalProperty(exports, 'langeDepartureStatus');
+_defineVehicleSignalProperty(exports, 'alarm');
+_defineVehicleSignalProperty(exports, 'parkingBrake');
+
+