2 Copyright (C) 2012 Intel Corporation
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef _PROPERTIES_H_H_H_
20 #define _PROPERTIES_H_H_H_
22 #include "dbusplugin.h"
23 #include "abstractdbusinterface.h"
24 #include "abstractroutingengine.h"
26 class VehicleSpeedProperty: public DBusSink
29 VehicleSpeedProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
30 :DBusSink("org.automotive.vehicleSpeed","/org/automotive/runningstatus/vehicleSpeed", re, connection, map<string, string>())
32 wantProperty<uint16_t>(VehicleProperty::VehicleSpeed,"VehicleSpeed", "i", AbstractProperty::Read);
33 supportedChanged(re->supported());
39 class EngineSpeedProperty: public DBusSink
42 EngineSpeedProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
43 :DBusSink("org.automotive.engineSpeed","/org/automotive/runningstatus/engineSpeed", re, connection, map<string, string>())
45 wantProperty<uint16_t>(VehicleProperty::EngineSpeed,"EngineSpeed", "i", AbstractProperty::Read);
46 supportedChanged(re->supported());
52 class TirePressureProperty: public DBusSink
55 TirePressureProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
56 :DBusSink("org.automotive.tirePressure","/org/automotive/maintainance/tirePressure", re, connection, map<string, string>())
58 wantProperty<double>(VehicleProperty::TirePressureLeftFront,"LeftFront", "d", AbstractProperty::Read);
59 wantProperty<double>(VehicleProperty::TirePressureRightFront,"RightFront", "d", AbstractProperty::Read);
60 wantProperty<double>(VehicleProperty::TirePressureLeftRear,"LeftRear", "d", AbstractProperty::Read);
61 wantProperty<double>(VehicleProperty::TirePressureRightRear,"RightRear", "d", AbstractProperty::Read);
62 supportedChanged(re->supported());
66 class VehiclePowerModeProperty: public DBusSink
69 VehiclePowerModeProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
70 :DBusSink("org.automotive.vehiclePowerMode","/org/automotive/runningstatus/vehiclePowerMode", re, connection, map<string, string>())
72 wantProperty<Power::PowerModes>(VehicleProperty::VehiclePowerMode, "VehiclePowerMode","b",AbstractProperty::Read);
73 supportedChanged(re->supported());
77 class TripMeterProperty: public DBusSink
80 TripMeterProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
81 :DBusSink("org.automotive.tripMeter","/org/automotive/runningstatus/tripMeter", re, connection, map<string, string>())
83 wantProperty<uint16_t>(VehicleProperty::TripMeterA, "A", "q", AbstractProperty::ReadWrite);
84 wantProperty<uint16_t>(VehicleProperty::TripMeterB, "B", "q", AbstractProperty::ReadWrite);
85 wantProperty<uint16_t>(VehicleProperty::TripMeterC, "C", "q", AbstractProperty::ReadWrite);
86 supportedChanged(re->supported());
90 class AccelerationProperty: public DBusSink
93 AccelerationProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
94 :DBusSink("org.automotive.acceleration","/org/automotive/runningstatus/acceleration", re, connection, map<string, string>())
96 wantProperty<uint16_t>(VehicleProperty::AccelerationX, "X", "q", AbstractProperty::Read);
97 wantProperty<uint16_t>(VehicleProperty::AccelerationY, "Y", "q", AbstractProperty::Read);
98 wantProperty<uint16_t>(VehicleProperty::AccelerationZ, "Z", "q", AbstractProperty::Read);
99 supportedChanged(re->supported());
103 class TransmissionProperty: public DBusSink
106 TransmissionProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
107 :DBusSink("org.automotive.transmission","/org/automotive/runningstatus/transmission", re, connection, map<string, string>())
109 wantProperty<Transmission::TransmissionPositions>(VehicleProperty::TransmissionShiftPosition,
110 "ShiftPosition", "y", AbstractProperty::Read);
111 wantProperty<Transmission::TransmissionPositions>(VehicleProperty::TransmissionGearPosition,
112 "GearPosition", "y", AbstractProperty::Read);
113 wantProperty<Transmission::Mode>(VehicleProperty::TransmissionMode,
114 "Mode", "y", AbstractProperty::Read);
116 supportedChanged(re->supported());
120 class TireTemperatureProperty: public DBusSink
123 TireTemperatureProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
124 :DBusSink("org.automotive.tireTemperature","/org/automotive/maintainance/tireTemperature", re, connection, map<string, string>())
126 wantProperty<double>(VehicleProperty::TireTemperatureLeftFront,"LeftFront", "d", AbstractProperty::Read);
127 wantProperty<double>(VehicleProperty::TireTemperatureRightFront,"RightFront", "d", AbstractProperty::Read);
128 wantProperty<double>(VehicleProperty::TireTemperatureLeftRear,"LeftRear", "d", AbstractProperty::Read);
129 wantProperty<double>(VehicleProperty::TireTemperatureRightRear,"RightRear", "d", AbstractProperty::Read);
130 supportedChanged(re->supported());
135 class CruiseControlProperty: public DBusSink
138 CruiseControlProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
139 :DBusSink("org.automotive.cruiseControlStatus","/org/automotive/runningstatus/cruiseControlStatus", re, connection, map<string, string>())
141 wantProperty<bool>(VehicleProperty::CruiseControlActive, "Activated", "b", AbstractProperty::Read);
142 wantProperty<uint16_t>(VehicleProperty::CruiseControlSpeed, "Speed", "q", AbstractProperty::Read);
143 supportedChanged(re->supported());
147 class WheelBrakeProperty: public DBusSink
150 WheelBrakeProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
151 :DBusSink("org.automotive.wheelBrake","/org/automotive/runningstatus/wheelBrake", re, connection, map<string, string>())
153 wantProperty<bool>(VehicleProperty::WheelBrake, "Engaged", "b", AbstractProperty::Read);
154 supportedChanged(re->supported());
157 class LightStatusProperty: public DBusSink
160 LightStatusProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
161 :DBusSink("org.automotive.lightStatus","/org/automotive/runningstatus/lightStatus", re, connection, map<string, string>())
163 wantProperty<bool>(VehicleProperty::LightHead, "Head", "b", AbstractProperty::Read);
164 wantProperty<bool>(VehicleProperty::LightRightTurn, "RightTurn", "b", AbstractProperty::Read);
165 wantProperty<bool>(VehicleProperty::LightLeftTurn, "LeftTurn", "b", AbstractProperty::Read);
166 wantProperty<bool>(VehicleProperty::LightBrake, "Brake", "b", AbstractProperty::Read);
167 wantProperty<bool>(VehicleProperty::LightFog, "Fog", "b", AbstractProperty::Read);
168 wantProperty<bool>(VehicleProperty::LightHazard, "Hazard", "b", AbstractProperty::Read);
169 wantProperty<bool>(VehicleProperty::LightParking, "Parking", "b", AbstractProperty::Read);
170 wantProperty<bool>(VehicleProperty::LightHighBeam, "HighBeam", "b", AbstractProperty::Read);
171 supportedChanged(re->supported());
175 class InteriorLightStatusProperty: public DBusSink
178 InteriorLightStatusProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
179 :DBusSink("org.automotive.interiorLightStatus","/org/automotive/runningstatus/interiorLightStatus", re, connection, map<string, string>())
181 wantProperty<bool>(VehicleProperty::InteriorLightPassenger, "Passenger", "b", AbstractProperty::Read);
182 wantProperty<bool>(VehicleProperty::InteriorLightPassenger, "Driver", "b", AbstractProperty::Read);
183 wantProperty<bool>(VehicleProperty::InteriorLightCenter, "Center", "b", AbstractProperty::Read);
184 supportedChanged(re->supported());
188 class HornProperty: public DBusSink
191 HornProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
192 :DBusSink("org.automotive.horn","/org/automotive/runningstatus/horn", re, connection, map<string, string>())
194 wantProperty<bool>(VehicleProperty::Horn,"On","b",AbstractProperty::Read);
195 supportedChanged(re->supported());
199 class FuelProperty: public DBusSink
202 FuelProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
203 :DBusSink("org.automotive.fuel", "/org/automotive/runningstatus/fuel", re, connection, map<string, string>())
205 wantProperty<uint16_t>(VehicleProperty::FuelLevel,"Level", "y", AbstractProperty::Read);
206 wantProperty<uint16_t>(VehicleProperty::FuelRange,"Range", "q", AbstractProperty::Read);
207 wantProperty<uint16_t>(VehicleProperty::FuelConsumption,"InstantConsumption", "q", AbstractProperty::Read);
208 wantProperty<uint16_t>(VehicleProperty::FuelEconomy,"InstantEconomy", "q", AbstractProperty::Read);
209 wantProperty<uint16_t>(VehicleProperty::FuelAverageEconomy,"AverageEconomy", "q", AbstractProperty::ReadWrite);
210 supportedChanged(re->supported());
214 class EngineOilProperty: public DBusSink
217 EngineOilProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
218 :DBusSink("org.automotive.engineOil", "/org/automotive/runningstatus/engineOil", re, connection, map<string, string>())
220 wantProperty<uint16_t>(VehicleProperty::EngineOilRemaining, "Remaining", "y", AbstractProperty::Read);
221 wantProperty<int>(VehicleProperty::EngineOilTemperature, "Temperature", "i", AbstractProperty::Read);
222 wantProperty<uint16_t>(VehicleProperty::EngineOilPressure, "Pressure", "y", AbstractProperty::Read);
223 supportedChanged(re->supported());
227 class LocationProperty: public DBusSink
230 LocationProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
231 :DBusSink("org.automotive.location", "/org/automotive/runningstatus/location", re, connection, map<string, string>())
233 wantProperty<double>(VehicleProperty::Latitude, "Latitude", "d", AbstractProperty::Read);
234 wantProperty<double>(VehicleProperty::Longitude, "Longitude", "d", AbstractProperty::Read);
235 wantProperty<double>(VehicleProperty::Altitude, "Altitude", "d", AbstractProperty::Read);
236 wantProperty<uint>(VehicleProperty::Direction, "Direction", "y", AbstractProperty::Read);
237 supportedChanged(re->supported());