diff options
author | Kevron Rees <kevron.m.rees@intel.com> | 2014-12-10 10:02:56 -0800 |
---|---|---|
committer | Kevron Rees <kevron.m.rees@intel.com> | 2014-12-10 10:02:56 -0800 |
commit | cfc8c87801b489dfce9ce318970af92e8edb5b8b (patch) | |
tree | 130636e91d124cc04ab9867f6de0f5082a067913 | |
parent | bf4fb323dd952373bec3422878091f53274dc0f7 (diff) | |
download | automotive-message-broker-cfc8c87801b489dfce9ce318970af92e8edb5b8b.tar.gz |
climate properties
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | docs/CMakeLists.txt | 4 | ||||
-rw-r--r-- | docs/amb.in.idl | 289 | ||||
-rw-r--r-- | docs/dbus.idl | 2 | ||||
-rw-r--r-- | lib/vehicleproperty.cpp | 24 | ||||
-rw-r--r-- | lib/vehicleproperty.h | 68 | ||||
-rw-r--r-- | packaging/automotive-message-broker.spec.in | 6 | ||||
-rw-r--r-- | plugins/bluemonkey/bluemonkey.cpp | 7 | ||||
-rw-r--r-- | plugins/bluemonkey/config.js | 90 | ||||
-rw-r--r-- | plugins/dbus/dbusinterfacemanager.cpp | 19 | ||||
-rw-r--r-- | plugins/dbus/environmentproperties.h | 86 | ||||
-rw-r--r-- | plugins/dbus/varianttype.cpp | 3 | ||||
-rw-r--r-- | xwalk/vehicle_api.js | 2 |
13 files changed, 403 insertions, 202 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 504ada75..4b4402fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_BUILD_TYPE, Debug) include(FindPkgConfig) set(PROJECT_NAME "automotive-message-broker") -set(PROJECT_VERSION "0.12.803") +set(PROJECT_VERSION "0.12.900") set(PROJECT_CODENAME "agera") -set(PROJECT_QUALITY "alpha") +set(PROJECT_QUALITY "beta") add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}") add_definitions(-DPROJECT_NAME="${PROJECT_NAME}") @@ -152,3 +152,4 @@ add_subdirectory(docs) add_subdirectory(tests) add_subdirectory(examples) add_subdirectory(xwalk) +add_subdirectory(packaging) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 9a88138c..4f5b0c00 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,8 +1,8 @@ if(enable_docs) install (DIRECTORY amb DESTINATION ${DOC_INSTALL_DIR} COMPONENT Docs) install (DIRECTORY dbus DESTINATION ${DOC_INSTALL_DIR} COMPONENT Docs) - install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/amb.idl DESTINATION ${DOC_INSTALL_DIR}/dbus/html/ COMPONENT Docs) - add_custom_target(doc_idl ALL mkdir -p ${CMAKE_CURRENT_SOURCE_DIR}/dbus/html/ && cp ${CMAKE_CURRENT_SOURCE_DIR}/amb.idl ${CMAKE_CURRENT_SOURCE_DIR}/dbus/html/amb.idl WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Moving amb.idl" VERBATIM) + install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/amb.fidl DESTINATION ${DOC_INSTALL_DIR}/dbus/html/ COMPONENT Docs) + add_custom_target(doc_idl ALL mkdir -p ${CMAKE_CURRENT_SOURCE_DIR}/dbus/html/ && cp ${CMAKE_CURRENT_SOURCE_DIR}/amb.fidl ${CMAKE_CURRENT_SOURCE_DIR}/dbus/html/amb.fidl WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Moving amb.fidl" VERBATIM) endif(enable_docs) diff --git a/docs/amb.in.idl b/docs/amb.in.idl index dffe393c..df7a8688 100644 --- a/docs/amb.in.idl +++ b/docs/amb.in.idl @@ -165,7 +165,7 @@ interface org.automotive.Manager { interface org.automotive.VehicleSpeed extends VehiclePropertyType { /*! Speed - * \brief Must return Vehicle Speed in kilometers per hour. + * \brief MUST return Vehicle Speed in kilometers per hour. */ attribute UInt16 Speed readonly } @@ -177,7 +177,7 @@ interface org.automotive.VehicleSpeed extends VehiclePropertyType { interface org.automotive.EngineSpeed extends VehiclePropertyType { /*! EngineSpeed - * \brief Must return Engine Speed in rotations per minute. + * \brief MUST return Engine Speed in rotations per minute. */ attribute UInt16 Speed readonly } @@ -192,7 +192,7 @@ enumeration PowerMode { interface org.automotive.VehiclePowerMode extends VehiclePropertyType { /*! VehiclePowerMode - * \brief Must return vehicle power mode + * \brief MUST return vehicle power mode */ attribute PowerMode VehiclePowerMode readonly } @@ -204,7 +204,7 @@ interface org.automotive.VehiclePowerMode extends VehiclePropertyType { interface org.automotive.TripMeter extends VehiclePropertyType { /*! TripMeters - * \brief Must return trip meters. Changing any items in the array will reset the item's value to '0'. + * \brief MUST return trip meters. Changing any items in the array will reset the item's value to '0'. */ attribute array TripMeters of UInt16; } @@ -272,7 +272,7 @@ enumeration TransmissionGearType interface org.automotive.Transmission extends VehiclePropertyType { /*! GearPosition - * \brief Must return transmission gear position (see TRANSMISSIONPOSITION) Deprecated. Replaced with Gear + * \brief MUST return transmission gear position (see TRANSMISSIONPOSITION) Deprecated. Replaced with Gear */ attribute TransmissionPosition GearPosition readonly @@ -283,12 +283,12 @@ interface org.automotive.Transmission extends VehiclePropertyType { attribute TransmissionGearType Type; /*! Gear - * \brief Must return transmission gear position 1-10 + * \brief MUST return transmission gear position 1-10 */ attribute UInt8 Gear readonly /*! Mode - * \brief Must return transmission Mode + * \brief MUST return transmission Mode */ attribute TransmissionMode Mode readonly } @@ -297,17 +297,17 @@ interface org.automotive.Transmission extends VehiclePropertyType { interface org.automotive.CruiseControlStatus extends VehiclePropertyType { /*! Activated - * \brief Must return whether or not the Cruise Control system is active (true) or inactive (false). Depricated. Remove in 0.14. Use "Status" + * \brief MUST return whether or not the Cruise Control system is active (true) or inactive (false). Depricated. Remove in 0.14. Use "Status" */ attribute Boolean Activated readonly /*! Speed - * \brief Must return target Cruise Control speed in kilometers per hour (kph). + * \brief MUST return target Cruise Control speed in kilometers per hour (kph). */ attribute UInt16 Speed readonly /*! Status - * \brief Must return whether or not the Cruise Control system is active (true) or inactive (false). + * \brief MUST return whether or not the Cruise Control system is active (true) or inactive (false). */ attribute Boolean Status readonly } @@ -318,7 +318,7 @@ interface org.automotive.CruiseControlStatus extends VehiclePropertyType { interface org.automotive.WheelBrake extends VehiclePropertyType { /*! Engaged - * \brief Must return Wheel Brake status: Engaged = true, disengaged = false + * \brief MUST return Wheel Brake status: Engaged = true, disengaged = false */ attribute Boolean Engaged readonly } @@ -326,7 +326,7 @@ interface org.automotive.WheelBrake extends VehiclePropertyType { interface org.automotive.BrakeOperation extends VehiclePropertyType { /*! BrakePedalDepressed - * \brief must return whether brake pedal is depressed or not. true: brake pedal is depressed, false: brake pedal is not depressed + * \brief MUST return whether brake pedal is depressed or not. true: brake pedal is depressed, false: brake pedal is not depressed */ attribute Boolean BrakePedalDepressed readonly } @@ -334,52 +334,52 @@ interface org.automotive.BrakeOperation extends VehiclePropertyType { interface org.automotive.LightStatus extends VehiclePropertyType { /*! Head - * \brief Must return headlight status: on = true, off = false. + * \brief MUST return headlight status: on = true, off = false. */ attribute Boolean Head /*! RightTurn - * \brief Must return right turn signal status: on = true, off = false. + * \brief MUST return right turn signal status: on = true, off = false. */ attribute Boolean RightTurn /*! LeftTurn - * \brief Must return left turn signal status: on = true, off = false. + * \brief MUST return left turn signal status: on = true, off = false. */ attribute Boolean LeftTurn /*! Brake - * \brief Must return brake signal light status: on = true, off = false. + * \brief MUST return brake signal light status: on = true, off = false. */ attribute Boolean Brake /*! Fog - * \brief Must return fog light status: on = true, off = false. + * \brief MUST return fog light status: on = true, off = false. */ attribute Boolean Fog /*! Hazard - * \brief Must return hazard light status: on = true, off = false. + * \brief MUST return hazard light status: on = true, off = false. */ attribute Boolean Hazard /*! Parking - * \brief Must return parking light status: on = true, off = false. + * \brief MUST return parking light status: on = true, off = false. */ attribute Boolean Parking /*! HighBeam - * \brief Must return high beam status: on = true, off = false. + * \brief MUST return high beam status: on = true, off = false. */ attribute Boolean HighBeam /*! AutomaticHeadlights - * \brief Must return automatic headlight status: on = true, off = false. + * \brief MUST return automatic headlight status: on = true, off = false. */ attribute Boolean AutomaticHeadlights /*! DynamicHighBeam - * \brief Must return dynamic high beam status: on = true, off = false. + * \brief MUST return dynamic high beam status: on = true, off = false. */ attribute Boolean DynamicHighBeam } @@ -388,22 +388,22 @@ interface org.automotive.LightStatus extends VehiclePropertyType { interface org.automotive.InteriorLightStatus extends VehiclePropertyType { /*! Passenger - * \brief Must return passenger interior light status: on = true, off = false. Deprecated. Remove in 0.14. Use status and zone. + * \brief MUST return passenger interior light status: on = true, off = false. Deprecated. Remove in 0.14. Use status and zone. */ attribute Boolean Passenger readonly /*! Driver - * \brief Must return driver interior light status: on = true, off = false. Deprecated. Remove in 0.14. Use status and zone. + * \brief MUST return driver interior light status: on = true, off = false. Deprecated. Remove in 0.14. Use status and zone. */ attribute Boolean Driver readonly /*! Center - * \brief Must return center interior light status: on = true, off = false. Deprecated. Remove in 0.14. Use status and zone. + * \brief MUST return center interior light status: on = true, off = false. Deprecated. Remove in 0.14. Use status and zone. */ attribute Boolean Center readonly /*! Status - * \brief Must return interior light status for the zone. on = true, off = false + * \brief MUST return interior light status for the zone. on = true, off = false */ attribute Boolean Status } @@ -412,7 +412,7 @@ interface org.automotive.InteriorLightStatus extends VehiclePropertyType { interface org.automotive.Horn extends VehiclePropertyType { /*! On - * \brief Must return horn status: on = true, off = false + * \brief MUST return horn status: on = true, off = false */ attribute Boolean On readonly } @@ -421,42 +421,42 @@ interface org.automotive.Horn extends VehiclePropertyType { interface org.automotive.Fuel extends VehiclePropertyType { /*! Level - * \brief Must return fuel level as a percentage of fullness. + * \brief MUST return fuel level as a percentage of fullness. */ attribute UInt16 Level readonly /*! Range - * \brief Must return estimated fuel range in meters. + * \brief MUST return estimated fuel range in meters. */ attribute UInt32 Range readonly /*! InstantConsumption - * \brief Must return instant fuel consumption in per distance travelled (Unit: milliliters per 100 kilometers). + * \brief MUST return instant fuel consumption in per distance travelled (Unit: milliliters per 100 kilometers). */ attribute UInt32 InstantConsumption readonly /*! InstantEconomy - * \brief Must return instant fuel 'economy' in kilometers per liter of fuel. + * \brief MUST return instant fuel 'economy' in kilometers per liter of fuel. */ attribute UInt16 InstantEconomy readonly /*! AverageEconomy - * \brief Must return average fuel 'economy' in kilometers per liter of fuel since last reset. Setting this to any value should reset the counter to '0' + * \brief MUST return average fuel 'economy' in kilometers per liter of fuel since last reset. Setting this to any value should reset the counter to '0' */ attribute UInt16 AverageEconomy; /*! AverageConsumption - * \brief Must return average fuel consumption in per distance travelled (Unit: milliliters per 100 kilometers). Setting this to any value should reset the counter to '0' + * \brief MUST return average fuel consumption in per distance travelled (Unit: milliliters per 100 kilometers). Setting this to any value should reset the counter to '0' */ attribute UInt32 AverageConsumption; /*! FuelConsumedSinceRestart - * \brief must return fuel consumed since engine start; (Unit: milliliters per 100 kilometers) resets to 0 each restart + * \brief MUST return fuel consumed since engine start; (Unit: milliliters per 100 kilometers) resets to 0 each restart */ attribute UInt32 FuelConsumedSinceRestart readonly; /*! TimeSinceRestart - * \brief must return time elapsed since vehicle restart (Unit: seconds) + * \brief MUST return time elapsed since vehicle restart (Unit: seconds) */ attribute UInt32 TimeSinceRestart readonly; } @@ -465,32 +465,32 @@ interface org.automotive.Fuel extends VehiclePropertyType { interface org.automotive.EngineOil extends VehiclePropertyType { /*! Remaining - * \brief Must return remaining engine oil as percentage of fullness. Deprecated. Remove in 0.14. Use "Level" + * \brief MUST return remaining engine oil as percentage of fullness. Deprecated. Remove in 0.14. Use "Level" */ attribute UInt16 Remaining readonly /*! Temperature - * \brief Must return Engine Oil Temperature in Celcius. + * \brief MUST return Engine Oil Temperature in Celcius. */ attribute long Temperature readonly /*! Pressure - * \brief Must return Engine Oil Pressure in kPa. + * \brief MUST return Engine Oil Pressure in kPa. */ attribute UInt16 Pressure readonly /*! Level - * \brief Must return engine oil level (Unit: percentage, 0%: empty, 100%: full + * \brief MUST return engine oil level (Unit: percentage, 0%: empty, 100%: full */ attribute UInt16 Level readonly /*! Change - * \brief Must return engine oil change indicator status: change oil (true) or no change (false) + * \brief MUST return engine oil change indicator status: change oil (true) or no change (false) */ attribute boolean Change readonly /*! LifeRemaining - * \brief Must return engine oil change indicator status: change oil (true) or no change (false) + * \brief MUST return engine oil change indicator status: change oil (true) or no change (false) */ attribute boolean LifeRemaining readonly @@ -500,22 +500,22 @@ interface org.automotive.EngineOil extends VehiclePropertyType { interface org.automotive.Location extends VehiclePropertyType { /*! Latitude - * \brief Must return latitude in Deg.Min (-180, +180) + * \brief MUST return latitude in Deg.Min (-180, +180) */ attribute Double Latitude readonly /*! Longitude - * \brief Must return longitude in Deg.Min (-90, +90) + * \brief MUST return longitude in Deg.Min (-90, +90) */ attribute Double Longitude readonly /*! Altitude - * \brief Must return altitude in meters above sea-level (0). + * \brief MUST return altitude in meters above sea-level (0). */ attribute Double Altitude readonly /*! Direction - * \brief Must return direction in Degrees (0-360) + * \brief MUST return direction in Degrees (0-360) */ attribute UInt16 Direction readonly } @@ -524,7 +524,7 @@ interface org.automotive.Location extends VehiclePropertyType { interface org.automotive.ExteriorBrightness extends VehiclePropertyType { /*! ExteriorBrightness - * \brief Must return the brightness outside the vehicle in lux. + * \brief MUST return the brightness outside the vehicle in lux. */ attribute UInt16 ExteriorBrightness readonly } @@ -533,24 +533,24 @@ interface org.automotive.ExteriorBrightness extends VehiclePropertyType { interface org.automotive.Temperature extends VehiclePropertyType { /*! Interior - * \brief Must return the temperature of the interior of the vehicle in celcius. + * \brief MUST return the temperature of the interior of the vehicle in celcius. */ /// Deprecated. Use InteriorTemperature. Remove in 0.14 attribute signed short Interior readonly /*! Exterior - * \brief Must return the temperature of the exterior of the vehicle in celcius. + * \brief MUST return the temperature of the exterior of the vehicle in celcius. */ /// Deprecated. Use ExteriorTemperature. Remove in 0.14 attribute signed short Exterior readonly /*! Interior - * \brief Must return the temperature of the interior of the vehicle in celcius. + * \brief MUST return the temperature of the interior of the vehicle in celcius. */ attribute signed short InteriorTemperature readonly /*! Exterior - * \brief Must return the temperature of the exterior of the vehicle in celcius. + * \brief MUST return the temperature of the exterior of the vehicle in celcius. */ attribute signed short ExteriorTemperature readonly } @@ -559,22 +559,50 @@ interface org.automotive.Temperature extends VehiclePropertyType { interface org.automotive.RainSensor extends VehiclePropertyType { /*! RainSensor - * \brief Must return level of rain intensity 0: No Rain - 10: Heaviest Rain. + * \brief MUST return level of rain intensity 0: No Rain - 10: Heaviest Rain. + * Deprecated in 0.14. Use rainIntensity */ attribute UInt16 RainSensor readonly + + /*! RainIntensity + * \brief MUST return level of rain intensity 0: No Rain - 10: Heaviest Rain. + */ + attribute UInt16 RainIntensity readonly } +/// TODO: Depricated in 0.14 Use WiperStatus interface org.automotive.WindshieldWiper extends VehiclePropertyType { - const UInt16 WIPERSPEED_OFF = 0; - const UInt16 WIPERSPEED_SLOWEST= 1; - const UInt16 WIPERSPEED_FASTEST = 5; - const UInt16 WIPERSPEED_AUTO = 10; /*! WindshieldWiper - * \brief Must return Level of windshield whiper speed (see WIPERSPEED) + * \brief MUST return Level of windshield whiper speed (0-10) */ attribute UInt16 WindshieldWiper readonly + +} + +enum WiperControl { + off = "off", + once = "once", + slowest = "slowest", + slow = "slow", + middle = "middle", + fast = "fast", + fastest = "fastest", + auto = "auto" +}; + +interface org.automotive.WiperStatus extends VehiclePropertyType { + + /*! WiperSpeed + * \brief MUST return current speed interval of wiping windshield + */ + attribute WiperControl WiperSpeed readonly + + /*! WiperSetting + * \brief MUST return current setting of the front wiper controller. It can be used to send user's request for changing setting. + */ + attribute WiperControl WiperSetting } /*! Deprecated. Use ClimateControl interface. Remove in 0.14 @@ -586,47 +614,47 @@ interface org.automotive.HVAC extends VehiclePropertyType { const UInt16 AIRFLOWDIRECTION_DEFROSTER = 0x04; /*! AirflowDirection - * \brief Must return airflow direction. See + * \brief MUST return airflow direction. See */ attribute UInt16 AirflowDirection; /*! FanSpeed - * \brief Must return speed of the fan (0-7) + * \brief MUST return speed of the fan (0-7) */ attribute UInt16 FanSpeed; /*! TargetTemperature - * \brief Must return target desired temperature in celcius. + * \brief MUST return target desired temperature in celcius. */ attribute UInt16 TargetTemperature; /*! AirConditioning - * \brief Must return air conditioning on (true) / off (false). + * \brief MUST return air conditioning on (true) / off (false). */ attribute Boolean AirConditioning; /*! AirRecirculation - * \brief Must return air recirculation on (true) / off (false). + * \brief MUST return air recirculation on (true) / off (false). */ attribute Boolean AirRecirculation; /*! Heater - * \brief Must return heater on (true) / off (false). + * \brief MUST return heater on (true) / off (false). */ attribute Boolean Heater; /*! SteeringWheelHeater - * \brief Must return air recirculation on (true) / off (false). + * \brief MUST return air recirculation on (true) / off (false). */ attribute Boolean SteeringWheelHeater; /*! SeatHeater - * \brief Must return seat heater status: 0-100%. + * \brief MUST return seat heater status: 0-100%. */ attribute UInt16 SeatHeater; /*! SeatCooler - * \brief Must return seat heater status: on (true) / off (false). + * \brief MUST return seat heater status: on (true) / off (false). */ attribute Boolean SeatCooler; } @@ -641,76 +669,90 @@ enumeration AirflowDirectionType interface org.automotive.ClimateControl extends VehiclePropertyType { /*! AirflowDirection - * \brief Must return current status of the direction of the air flow through the ventilation system + * \brief MUST return current status of the direction of the air flow through the ventilation system */ attribute AirflowDirectionType AirflowDirection; /*! FanSpeedLevel - * \brief Must return seat heater status: on (true) / off (false). + * \brief MUST return seat heater status: on (true) / off (false). */ attribute UInt8 FanSpeedLevel; /*! TargetTemperature - * \brief Must return current setting of the desired temperature (Unit: celsius) + * \brief MUST return current setting of the desired temperature (Unit: celsius) */ attribute Int8 TargetTemperature; /*! AirConditioning - * \brief Must return current status of the air conditioning system: on (true) or off (false) + * \brief MUST return current status of the air conditioning system: on (true) or off (false) */ attribute Boolean AirConditioning; /*! Heater - * \brief Must return current status of the heating system: on (true) or off (false) + * \brief MUST return current status of the heating system: on (true) or off (false) */ attribute Boolean Heater; /*! SeatHeater - * \brief Must return current status of the seat warmer ( 0: off, 1: least warm, 10: warmest ) + * \brief MUST return current status of the seat warmer ( 0: off, 1: least warm, 10: warmest ) */ attribute UInt8 SeatHeater; /*! SeatCooler - * \brief Must return current status of the seat ventilation ( 0: off, 1: least warm, 10: warmest ) + * \brief MUST return current status of the seat ventilation ( 0: off, 1: least warm, 10: warmest ) */ attribute UInt8 SeatCooler; /*! AirRecirculation - * \brief Must return current setting of air recirculation: on (true) or pulling in outside air (false). + * \brief MUST return current setting of air recirculation: on (true) or pulling in outside air (false). */ attribute Boolean AirRecirculation; /*! SteeringWheelHeater - * \brief Must return current status of steering wheel heater ( 0: off, 1: least warm, 10: warmest ). + * \brief MUST return current status of steering wheel heater ( 0: off, 1: least warm, 10: warmest ). */ attribute UInt8 SteeringWheelHeater; } +/// Deprecated in 0.14. Use SideWindow interface org.automotive.WindowStatus extends VehiclePropertyType { /*! Openness - * \brief Must return window openness percentage (100% fully open, 0% fully closed) + * \brief MUST return window openness percentage (100% fully open, 0% fully closed) * for the window location see "zone" attribute */ attribute UInt16 Openness; /*! Defrost - * \brief Must return the defroster status of the window. On = true, Off = false. + * \brief MUST return the defroster status of the window. On = true, Off = false. * Deprecated. Use Defrost interface. Remove in 0.14. */ attribute Boolean Defrost; } +interface org.automotive.SideWindow extends VehiclePropertyType { + + /*! Openness + * \brief MUST return window openness percentage (100% fully open, 0% fully closed) + */ + attribute UInt16 Openness; + + /*! Lock + * \brief MUST return whether or not the window is locked (true) or unlocked (false) + */ + attribute Boolean Lock; +} + interface org.automotive.Defrost extends VehiclePropertyType { /*! DefrostWindow - * \brief Must return current status of the defrost switch for mirrors. It can be + * \brief MUST return current status of the defrost switch for mirrors. It can be * used to send user's request for changing setting. */ attribute Boolean DefrostWindow; /*! DefrostMirrors - * \brief Must return current status of the defrost switch for window. It can be + * \brief MUST return current status of the defrost switch for window. It can be * used to send user's request for changing setting. */ attribute Boolean DefrostMirrors; @@ -719,23 +761,36 @@ interface org.automotive.Defrost extends VehiclePropertyType { interface org.automotive.Sunroof extends VehiclePropertyType { /*! Openness - * \brief Must return window status for sunroof openness percentage. + * \brief MUST return window status for sunroof openness percentage. */ attribute UInt16 Openness; /*! Tilt - * \brief Must return tilt status for sunroof percentage. + * \brief MUST return tilt status for sunroof percentage. */ attribute UInt16 Tilt; } +enum ConvertibleRoofStatus { + closed = "closed", + closing = "closing", + opening = "opening", + opened = "opened" +}; + interface org.automotive.ConvertibleRoof extends VehiclePropertyType { + /*! Status + * \brief MUST return current status of Convertible Roof. + * + */ + attribute ConvertibleRoofStatus Status readonly; - /*! Openness - * \brief Must return convertible roof openness percentage. + /*! Setting + * \brief MUST return current setting of Convertible Roof. This is used to open (true) and close (false). + * */ - attribute UInt16 Openness; + attribute Boolean Setting; } @@ -951,7 +1006,7 @@ interface org.automotive.SecurityAlert extends VehiclePropertyType { interface org.automotive.ParkingBrake extends VehiclePropertyType { /*! ParkingBrake - * must return status of parking brake: Engaged = true, Disengaged = false. + * MUST return status of parking brake: Engaged = true, Disengaged = false. */ attribute Boolean ParkingBrake readonly } @@ -960,7 +1015,7 @@ interface org.automotive.ParkingBrake extends VehiclePropertyType { interface org.automotive.ParkingLight extends VehiclePropertyType { /*! ParkingLight - * must return status of parking light: Engaged = true, Disengaged = false. + * MUST return status of parking light: Engaged = true, Disengaged = false. */ attribute Boolean ParkingLight readonly } @@ -969,7 +1024,7 @@ interface org.automotive.ParkingLight extends VehiclePropertyType { interface org.automotive.HazardLight extends VehiclePropertyType { /*! HazardLight - * must return status of hazard light: Engaged = true, Disengaged = false. + * MUST return status of hazard light: Engaged = true, Disengaged = false. */ attribute Boolean HazardLight readonly } @@ -1154,7 +1209,7 @@ interface org.automotive.DrivingMode extends VehiclePropertyType { attribute UInt16 DrivingMode readonly /*! - * \brief must return true if vehicle is in driving mode + * \brief MUST return true if vehicle is in driving mode */ attribute Boolean Mode readonly } @@ -1341,7 +1396,7 @@ interface org.automotive.EngineCoolant extends VehiclePropertyType { interface org.automotive.PowertrainTorque extends VehiclePropertyType { /*! - * \brief must return powertrain torque (Unit: newton meters) + * \brief MUST return powertrain torque (Unit: newton meters) */ attribute UInt16 Value readonly } @@ -1349,7 +1404,7 @@ interface org.automotive.PowertrainTorque extends VehiclePropertyType { interface org.automotive.AcceleratorPedalPosition extends VehiclePropertyType { /*! - * \brief must return accelerator pedal position as a percentage (Unit: percentage, 0%: released pedal, 100%: fully depressed) + * \brief MUST return accelerator pedal position as a percentage (Unit: percentage, 0%: released pedal, 100%: fully depressed) */ attribute UInt8 Value readonly } @@ -1357,19 +1412,19 @@ interface org.automotive.AcceleratorPedalPosition extends VehiclePropertyType { interface org.automotive.WheelTick extends VehiclePropertyType { /*! - * \brief must return number of ticks per second (Unit: ticks per second) + * \brief MUST return number of ticks per second (Unit: ticks per second) */ attribute UInt8 Value readonly } interface IgnitionTime : VehicleCommonDataType { /*! - * \brief must return time at ignition on + * \brief MUST return time at ignition on */ attribute UInt64 ignitionOnTime readonly /*! - * \brief must return time at ignition off + * \brief MUST return time at ignition off */ attribute UInt64 ignitionOffTime readonly }; @@ -1377,7 +1432,7 @@ interface IgnitionTime : VehicleCommonDataType { interface org.automotive.YawRate extends VehiclePropertyType { /*! - * \brief must return yaw rate of vehicle. (Unit: degrees per second) + * \brief MUST return yaw rate of vehicle. (Unit: degrees per second) */ attribute Int16 Value readonly } @@ -1385,7 +1440,7 @@ interface org.automotive.YawRate extends VehiclePropertyType { interface org.automotive.BrakeOperation extends VehiclePropertyType { /*! - * \brief must return whether brake pedal is depressed or not. true: brake pedal is depressed, false: brake pedal is not depressed + * \brief MUST return whether brake pedal is depressed or not. true: brake pedal is depressed, false: brake pedal is not depressed */ attribute Boolean BrakePedalDepressed readonly } @@ -1416,12 +1471,12 @@ enum ButtonEventType { interface VehicleButton { /*! - * \brief must return the button corresponding to the event. + * \brief MUST return the button corresponding to the event. */ attribute Button button readonly; /*! - * \brief must return the type of event + * \brief MUST return the type of event */ attribute ButtonEventType state readonly; } @@ -1429,7 +1484,7 @@ interface VehicleButton { interface org.automotive.ButtonEvent extends VehiclePropertyType { /*! - * \brief must return the button events that occured. This supports multiple simultanious button events. + * \brief MUST return the button events that occured. This supports multiple simultanious button events. */ attribute array Button of VehicleButton readonly; } @@ -1437,12 +1492,12 @@ interface org.automotive.ButtonEvent extends VehiclePropertyType { interface org.automotive.TransmissionOil extends VehiclePropertyType { /*! - * \brief must return current temperature of the transmission oil(Unit: celsius). + * \brief MUST return current temperature of the transmission oil(Unit: celsius). */ attribute Int8 Temperature readonly; /*! - * \brief must return transmission oil wear (Unit: percentage, 0: no wear, 100: completely worn). + * \brief MUST return transmission oil wear (Unit: percentage, 0: no wear, 100: completely worn). */ attribute UInt8 Wear readonly; } @@ -1450,7 +1505,7 @@ interface org.automotive.TransmissionOil extends VehiclePropertyType { interface org.automotive.TransmissionClutch extends VehiclePropertyType { /*! - * \brief must return transmission clutch wear (Unit: percentage, 0: no wear, 100: completely worn). + * \brief MUST return transmission clutch wear (Unit: percentage, 0: no wear, 100: completely worn). */ attribute UInt8 Wear readonly; } @@ -1458,22 +1513,22 @@ interface org.automotive.TransmissionClutch extends VehiclePropertyType { interface org.automotive.BrakeMaintenance extends VehiclePropertyType { /*! - * \brief must return brake pad wear (Unit: percentage, 0%: no wear, 100%: completely worn). + * \brief MUST return brake pad wear (Unit: percentage, 0%: no wear, 100%: completely worn). */ attribute UInt8 PadWear readonly; /*! - * \brief must return brake fluid level (Unit: percentage, 0%: empty, 100%: full). + * \brief MUST return brake fluid level (Unit: percentage, 0%: empty, 100%: full). */ attribute UInt8 FluidLevel readonly; /*! - * \brief must return true if brake fluid level: low (true), not low (false) + * \brief MUST return true if brake fluid level: low (true), not low (false) */ attribute Boolean FluidLevelLow readonly; /*! - * \brief must return true if brakes are worn: worn (true), not worn (false) + * \brief MUST return true if brakes are worn: worn (true), not worn (false) */ attribute Boolean BrakesWorn readonly; } @@ -1481,12 +1536,12 @@ interface org.automotive.BrakeMaintenance extends VehiclePropertyType { interface org.automotive.WasherFluid extends VehiclePropertyType { /*! - * \brief must return washer fluid level (Unit: percentage, 0%: empty, 100%: full). + * \brief MUST return washer fluid level (Unit: percentage, 0%: empty, 100%: full). */ attribute UInt8 Level readonly; /*! - * \brief must return true if washer fluid level is low: low (true), not low: (false) + * \brief MUST return true if washer fluid level is low: low (true), not low: (false) */ attribute Boolean LevelLow readonly; } @@ -1494,7 +1549,7 @@ interface org.automotive.WasherFluid extends VehiclePropertyType { interface org.automotive.MalfunctionIndicator extends VehiclePropertyType { /*! - * \brief must return true if washer fluid level is low: low (true), not low: (false) + * \brief MUST return true if washer fluid level is low: low (true), not low: (false) */ attribute Boolean On readonly; } @@ -1502,27 +1557,27 @@ interface org.automotive.MalfunctionIndicator extends VehiclePropertyType { interface org.automotive.Diagnostic extends VehiclePropertyType { /*! - * \brief must return engine runtime (Unit: seconds) + * \brief MUST return engine runtime (Unit: seconds) */ attribute UInt32 AccumulatedEngineRuntime readonly; /*! - * \brief must return distance travelled since the codes were last cleared (Unit: meters) + * \brief MUST return distance travelled since the codes were last cleared (Unit: meters) */ attribute UInt32 DistanceSinceCodeCleared readonly; /*! - * \brief must return distance travelled with the malfunction indicator light on (Unit: meters) + * \brief MUST return distance travelled with the malfunction indicator light on (Unit: meters) */ attribute UInt32 DistanceWithMILOn readonly; /*! - * \brief must return time elapsed with the malfunction indicator light on (Unit: seconds) + * \brief MUST return time elapsed with the malfunction indicator light on (Unit: seconds) */ attribute UInt32 TimeRunMILOn readonly; /*! - * \brief must return time elapsed since the trouble codes were last cleared (Unit: seconds) + * \brief MUST return time elapsed since the trouble codes were last cleared (Unit: seconds) */ attribute UInt32 TimeTroubleCodeClear readonly; } @@ -1530,12 +1585,12 @@ interface org.automotive.Diagnostic extends VehiclePropertyType { interface org.automotive.Mirror extends VehiclePropertyType { /*! - * \brief must return mirror pan position in percentage distance travelled, from left to right position (Unit: percentage, %0: center position, -100%: fully left, 100%: fully right) + * \brief MUST return mirror pan position in percentage distance travelled, from left to right position (Unit: percentage, %0: center position, -100%: fully left, 100%: fully right) */ attribute UInt8 MirrorPan; /*! - * \brief must return mirror tilt position in percentage distance travelled, from downward-facing to upward-facing position (Unit: percentage, 0%:center position, -100%:fully downward, 100%:full upward) + * \brief MUST return mirror tilt position in percentage distance travelled, from downward-facing to upward-facing position (Unit: percentage, 0%:center position, -100%:fully downward, 100%:full upward) */ attribute UInt8 MirrorTilt; } @@ -1677,4 +1732,8 @@ interface org.automotive.Seat extends VehiclePropertyType { attribute IdentificationTypeEnum IdentificationType; } - +interface org.automotive.AtmosphericPressure extends VehiclePropertyType { + /*! + * \brief MUST return the current atmospheric pressure outside of the vehicle (Unit: hectopascal) + */ + attribute UInt16 Pressure; diff --git a/docs/dbus.idl b/docs/dbus.idl index a14ac1e0..e73c5837 100644 --- a/docs/dbus.idl +++ b/docs/dbus.idl @@ -9,7 +9,7 @@ * /{source}/{zone}/DataType. "source" refers to the AMB source that produces the data. "zone" * refers to the zone in which the data type is located in the vehicle or "0" for no zone. * -* The interfaces and data types are documented in <a href="amb.idl">amb.idl</a>. Franca IDL +* The interfaces and data types are documented in <a href="amb.fidl">amb.fidl</a>. Franca IDL * tools can be used to generate DBus introspection xml which can be used to generate bindings * for your language of choice. * diff --git a/lib/vehicleproperty.cpp b/lib/vehicleproperty.cpp index d5906480..96b10060 100644 --- a/lib/vehicleproperty.cpp +++ b/lib/vehicleproperty.cpp @@ -88,6 +88,19 @@ const char* Drive::W3C::Eco = "eco"; const char* Drive::W3C::Manual = "manual"; const char* Drive::W3C::Winter = "winter"; +const char * WiperSpeedSetting::W3C::Off = "off"; +const char * WiperSpeedSetting::W3C::Once = "once"; +const char * WiperSpeedSetting::W3C::Slowest = "slowest"; +const char * WiperSpeedSetting::W3C::Slow = "slow"; +const char * WiperSpeedSetting::W3C::Middle = "middle"; +const char * WiperSpeedSetting::W3C::Fast = "fast"; +const char * WiperSpeedSetting::W3C::Fastest = "fastest"; +const char * WiperSpeedSetting::W3C::Auto = "auto"; + +const char * ConvertibleRoofW3C::Closed = "closed"; +const char * ConvertibleRoofW3C::Closing = "closing"; +const char * ConvertibleRoofW3C::Opened = "opened"; +const char * ConvertibleRoofW3C::Opening = "opening"; const VehicleProperty::Property VehicleProperty::NoValue = "NoValue"; const VehicleProperty::Property VehicleProperty::VehicleSpeed = "VehicleSpeed"; @@ -202,6 +215,8 @@ const VehicleProperty::Property VehicleProperty::OccupantStatusW3C = "OccupantSt const VehicleProperty::Property VehicleProperty::ObstacleDistance = "ObstacleDistance"; const VehicleProperty::Property VehicleProperty::RainSensor = "RainSensor"; const VehicleProperty::Property VehicleProperty::WindshieldWiper = "WindshieldWiper"; +const VehicleProperty::Property VehicleProperty::WindshieldWiperSpeed = "WindshieldWiperSpeed"; +const VehicleProperty::Property VehicleProperty::WindshieldWiperSetting = "WindshieldWiperSetting"; const VehicleProperty::Property VehicleProperty::AirflowDirection = "AirflowDirection"; const VehicleProperty::Property VehicleProperty::AirflowDirectionW3C = "AirflowDirectionW3C"; const VehicleProperty::Property VehicleProperty::FanSpeed = "FanSpeed"; @@ -219,6 +234,7 @@ const VehicleProperty::Property VehicleProperty::WindowStatus = "WindowStatus"; const VehicleProperty::Property VehicleProperty::Sunroof = "Sunroof"; const VehicleProperty::Property VehicleProperty::SunroofTilt = "SunroofTilt"; const VehicleProperty::Property VehicleProperty::ConvertibleRoof = "ConvertibleRoof"; +const VehicleProperty::Property VehicleProperty::ConvertibleRoofStatus = "ConvertibleRoofStatus"; const VehicleProperty::Property VehicleProperty::NightMode = "NightMode"; const VehicleProperty::Property VehicleProperty::DrivingMode = "DrivingMode"; const VehicleProperty::Property VehicleProperty::DrivingModeW3C = "DrivingModeW3C"; @@ -265,6 +281,7 @@ const VehicleProperty::Property VehicleProperty::ElectronicStabilityControlEnabl const VehicleProperty::Property VehicleProperty::ElectronicStabilityControlEngaged = "ElectronicStabilityControlEngaged"; const VehicleProperty::Property VehicleProperty::OccupantIdentificationType = "OccupantIdentificationType"; const VehicleProperty::Property VehicleProperty::OccupantName = "OccupantName"; +const VehicleProperty::Property VehicleProperty::AtmosphericPressure = "AtmosphericPressure"; PropertyList VehicleProperty::mCapabilities; PropertyList VehicleProperty::mCustomProperties; @@ -399,6 +416,8 @@ VehicleProperty::VehicleProperty() REGISTERPROPERTY(RainSensor, 0); REGISTERPROPERTY(WindshieldWiper, Window::Off); + REGISTERPROPERTY(WindshieldWiperSpeed, WiperSpeedSetting::W3C::Off); + REGISTERPROPERTY(WindshieldWiperSetting, WiperSpeedSetting::W3C::Off); REGISTERPROPERTY(AirflowDirection, HVAC::Front); REGISTERPROPERTY(AirflowDirectionW3C, HVAC::W3C::FloorPanel); REGISTERPROPERTY(FanSpeed, 0); @@ -418,6 +437,8 @@ VehicleProperty::VehicleProperty() REGISTERPROPERTY(Sunroof, 0); REGISTERPROPERTY(SunroofTilt, 0); REGISTERPROPERTY(ConvertibleRoof, false); + REGISTERPROPERTY(ConvertibleRoofStatus, ""); + REGISTERPROPERTY(NightMode, false); REGISTERPROPERTY(DrivingMode, Driving::None); REGISTERPROPERTY(DrivingModeW3C, false); @@ -474,7 +495,7 @@ VehicleProperty::VehicleProperty() REGISTERPROPERTY(ElectronicStabilityControlEngaged, false); REGISTERPROPERTY(OccupantIdentificationType, Seat::W3C::Pin); REGISTERPROPERTY(OccupantName, ""); - + REGISTERPROPERTY(AtmosphericPressure, 0); } void VehicleProperty::factory() @@ -544,3 +565,4 @@ bool VehicleProperty::registerPropertyPriv(VehicleProperty::Property name, Vehic } + diff --git a/lib/vehicleproperty.h b/lib/vehicleproperty.h index fe36f0b2..40c25faa 100644 --- a/lib/vehicleproperty.h +++ b/lib/vehicleproperty.h @@ -246,19 +246,6 @@ extern const char * Voice; namespace Window { -enum Location -{ - Driver = 0, - Passenger, - LeftRear, - RightRear, - Sunroof, - Windshield, - SideMirrorLeft, - SideMirrorRight, - Rear -}; - enum WiperSpeed { Off = 0, @@ -266,7 +253,29 @@ enum WiperSpeed Fastest = 5, Auto = 10 }; +} + +namespace ConvertibleRoofW3C +{ +extern const char * Opened; +extern const char * Opening; +extern const char * Closed; +extern const char * Closing; +} +namespace WiperSpeedSetting +{ +namespace W3C +{ +extern const char * Off; +extern const char * Once; +extern const char * Slowest; +extern const char * Slow; +extern const char * Middle; +extern const char * Fast; +extern const char * Fastest; +extern const char * Auto; +} } namespace HVAC @@ -800,7 +809,9 @@ public: static const Property DoorStatus; PROPERTYTYPEBASIC(DoorStatus, Door::Status) - /** use with Door::W3C::* + /*! + * \brief DoorStatusW3C + * use with Door::W3C::* */ static const Property DoorStatusW3C; PROPERTYTYPE(DoorStatusW3C, DoorStatusW3CType, StringPropertyType, std::string) @@ -829,11 +840,24 @@ public: static const Property RainSensor; PROPERTYTYPEBASIC(RainSensor, uint16_t) - //typedef BasicPropertyType<uint16_t> RainSensorType; + ///TODO Deprecated in 0.14. Use WinshieldWiperSpeed static const Property WindshieldWiper; - PROPERTYTYPEBASIC(WindshieldWiper,Window::WiperSpeed) - //typedef BasicPropertyType<Window::WiperSpeed> WindshieldWiperType; + PROPERTYTYPEBASIC(WindshieldWiper, Window::WiperSpeed) + + /*! + * \brief WindshieldWiperSpeed + * Use WiperSpeedSetting::W3C::* for value + */ + static const Property WindshieldWiperSpeed; + PROPERTYTYPE(WindshieldWiperSpeed, WindshieldWiperSpeedType, StringPropertyType, std::string) + + /*! + * \brief WindshieldWiperSetting + * Use WiperSpeedSetting::W3C::* for value + */ + static const Property WindshieldWiperSetting; + PROPERTYTYPE(WindshieldWiperSetting, WindshieldWiperSettingType, StringPropertyType, std::string) /// TODO: Deprecated. Remove in 0.14 static const Property AirflowDirection; @@ -892,7 +916,12 @@ public: static const Property ConvertibleRoof; PROPERTYTYPEBASIC(ConvertibleRoof, bool) - //typedef BasicPropertyType<bool> ConvertibleRoofType; + + /*! + * \brief ConvertibleRoofStatus use with ConvertibleRoofW3C::* + */ + static const Property ConvertibleRoofStatus; + PROPERTYTYPE(ConvertibleRoofStatus, ConvertibleRoofStatusType, StringPropertyType, std::string) static const Property NightMode; PROPERTYTYPEBASIC(NightMode, bool) @@ -1019,6 +1048,9 @@ public: static const Property OccupantName; PROPERTYTYPE(OccupantName, OccupantNameType, StringPropertyType, std::string) + static const Property AtmosphericPressure; + PROPERTYTYPEBASIC(AtmosphericPressure, uint16_t) + /** END PROPERTIES **/ /*! diff --git a/packaging/automotive-message-broker.spec.in b/packaging/automotive-message-broker.spec.in index 618b484a..25850843 100644 --- a/packaging/automotive-message-broker.spec.in +++ b/packaging/automotive-message-broker.spec.in @@ -1,8 +1,8 @@ -%bcond_with qt5 +%bcond_without qt5 Name: automotive-message-broker Summary: Automotive Message Broker is a vehicle network abstraction system -Version: 0.12.803 +Version: @PROJECT_VERSION@ Release: 0 Group: Automotive/Service License: LGPL-2.1 @@ -125,7 +125,7 @@ Requires: %{name}-plugins-common = %{version}-%{release} OBD-II plugin that uses ELM 327-compatible scantools to access vehicle data %package plugins-wheel -Summary: Source plugin for using the Logitech G27 racing wheel +Summary: Source plugin for using the Logitech G27 racing wheel Group: Automotive/Libraries Requires: %{name} = %{version}-%{release} diff --git a/plugins/bluemonkey/bluemonkey.cpp b/plugins/bluemonkey/bluemonkey.cpp index 556bb5f6..38d39a6d 100644 --- a/plugins/bluemonkey/bluemonkey.cpp +++ b/plugins/bluemonkey/bluemonkey.cpp @@ -232,6 +232,13 @@ void BluemonkeySink::loadConfig(QString str) QJSValue val = engine->evaluate(script); DebugOut()<<val.toString().toStdString()<<endl; + + if(val.isError()) + { + DebugOut(DebugOut::Error) << val.property("name").toString().toStdString() << endl; + DebugOut(DebugOut::Error) << val.property("message").toString().toStdString() << endl; + DebugOut(DebugOut::Error) << str.toStdString() << ":" <<val.property("lineNumber").toString().toStdString() << endl; + } } bool BluemonkeySink::loadModule(QString path) diff --git a/plugins/bluemonkey/config.js b/plugins/bluemonkey/config.js index 410c275f..12d747dc 100644 --- a/plugins/bluemonkey/config.js +++ b/plugins/bluemonkey/config.js @@ -12,6 +12,8 @@ var Zone = { BackSide : 1 << 9 }; +Zone.Driver = Zone.Front | Zone.Left; + bluemonkey.loadModule(""); bluemonkey.createCustomProperty("VehicleSpeed", 10); @@ -93,20 +95,39 @@ bluemonkey.createCustomProperty("BatteryVoltage", 13); bluemonkey.createCustomProperty("BatteryCurrent", 1); bluemonkey.createCustomProperty("BatteryChargeLevel", 100); -bluemonkey.createCustomProperty("TirePressure", 200); -bluemonkey.createCustomProperty("TirePressureLow", false); -bluemonkey.createCustomProperty("TireTemperature", 20); +bluemonkey.createCustomProperty("TirePressure", 200, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("TirePressureLow", false, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("TireTemperature", 20, Zone.Front | Zone.Right); + +bluemonkey.createCustomProperty("TirePressure", 200, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("TirePressureLow", false, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("TireTemperature", 20, Zone.Front | Zone.Left); + +bluemonkey.createCustomProperty("TirePressure", 200, Zone.Rear| Zone.Right); +bluemonkey.createCustomProperty("TirePressureLow", false, Zone.Rear | Zone.Right); +bluemonkey.createCustomProperty("TireTemperature", 20, Zone.Rear | Zone.Right); + +bluemonkey.createCustomProperty("TirePressure", 200, Zone.Rear | Zone.Left); +bluemonkey.createCustomProperty("TirePressureLow", false, Zone.Rear | Zone.Left); +bluemonkey.createCustomProperty("TireTemperature", 20, Zone.Rear | Zone.Left); bluemonkey.createCustomProperty("ActiveNoiseControlMode", false); bluemonkey.createCustomProperty("AvailableSounds", ["LightSpeed", "v8"]); bluemonkey.createCustomProperty("EngineSoundEnhancementMode", ""); -bluemonkey.createCustomProperty("SeatPositionBackCushion", 0); -bluemonkey.createCustomProperty("SeatPositionRecline", 0); -bluemonkey.createCustomProperty("SeatPositionSlide", 0); -bluemonkey.createCustomProperty("SeatPositionCushionHeight", 0); -bluemonkey.createCustomProperty("SeatPositionHeadrest", 0); -bluemonkey.createCustomProperty("SeatPositionSideCushion", 0); +bluemonkey.createCustomProperty("SeatPositionBackCushion", 0, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("SeatPositionRecline", 0, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("SeatPositionSlide", 0, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("SeatPositionCushionHeight", 0, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("SeatPositionHeadrest", 0, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("SeatPositionSideCushion", 0, Zone.Front | Zone.Right); + +bluemonkey.createCustomProperty("SeatPositionBackCushion", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SeatPositionRecline", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SeatPositionSlide", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SeatPositionCushionHeight", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SeatPositionHeadrest", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SeatPositionSideCushion", 0, Zone.Front | Zone.Left); bluemonkey.createCustomProperty("VehicleDriveMode", "auto"); @@ -166,6 +187,57 @@ bluemonkey.createCustomProperty("OccupantIdentificationType", "Bluetooth", Zone. bluemonkey.createCustomProperty("OccupantIdentificationType", "pin", Zone.Rear | Zone.Right); bluemonkey.createCustomProperty("OccupantIdentificationType", "pin", Zone.Rear | Zone.Left); +bluemonkey.createCustomProperty("TargetTemperature", 20); + +bluemonkey.createCustomProperty("AirflowDirection", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("FanSpeed", 1, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("TargetTemperature", 20, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("AirConditioning", false, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("AirRecirculation", false, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("Heater", false, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SteeringWheelHeater", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SeatHeater", 0, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("SeatCooler", 0, Zone.Front | Zone.Left); + +bluemonkey.createCustomProperty("AirflowDirection", 0, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("FanSpeed", 1, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("TargetTemperature", 25, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("AirConditioning", false, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("AirRecirculation", false, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("Heater", false, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("SeatHeater", 0, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("SeatCooler", 0, Zone.Front | Zone.Right); + +bluemonkey.createCustomProperty("ExteriorTemperature", 30.0); +bluemonkey.createCustomProperty("InteriorTemperature", 23.0); + +bluemonkey.createCustomProperty("DefrostWindow", false, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("DefrostMirrors", false, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("DefrostWindow", false, Zone.Front | Zone.Left); +bluemonkey.createCustomProperty("DefrostMirrors", false, Zone.Front | Zone.Left); + +bluemonkey.createCustomProperty("RainSensor", 0); + +bluemonkey.createCustomProperty("WindsheildWiperSpeed", "off"); +bluemonkey.createCustomProperty("WindsheildWiperSetting", "auto"); + +bluemonkey.createCustomProperty("ConvertableRoof", false); +bluemonkey.createCustomProperty("ConvertableRoofStatus", "closed"); + +bluemonkey.createCustomProperty("Sunroof", 0); +bluemonkey.createCustomProperty("SunroofTilt", 0); + +bluemonkey.createCustomProperty("WindowStatus", 100, Zone.Driver); +bluemonkey.createCustomProperty("WindowLockStatus", false, Zone.Driver); +bluemonkey.createCustomProperty("WindowStatus", 100, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("WindowLockStatus", false, Zone.Front | Zone.Right); +bluemonkey.createCustomProperty("WindowStatus", 100, Zone.Rear| Zone.Right); +bluemonkey.createCustomProperty("WindowLockStatus", true, Zone.Rear | Zone.Right); +bluemonkey.createCustomProperty("WindowStatus", 100, Zone.Rear| Zone.Left); +bluemonkey.createCustomProperty("WindowLockStatus", true, Zone.Rear | Zone.Left); + +bluemonkey.createCustomProperty("AtmosphericPressure", 1013); + var speedProperty = bluemonkey.subscribeTo("VehicleSpeed"); var testTimer = bluemonkey.createTimer(); diff --git a/plugins/dbus/dbusinterfacemanager.cpp b/plugins/dbus/dbusinterfacemanager.cpp index fb088baf..f133646a 100644 --- a/plugins/dbus/dbusinterfacemanager.cpp +++ b/plugins/dbus/dbusinterfacemanager.cpp @@ -162,13 +162,13 @@ DBusInterfaceManager::DBusInterfaceManager(AbstractRoutingEngine* engine,std::ma :AbstractSink(engine,config),re(engine), connection(nullptr) { ownerId = g_bus_own_name(G_BUS_TYPE_SYSTEM, - DBusServiceName, - G_BUS_NAME_OWNER_FLAGS_NONE, - on_bus_acquired, - on_name_acquired, - on_name_lost, - this, - NULL); + DBusServiceName, + G_BUS_NAME_OWNER_FLAGS_NONE, + on_bus_acquired, + on_name_acquired, + on_name_lost, + this, + NULL); } @@ -266,6 +266,9 @@ void DBusInterfaceManager::registerTypes() exportProperty<ChildSafetyLock>(re, connection); exportProperty<SeatProperty>(re, connection); exportProperty<DoorProperty>(re, connection); + exportProperty<WindshieldWiperStatus>(re, connection); + exportProperty<SideWindowStatusProperty>(re, connection); + exportProperty<AtmosphericPressure>(re, connection); PropertyList list = VehicleProperty::customProperties(); PropertyList implemented = AbstractDBusInterface::implementedProperties(); @@ -294,5 +297,3 @@ void DBusInterfaceManager::registerTypes() } } } - - diff --git a/plugins/dbus/environmentproperties.h b/plugins/dbus/environmentproperties.h index 0edf4c9c..a235f976 100644 --- a/plugins/dbus/environmentproperties.h +++ b/plugins/dbus/environmentproperties.h @@ -30,22 +30,13 @@ public: Temperature(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("Temperature", 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. - */ + + ///TODO Depricated in 0.14. Use InteriorTemperature wantPropertyVariant(VehicleProperty::InteriorTemperature, "Interior", AbstractProperty::Read); wantPropertyVariant(VehicleProperty::InteriorTemperature, "InteriorTemperature", AbstractProperty::Read); - /** - * @attributeName Exterior - * @type signed long - * @access readonly - * @attributeComment \brief Must return the temperature of the exterior of the vehicle in celcius. - */ + ///TODO Depricated in 0.14. Use ExteriorTemperature wantPropertyVariant(VehicleProperty::ExteriorTemperature, "Exterior", AbstractProperty::Read); wantPropertyVariant(VehicleProperty::ExteriorTemperature, "ExteriorTemperature", AbstractProperty::Read); @@ -61,43 +52,37 @@ public: RainSensor(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("RainSensor", 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. - */ - wantPropertyVariant(VehicleProperty::RainSensor, "RainSensor", "q", AbstractProperty::Read); - + ///TODO: Depricated in 0.14 + wantPropertyVariant(VehicleProperty::RainSensor, "RainSensor", AbstractProperty::Read); + wantPropertyVariant(VehicleProperty::RainSensor, "RainIntensity", AbstractProperty::Read); } }; /** @interface WindshieldWiper : VehiclePropertyType **/ +///TODO: depricated in 0.14 class WindshieldWiper: public DBusSink { public: WindshieldWiper(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("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_) - */ - wantPropertyVariant(VehicleProperty::RainSensor, "WindshieldWiper", "y", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::WindshieldWiper, "WindshieldWiper", AbstractProperty::ReadWrite); + } +}; +class WindshieldWiperStatus: public DBusSink +{ +public: + WindshieldWiperStatus(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) + :DBusSink("WiperStatus", re, connection, map<string, string>()) + { + wantPropertyVariant(VehicleProperty::WindshieldWiperSpeed, "WiperSpeed", AbstractProperty::Read); + wantPropertyVariant(VehicleProperty::WindshieldWiperSetting, "WiperSetting", AbstractProperty::ReadWrite); } }; /** @interface HVAC : VehiclePropertyType **/ +///TODO Depricated in 0.14. Use ClimateControl class HVACProperty: public DBusSink { public: @@ -118,7 +103,7 @@ public: * @attributeComment \brief Must return airflow direction. See AIRFLOWDIRECTION_*. */ /// TODO: Deprecated. Remove in 0.13 - wantPropertyVariant(VehicleProperty::AirflowDirection, "AirflowDirection", "y", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::AirflowDirection, "AirflowDirection", AbstractProperty::ReadWrite); /** * @attributeName FanSpeed @@ -215,6 +200,7 @@ public: }; /** @interface WindowStatus : VehiclePropertyType **/ +/// TODO: Depricated in 0.14. Use SideWindow class WindowStatusProperty: public DBusSink { public: @@ -226,6 +212,17 @@ public: } }; +class SideWindowStatusProperty: public DBusSink +{ +public: + SideWindowStatusProperty(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) + :DBusSink("SideWindow", re, connection, map<string, string>()) + { + wantPropertyVariant(VehicleProperty::WindowStatus,"Openness", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::WindowLockStatus, "Lock", AbstractProperty::ReadWrite); + } +}; + class DefrostProperty: public DBusSink { public: @@ -244,10 +241,8 @@ public: Sunroof(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("Sunroof", re, connection, map<string, string>()) { - wantPropertyVariant(VehicleProperty::Sunroof, "Openness", "y", AbstractProperty::ReadWrite); - - wantPropertyVariant(VehicleProperty::SunroofTilt, "Tilt", "y", AbstractProperty::ReadWrite); - + wantPropertyVariant(VehicleProperty::Sunroof, "Openness", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::SunroofTilt, "Tilt", AbstractProperty::ReadWrite); } }; @@ -258,7 +253,18 @@ public: ConvertibleRoof(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) :DBusSink("ConvertibleRoof", re, connection, map<string, string>()) { - wantPropertyVariant(VehicleProperty::ConvertibleRoof, "Openness", "y", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::ConvertibleRoof, "Setting", AbstractProperty::ReadWrite); + wantPropertyVariant(VehicleProperty::ConvertibleRoofStatus, "Status", AbstractProperty::Read); + } +}; + +class AtmosphericPressure: public DBusSink +{ +public: + AtmosphericPressure(VehicleProperty::Property, AbstractRoutingEngine* re, GDBusConnection* connection) + :DBusSink("AtmosphericPressure", re, connection, map<string, string>()) + { + wantPropertyVariant(VehicleProperty::AtmosphericPressure, "Pressure", AbstractProperty::ReadWrite); } }; #endif diff --git a/plugins/dbus/varianttype.cpp b/plugins/dbus/varianttype.cpp index 933eccad..6af9d03d 100644 --- a/plugins/dbus/varianttype.cpp +++ b/plugins/dbus/varianttype.cpp @@ -68,8 +68,7 @@ void VariantType::fromGVariant(GVariant *val) { DebugOut(DebugOut::Error)<<"SetProperty fail: "<<reply->error<<endl; } - ///TODO: we segfault here. - ///if(v) delete v; + delete reply; }; diff --git a/xwalk/vehicle_api.js b/xwalk/vehicle_api.js index 2212834e..93150a21 100644 --- a/xwalk/vehicle_api.js +++ b/xwalk/vehicle_api.js @@ -358,4 +358,6 @@ _defineVehicleSignalProperty(exports, 'rainSensor'); _defineVehicleSignalProperty(exports, 'wiperStatus'); _defineVehicleSignalProperty(exports, 'climateControl'); _defineVehicleSignalProperty(exports, 'defrost'); +_defineVehicleSignalProperty(exports, 'sunroof'); +_defineVehicleSignalProperty(exports, 'atmosphericPressure'); |