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 VehiclePowerModeProperty: public DBusSink
55 VehiclePowerModeProperty(AbstractRoutingEngine* re, GDBusConnection* connection)
56 :DBusSink("org.automotive.vehiclePowerMode","/org/automotive/runningstatus/vehiclePowerMode", re, connection, map<string, string>())
58 wantProperty<Power::PowerModes>(VehicleProperty::VehiclePowerMode, "VehiclePowerMode","b",AbstractProperty::Read);
59 supportedChanged(re->supported());
63 class TripMeterProperty: public DBusSink
66 TripMeterProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
67 :DBusSink("org.automotive.tripMeter","/org/automotive/runningstatus/tripMeter", re, connection, map<string, string>())
69 wantProperty<uint16_t>(VehicleProperty::TripMeterA, "A", "q", AbstractProperty::ReadWrite);
70 wantProperty<uint16_t>(VehicleProperty::TripMeterB, "B", "q", AbstractProperty::ReadWrite);
71 wantProperty<uint16_t>(VehicleProperty::TripMeterC, "C", "q", AbstractProperty::ReadWrite);
72 supportedChanged(re->supported());
76 class AccelerationProperty: public DBusSink
79 AccelerationProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
80 :DBusSink("org.automotive.acceleration","/org/automotive/runningstatus/acceleration", re, connection, map<string, string>())
82 wantProperty<uint16_t>(VehicleProperty::AccelerationX, "X", "q", AbstractProperty::Read);
83 wantProperty<uint16_t>(VehicleProperty::AccelerationY, "Y", "q", AbstractProperty::Read);
84 wantProperty<uint16_t>(VehicleProperty::AccelerationZ, "Z", "q", AbstractProperty::Read);
85 supportedChanged(re->supported());
89 class TransmissionProperty: public DBusSink
92 TransmissionProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
93 :DBusSink("org.automotive.transmission","/org/automotive/runningstatus/transmission", re, connection, map<string, string>())
95 wantProperty<Transmission::TransmissionPositions>(VehicleProperty::TransmissionShiftPosition,
96 "ShiftPosition", "y", AbstractProperty::Read);
97 wantProperty<Transmission::TransmissionPositions>(VehicleProperty::TransmissionGearPosition,
98 "GearPosition", "y", AbstractProperty::Read);
99 wantProperty<Transmission::Mode>(VehicleProperty::TransmissionMode,
100 "Mode", "y", AbstractProperty::Read);
102 supportedChanged(re->supported());
107 class CruiseControlProperty: public DBusSink
110 CruiseControlProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
111 :DBusSink("org.automotive.cruiseControlStatus","/org/automotive/runningstatus/cruiseControlStatus", re, connection, map<string, string>())
113 wantProperty<bool>(VehicleProperty::CruiseControlActive, "Activated", "b", AbstractProperty::Read);
114 wantProperty<uint16_t>(VehicleProperty::CruiseControlSpeed, "Speed", "q", AbstractProperty::Read);
115 supportedChanged(re->supported());
119 class WheelBrakeProperty: public DBusSink
122 WheelBrakeProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
123 :DBusSink("org.automotive.wheelBrake","/org/automotive/runningstatus/wheelBrake", re, connection, map<string, string>())
125 wantProperty<bool>(VehicleProperty::WheelBrake, "Engaged", "b", AbstractProperty::Read);
126 supportedChanged(re->supported());
129 class LightStatusProperty: public DBusSink
132 LightStatusProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
133 :DBusSink("org.automotive.lightStatus","/org/automotive/runningstatus/lightStatus", re, connection, map<string, string>())
135 wantProperty<bool>(VehicleProperty::LightHead, "Head", "b", AbstractProperty::Read);
136 wantProperty<bool>(VehicleProperty::LightRightTurn, "RightTurn", "b", AbstractProperty::Read);
137 wantProperty<bool>(VehicleProperty::LightLeftTurn, "LeftTurn", "b", AbstractProperty::Read);
138 wantProperty<bool>(VehicleProperty::LightBrake, "Brake", "b", AbstractProperty::Read);
139 wantProperty<bool>(VehicleProperty::LightFog, "Fog", "b", AbstractProperty::Read);
140 wantProperty<bool>(VehicleProperty::LightHazard, "Hazard", "b", AbstractProperty::Read);
141 wantProperty<bool>(VehicleProperty::LightParking, "Parking", "b", AbstractProperty::Read);
142 wantProperty<bool>(VehicleProperty::LightHighBeam, "HighBeam", "b", AbstractProperty::Read);
143 supportedChanged(re->supported());
147 class InteriorLightStatusProperty: public DBusSink
150 InteriorLightStatusProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
151 :DBusSink("org.automotive.interiorLightStatus","/org/automotive/runningstatus/interiorLightStatus", re, connection, map<string, string>())
153 wantProperty<bool>(VehicleProperty::InteriorLightPassenger, "Passenger", "b", AbstractProperty::Read);
154 wantProperty<bool>(VehicleProperty::InteriorLightPassenger, "Driver", "b", AbstractProperty::Read);
155 wantProperty<bool>(VehicleProperty::InteriorLightCenter, "Center", "b", AbstractProperty::Read);
156 supportedChanged(re->supported());
160 class HornProperty: public DBusSink
163 HornProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
164 :DBusSink("org.automotive.horn","/org/automotive/runningstatus/horn", re, connection, map<string, string>())
166 wantProperty<bool>(VehicleProperty::Horn,"On","b",AbstractProperty::Read);
167 supportedChanged(re->supported());
171 class FuelProperty: public DBusSink
174 FuelProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
175 :DBusSink("org.automotive.fuel", "/org/automotive/runningstatus/fuel", re, connection, map<string, string>())
177 wantProperty<uint16_t>(VehicleProperty::FuelLevel,"Level", "y", AbstractProperty::Read);
178 wantProperty<uint16_t>(VehicleProperty::FuelRange,"Range", "q", AbstractProperty::Read);
179 wantProperty<uint16_t>(VehicleProperty::FuelConsumption,"InstantConsumption", "q", AbstractProperty::Read);
180 wantProperty<uint16_t>(VehicleProperty::FuelEconomy,"InstantEconomy", "q", AbstractProperty::Read);
181 wantProperty<uint16_t>(VehicleProperty::FuelAverageEconomy,"AverageEconomy", "q", AbstractProperty::ReadWrite);
182 supportedChanged(re->supported());
186 class EngineOilProperty: public DBusSink
189 EngineOilProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
190 :DBusSink("org.automotive.engineOil", "/org/automotive/runningstatus/engineOil", re, connection, map<string, string>())
192 wantProperty<uint16_t>(VehicleProperty::EngineOilRemaining, "Remaining", "y", AbstractProperty::Read);
193 wantProperty<int>(VehicleProperty::EngineOilTemperature, "Temperature", "i", AbstractProperty::Read);
194 wantProperty<uint16_t>(VehicleProperty::EngineOilPressure, "Pressure", "y", AbstractProperty::Read);
195 supportedChanged(re->supported());
199 class LocationProperty: public DBusSink
202 LocationProperty(AbstractRoutingEngine *re, GDBusConnection *connection)
203 :DBusSink("org.automotive.location", "/org/automotive/runningstatus/location", re, connection, map<string, string>())
205 wantProperty<double>(VehicleProperty::Latitude, "Latitude", "d", AbstractProperty::Read);
206 wantProperty<double>(VehicleProperty::Longitude, "Longitude", "d", AbstractProperty::Read);
207 wantProperty<double>(VehicleProperty::Altitude, "Altitude", "d", AbstractProperty::Read);
208 wantProperty<uint>(VehicleProperty::Direction, "Direction", "y", AbstractProperty::Read);
209 supportedChanged(re->supported());