automotive-message-broker  0.13
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
vehicleproperty.h
1 /*
2  Copyright (C) 2012 Intel Corporation
3 
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.
8 
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.
13 
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
17 */
18 
19 
20 #ifndef VEHICLEPROPERTY_H
21 #define VEHICLEPROPERTY_H
22 
23 #include "nullptr.h"
24 #include <string>
25 #include <list>
26 #include <set>
27 #include <sstream>
28 #include <map>
29 #include <functional>
30 #include "abstractpropertytype.h"
31 #include "mappropertytype.hpp"
32 
33 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
34 
35 namespace ButtonEvents {
36 enum ButtonEventType {
37  NoButton = 0,
38  PlayButton = 1,
39  SkipButton = 1 << 1,
40  PrevButton = 1 << 2,
41  PauseButton = 1 << 3,
42  Preset1Button = 1 << 4,
43  Preset2Button = 1 << 5,
44  Preset3Button = 1 << 6,
45  Preset4Button = 1 << 7,
46  StopButton = 1 << 8,
47  NavigateUpButton = 1 << 9,
48  NavigateDownButton = 1 << 10,
49  NavigateLeftButton = 1 << 11,
50  NavigateRightButton = 1 << 12
51 };
52 
53 namespace W3C
54 {
55 extern const char* Home;
56 extern const char* Back;
57 extern const char* Search;
58 extern const char* Call;
59 extern const char* EndCall;
60 extern const char* MediaPlay;
61 extern const char* MediaNext;
62 extern const char* MediaPrevious;
63 extern const char* MediaPause;
64 extern const char* VoiceRecognize;
65 extern const char* Enter;
66 extern const char* Left;
67 extern const char* Right;
68 extern const char* Up;
69 extern const char* Down;
70 }
71 }
72 
73 namespace TurnSignals {
74 enum TurnSignalType
75 {
76  Off=0,
77  Right=1,
78  Left=2,
79  Hazard=3
80 };
81 }
82 
83 namespace Transmission {
84 enum TransmissionPositions
85 {
86  Neutral = 0,
87  First,
88  Second,
89  Third,
90  Forth,
91  Fifth,
92  Sixth,
93  Seventh,
94  Eighth,
95  Ninth,
96  Tenth,
97  CVT = 64,
98  Drive = 96,
99  Reverse = 128,
100  Park = 255
101 
102 };
104 enum Mode {
105  Normal=0,
106  Sports = 1,
107  Economy = 2,
108  OEMCustom1 = 3,
109  OEMCustom2 = 4
110 };
111 
112 enum Type {
113  Unknown = -1,
114  Auto = 0,
115  Manual = 1,
116  CV = 2
117 };
118 
119 namespace W3C
120 {
121 extern const char* Park;
122 extern const char* Reverse;
123 extern const char* Neutral;
124 extern const char* Low;
125 extern const char* Drive;
126 extern const char* Overdrive;
127 }
128 }
129 
130 namespace Power {
137 enum Modes
138 {
139  Off = 0,
140  Accessory1 = 1,
141  Accessory2 = 2,
142  Run = 3
143 };
144 }
145 
146 namespace Fuel{
147 enum Type
148 {
149  Unknown = -1,
150  Gasoline = 0,
151  High_Octane,
152  Diesel,
153  Electric,
154  Hydrogen
155 };
156 
157 enum RefuelPosition
158 {
159  UnknownPosition = -1,
160  Left = 0,
161  Right,
162  Front,
163  Rear
164 };
165 }
166 
167 namespace Vehicle {
168 enum Type
169 {
170  Unknown = -1,
171  Sedan = 0,
172  Coupe,
173  Cabriole,
174  Roadster,
175  SUV,
176  Truck
177 };
178 enum SoundMode {
179  Normal = 0,
180  Quiet = 1,
181  Sportive = 2
182 };
183 }
184 
185 namespace Security {
186 enum Status
187 {
188  Idle = 0,
189  Armed,
190  AlarmDetected
191 };
192 
193 namespace W3C
194 {
195 extern const char * Disarmed;
196 extern const char * Prearmed;
197 extern const char * Armed;
198 extern const char * Alarmed;
199 }
200 
201 }
202 
203 namespace Airbag {
204 
205 enum Status
206 {
207  Inactive = 0,
208  Active,
209  Deployed
210 };
211 
212 }
213 
214 namespace Door
215 {
216 enum Status
217 {
218  Closed = 0,
219  Open,
220  Ajar
221 };
222 namespace W3C
223 {
224 extern const char * Closed;
225 extern const char * Open;
226 extern const char * Ajar;
227 }
228 }
229 
230 namespace Seat
231 {
232 
233 enum Occupant
234 {
235  Vacant = 0,
236  Child,
237  Adult
238 };
239 namespace W3C
240 {
241 extern const char * Vacant;
242 extern const char * Child;
243 extern const char * Adult;
244 
245 extern const char * Pin;
246 extern const char * Keyfob;
247 extern const char * Bluetooth;
248 extern const char * NFC ;
249 extern const char * Fingerprint;
250 extern const char * Camera;
251 extern const char * Voice;
252 }
253 
254 
255 }
256 
257 namespace Window
258 {
259 enum WiperSpeed
260 {
261  Off = 0,
262  Slowest = 1,
263  Fastest = 5,
264  Auto = 10
265 };
266 }
267 
268 namespace ConvertibleRoofW3C
269 {
270 extern const char * Opened;
271 extern const char * Opening;
272 extern const char * Closed;
273 extern const char * Closing;
274 }
275 
276 namespace WiperSpeedSetting
277 {
278 namespace W3C
279 {
280 extern const char * Off;
281 extern const char * Once;
282 extern const char * Slowest;
283 extern const char * Slow;
284 extern const char * Middle;
285 extern const char * Fast;
286 extern const char * Fastest;
287 extern const char * Auto;
288 }
289 }
290 
291 namespace HVAC
292 {
293 enum AirflowDirection
294 {
295  FrontPanel=0,
296  FloorDuct = 1,
297  Front = 1 << 1,
298  Defroster = 1 << 2
299 
300 };
301 
302 namespace W3C
303 {
304 extern const char * FloorPanel;
305 extern const char * FloorDuct;
306 extern const char * Bilevel;
307 extern const char * DefrostFloor;
308 }
309 }
310 
311 namespace Driving
312 {
313 enum Mode
314 {
315  None = 0,
316  Driving
317 };
318 }
319 
320 namespace Drive
321 {
322 enum Mode {
323  Normal=0,
324  Sports = 1,
325  Economy = 2,
326  OEMCustom1 = 3,
327  OEMCustom2 = 4
328 };
329 
330 namespace W3C
331 {
332 extern const char* Comfort;
333 extern const char* Auto;
334 extern const char* Sport;
335 extern const char* Eco;
336 extern const char* Manual;
337 extern const char* Winter;
338 }
339 
340 }
341 
342 namespace Measurement
343 {
344 enum Type
345 {
346  Metric = 0,
347  ImperialUS = 1,
348  ImperialUK = 2
349 };
350 }
351 
352 namespace LaneDeparture
353 {
354 namespace W3C
355 {
356 extern const char * Off;
357 extern const char * Pause;
358 extern const char * Running;
359 }
360 }
361 
362 namespace ParkingBrake
363 {
364 namespace W3C
365 {
366 extern const char * Inactive;
367 extern const char * Active;
368 extern const char * Error;
369 }
370 }
371 
372 #include <boost/preprocessor/comma.hpp>
373 
374 #define PROPERTYTYPE(property, propertyType, baseClass, valueType) \
375  class propertyType : public baseClass { \
376  public: propertyType(): baseClass(property) {} \
377  propertyType(valueType val) : baseClass(property, val) {} \
378  using baseClass::operator=; \
379  };
380 
381 #define PROPERTYTYPE1(property, propertyType, baseClass, valueType) \
382  class propertyType : public baseClass { \
383  public: propertyType(): baseClass(#property) {} \
384  propertyType(valueType val) : baseClass(#property, val) {} \
385  };
386 
387 #define PROPERTYTYPEBASIC(property, valueType) \
388  class property ## Type : public BasicPropertyType<valueType> { \
389  public: property ## Type(): BasicPropertyType(property) {} \
390  property ## Type(valueType val) : BasicPropertyType(property, val) {} \
391  using BasicPropertyType<valueType>::operator=; \
392  };
393 
394 #define PROPERTYTYPEBASIC1(property, valueType) \
395  class property ## Type : public BasicPropertyType<valueType> { \
396  public: property ## Type(): BasicPropertyType( #property) {} \
397  property ## Type(valueType val) : BasicPropertyType(#property, val) {} \
398  };
399 
400 #define PROPERTYTYPENOVAL(property, propertyType, baseClass) \
401  class propertyType : public baseClass { \
402  public: propertyType(): baseClass(property) {} \
403  };
404 
405 class VehicleProperty;
406 
407 
408 typedef std::vector<std::string> PropertyList;
409 typedef std::set<std::string> PropertySet;
410 
412 {
413 
414 public:
415 
419  static void factory();
420 
421  typedef std::string Property;
422 
427  typedef std::function<AbstractPropertyType* (void)> PropertyTypeFactoryCallback;
428 
430 
431  static const Property NoValue;
432 
434  static const Property VehicleSpeed;
435  PROPERTYTYPE(VehicleSpeed, VehicleSpeedType, BasicPropertyType<uint16_t>, uint16_t)
436  //typedef BasicPropertyType<uint16_t> VehicleSpeedType;
437 
438 
439  static const Property EngineSpeed;
440  PROPERTYTYPE(EngineSpeed, EngineSpeedType, BasicPropertyType<uint16_t>, uint16_t)
441  //typedef BasicPropertyType<uint16_t> EngineSpeedType;
442 
452  static const Property TransmissionShiftPosition;
453  PROPERTYTYPE(TransmissionShiftPosition, TransmissionShiftPositionType,
454  BasicPropertyType<Transmission::TransmissionPositions>, Transmission::TransmissionPositions )
455  //typedef BasicPropertyType<Transmission::TransmissionPositions> TransmissionShiftPositionType;
456 
465  static const Property TransmissionGearPosition;
466  PROPERTYTYPE(TransmissionGearPosition, TransmissionGearPositionType,
467  BasicPropertyType<Transmission::TransmissionPositions>, Transmission::TransmissionPositions)
468  //typedef BasicPropertyType<Transmission::TransmissionPositions> TransmissionGearPositionType;
469 
471  static const Property TransmissionMode;
472  PROPERTYTYPE(TransmissionMode, TransmissionModeType,
474  //typedef BasicPropertyType<Transmission::Mode> TransmissionModeType;
475 
479  static const Property TransmissionModeW3C;
480  PROPERTYTYPE(TransmissionModeW3C, TransmissionModeW3CType, StringPropertyType, std::string)
481 
483  static const Property ThrottlePosition;
484  PROPERTYTYPE(ThrottlePosition, ThrottlePositionType, BasicPropertyType<uint16_t> , uint16_t)
485  //typedef BasicPropertyType<uint16_t> ThrottlePositionType;
486 
488  static const Property WheelBrake;
489  PROPERTYTYPE(WheelBrake, WheelBrakeType, BasicPropertyType<bool>, bool)
490  //typedef BasicPropertyType<bool> WheelBrakeType;
491 
492  static const Property WheelBrakePressure;
493  PROPERTYTYPE(WheelBrakePressure, WheelBrakePressureType, BasicPropertyType<uint16_t>, uint16_t)
494  //typedef BasicPropertyType<uint16_t> WheelBrakePressureType;
495 
499  static const Property SteeringWheelAngle;
500  PROPERTYTYPE(SteeringWheelAngle, SteeringWheelAngleType, BasicPropertyType<uint16_t>, uint16_t)
501 
503  static const Property SteeringWheelAngleW3C;
504  PROPERTYTYPEBASIC(SteeringWheelAngleW3C, int16_t)
505 
507  static const Property TurnSignal;
508  PROPERTYTYPEBASIC(TurnSignal, TurnSignals::TurnSignalType)
509 
511  static const Property ClutchStatus;
512  PROPERTYTYPE(ClutchStatus, ClutchStatusType,BasicPropertyType<bool>,bool)
513 
515  static const Property EngineOilPressure;
516  PROPERTYTYPE(EngineOilPressure, EngineOilPressureType, BasicPropertyType<uint16_t>, uint16_t)
517 
519  static const Property EngineCoolantTemperature;
520  PROPERTYTYPEBASIC(EngineCoolantTemperature, int16_t)
521 
522  static const Property EngineCoolantLevel;
523  PROPERTYTYPE(EngineCoolantLevel, EngineCoolantLevelType, BasicPropertyType<uint>, uint)
524 
526  static const Property MachineGunTurretStatus;
527  PROPERTYTYPEBASIC(MachineGunTurretStatus, bool)
528 
529  static const Property AccelerationX;
530  PROPERTYTYPEBASIC(AccelerationX, int16_t)
531 
532  static const Property AccelerationY;
533  PROPERTYTYPEBASIC(AccelerationY, int16_t)
534 
535  static const Property AccelerationZ;
536  PROPERTYTYPEBASIC(AccelerationZ, int16_t)
537 
539  static const Property MassAirFlow;
540  PROPERTYTYPE(MassAirFlow, MassAirFlowType, BasicPropertyType<uint16_t>, uint16_t)
541  //typedef BasicPropertyType<uint16_t> MassAirFlowType;
542 
544  [[deprecated("Deprecated in 0.14. Use ButtonEventW3C")]]
546  static const Property ButtonEvent;
547  PROPERTYTYPE(ButtonEvent, ButtonEventType, BasicPropertyType<ButtonEvents::ButtonEventType>, ButtonEvents::ButtonEventType)
548 
549  static const Property ButtonEventW3C;
550  class ButtonEventW3CType: public MapPropertyType<StringPropertyType, StringPropertyType>
551  {
552  public:
553  ButtonEventW3CType() : MapPropertyType(ButtonEventW3C) {}
554  };
555 
556 
558  static const Property AirIntakeTemperature;
559  PROPERTYTYPE(AirIntakeTemperature, AirIntakeTemperatureType, BasicPropertyType<int>, int)
560  //typedef BasicPropertyType<int> AirIntakeTemperatureType;
561 
562 
563  static const Property BatteryVoltage;
564  PROPERTYTYPE(BatteryVoltage, BatteryVoltageType, BasicPropertyType<double>, double)
565  //typedef BasicPropertyType<double> BatteryVoltageType;
566 
567  static const Property BatteryCurrent;
568  PROPERTYTYPE(BatteryCurrent, BatteryCurrentType, BasicPropertyType<double>, double)
569  //typedef BasicPropertyType<double> BatteryCurrentType;
570 
571  static const Property BatteryChargeLevel;
572  PROPERTYTYPEBASIC(BatteryChargeLevel, uint16_t)
573 
575  static const Property InteriorTemperature;
576  PROPERTYTYPE(InteriorTemperature, InteriorTemperatureType, BasicPropertyType<int>, int)
577  //typedef BasicPropertyType<int> InteriorTemperatureType;
578 
579  static const Property ExteriorTemperature;
580  PROPERTYTYPE(ExteriorTemperature, ExteriorTemperatureType, BasicPropertyType<int>, int)
581  //typedef BasicPropertyType<int> ExteriorTemperatureType;
582 
583  static const Property EngineOilTemperature;
584  PROPERTYTYPEBASIC(EngineOilTemperature, int)
585 
586  static const Property EngineOilRemaining;
587  PROPERTYTYPEBASIC(EngineOilRemaining, uint16_t)
588 
589  static const Property EngineOilLifeRemaining;
590  PROPERTYTYPEBASIC(EngineOilLifeRemaining, uint16_t)
591 
592  static const Property EngineOilChangeIndicator;
593  PROPERTYTYPEBASIC(EngineOilChangeIndicator, bool)
594 
596  static const Property VIN;
597  PROPERTYTYPE(VIN, VINType, StringPropertyType, std::string)
598  //class VINType: public StringPropertyType { public: VINType(std::string val):StringPropertyType(VIN,val){} };
599 
601  static const Property WMI;
602  PROPERTYTYPE(WMI, WMIType, StringPropertyType, std::string)
603  //class WMIType: public StringPropertyType { public: WMIType(std::string val):StringPropertyType(WMI,val){} };
604 
606  static const Property TirePressure;
607  PROPERTYTYPEBASIC(TirePressure, uint16_t)
608 
610  static const Property TirePressureLow;
611  PROPERTYTYPEBASIC(TirePressureLow, bool)
612 
614  static const Property TireTemperature;
615  PROPERTYTYPEBASIC(TireTemperature, int16_t)
616 
620  static const Property VehiclePowerMode;
621  PROPERTYTYPE(VehiclePowerMode, VehiclePowerModeType, BasicPropertyType<Power::Modes>, Power::Modes)
622  //typedef BasicPropertyType<Power::PowerModes> VehiclePowerModeType;
623 
624  static const Property TripMeters;
625  PROPERTYTYPE(TripMeters, TripMetersType, ListPropertyType<BasicPropertyType<uint16_t> >, uint16_t)
626  //typedef ListPropertyType<BasicPropertyType<uint16_t> > TripMetersType;
627 
628  static const Property CruiseControlActive;
629  PROPERTYTYPE(CruiseControlActive, CruiseControlActiveType, BasicPropertyType<bool>, bool)
630  //typedef BasicPropertyType<bool> CruiseControlActiveType;
631 
632  static const Property CruiseControlSpeed;
633  PROPERTYTYPE(CruiseControlSpeed, CruiseControlSpeedType, BasicPropertyType<uint16_t>, uint16_t)
634  //typedef BasicPropertyType<uint16_t> CruiseControlSpeedType;
635 
636  static const Property LightHead;
637  PROPERTYTYPE(LightHead, LightHeadType, BasicPropertyType<bool>, bool)
638  static const Property LightRightTurn;
639  PROPERTYTYPE(LightRightTurn, LightRightTurnType, BasicPropertyType<bool>, bool)
640  static const Property LightLeftTurn;
641  PROPERTYTYPE(LightLeftTurn, LightLeftTurnType, BasicPropertyType<bool>, bool)
642  static const Property LightBrake;
643  PROPERTYTYPE(LightBrake, LightBrakeType, BasicPropertyType<bool>, bool)
644  static const Property LightFog;
645  PROPERTYTYPE(LightFog, LightFogType, BasicPropertyType<bool>, bool)
646  static const Property LightHazard;
647  PROPERTYTYPE(LightHazard, LightHazardType, BasicPropertyType<bool>, bool)
648  static const Property LightParking;
649  PROPERTYTYPE(LightParking, LightParkingType, BasicPropertyType<bool>, bool)
650  static const Property LightHighBeam;
651  PROPERTYTYPE(LightHighBeam, LightHighBeamType, BasicPropertyType<bool>, bool)
652  static const Property LightAutomatic;
653  PROPERTYTYPEBASIC(LightAutomatic, bool)
654  static const Property LightDynamicHighBeam;
655  PROPERTYTYPEBASIC(LightDynamicHighBeam, bool)
656 
658  static const Property InteriorLightDriver;
659  PROPERTYTYPE(InteriorLightDriver, InteriorLightDriverType, BasicPropertyType<bool>, bool)
661  static const Property InteriorLightCenter;
662  PROPERTYTYPE(InteriorLightCenter, InteriorLightCenterType, BasicPropertyType<bool>, bool)
664  static const Property InteriorLightPassenger;
665  PROPERTYTYPE(InteriorLightPassenger, InteriorLightPassengerType, BasicPropertyType<bool>, bool)
666 
667  static const Property InteriorLightStatus;
668  PROPERTYTYPEBASIC(InteriorLightStatus, bool)
669 
670  static const Property EngineLoad;
671  PROPERTYTYPE(EngineLoad, EngineLoadType, BasicPropertyType<uint16_t>, uint16_t)
672 
673  static const Property Horn;
674  PROPERTYTYPE(Horn, HornType, BasicPropertyType<bool>, bool)
675 
676  static const Property FuelLevel;
677  PROPERTYTYPE(FuelLevel, FuelLevelType, BasicPropertyType<uint16_t>, uint16_t)
678 
679  static const Property FuelRange;
680  PROPERTYTYPE(FuelRange, FuelRangeType, BasicPropertyType<uint16_t> , uint16_t)
681 
682  static const Property FuelConsumption;
683  PROPERTYTYPE(FuelConsumption, FuelConsumptionType, BasicPropertyType<uint>, uint)
684 
685  static const Property FuelEconomy;
686  PROPERTYTYPE(FuelEconomy, FuelEconomyType, BasicPropertyType<uint16_t>, uint16_t)
687 
688  static const Property FuelAverageEconomy;
689  PROPERTYTYPE(FuelAverageEconomy, FuelAverageEconomyType, BasicPropertyType<uint16_t> , uint16_t)
690 
691  static const Property FuelAverageConsumption;
692  PROPERTYTYPEBASIC(FuelAverageConsumption, uint)
693 
694  static const Property FuelTimeSinceRestart;
695  PROPERTYTYPEBASIC(FuelTimeSinceRestart, uint)
696 
697  static const Property FuelConsumptionSinceRestart;
698  PROPERTYTYPEBASIC(FuelConsumptionSinceRestart, uint)
699 
700  static const Property FuelType;
701  PROPERTYTYPE(FuelType, FuelTypeType, BasicPropertyType<Fuel::Type>, Fuel::Type)
702 
703  static const Property FuelPositionSide;
704  PROPERTYTYPE(FuelPositionSide, FuelPositionSideType, BasicPropertyType<Fuel::RefuelPosition>, Fuel::RefuelPosition)
705 
706  static const Property ExteriorBrightness;
707  PROPERTYTYPE(ExteriorBrightness, ExteriorBrightnessType, BasicPropertyType<uint16_t>, uint16_t)
708 
709  static const Property Latitude;
710  PROPERTYTYPE(Latitude, LatitudeType, BasicPropertyType<double>, double)
711 
712  static const Property Longitude;
713  PROPERTYTYPE(Longitude, LongitudeType, BasicPropertyType<double>, double)
714 
715  static const Property Altitude;
716  PROPERTYTYPE(Altitude, AltitudeType, BasicPropertyType<double> , double)
717 
718  static const Property Direction;
719  PROPERTYTYPE(Direction, DirectionType, BasicPropertyType<uint16_t>, uint16_t)
720 
721  static const Property VehicleWidth;
722  PROPERTYTYPE(VehicleWidth, VehicleWidthType, BasicPropertyType<uint>, uint)
723  static const Property VehicleHeight;
724  PROPERTYTYPE(VehicleHeight, VehicleHeightType, BasicPropertyType<uint>, uint)
725  static const Property VehicleLength;
726  PROPERTYTYPE(VehicleLength, VehicleLengthType, BasicPropertyType<uint>, uint)
727 
728  static const Property VehicleType;
729  PROPERTYTYPE(VehicleType, VehicleTypeType, BasicPropertyType<Vehicle::Type>, Vehicle::Type)
730 
731  static const Property DoorsPerRow;
732  PROPERTYTYPE(DoorsPerRow, DoorsPerRowType, ListPropertyType<BasicPropertyType<uint16_t> >, uint16_t)
733 
734  static const Property TransmissionGearType;
735  PROPERTYTYPE(TransmissionGearType, TransmissionGearTypeType, BasicPropertyType<Transmission::Type>, Transmission::Type)
736 
737  static const Property FrontWheelRadius;
738  PROPERTYTYPE(FrontWheelRadius, FrontWheelRadiusType, BasicPropertyType<uint16_t>, uint16_t)
739  static const Property RearWheelRadius;
740  PROPERTYTYPE(RearWheelRadius, RearWheelRadiusType, BasicPropertyType<uint16_t>, uint16_t)
741 
742  static const Property WheelTrack;
743  PROPERTYTYPE(WheelTrack, WheelTrackType, BasicPropertyType<uint>, uint)
744 
745  static const Property BrakePressure;
746  PROPERTYTYPEBASIC(BrakePressure, uint16_t)
747 
749  static const Property Odometer;
750  PROPERTYTYPEBASIC(Odometer, uint)
751 
752  static const Property DistanceTotal;
753  PROPERTYTYPEBASIC(DistanceTotal, uint)
754 
755  static const Property DistanceSinceStart;
756  PROPERTYTYPEBASIC(DistanceSinceStart, uint)
757 
760  static const Property TransmissionFluidLevel;
761  PROPERTYTYPEBASIC(TransmissionFluidLevel, uint16_t)
762 
763  static const Property TransmissionOilWear;
764  PROPERTYTYPEBASIC(TransmissionOilWear, uint16_t)
765 
766  static const Property TransmissionOilTemperature;
767  PROPERTYTYPEBASIC(TransmissionOilTemperature, int16_t)
768 
769  static const Property TransmissionClutchWear;
770  PROPERTYTYPEBASIC(TransmissionClutchWear, uint16_t)
771 
774  static const Property BrakeFluidLevel;
775  PROPERTYTYPEBASIC(BrakeFluidLevel, uint16_t)
776 
779  static const Property WasherFluidLevel;
780  PROPERTYTYPEBASIC(WasherFluidLevel, uint16_t)
781 
782  static const Property WasherFluidLevelLow;
783  PROPERTYTYPEBASIC(WasherFluidLevelLow, bool)
784 
786  static const Property SecurityAlertStatus;
787  PROPERTYTYPEBASIC(SecurityAlertStatus, Security::Status)
788 
793  static const Property ParkingBrakeStatus;
794  PROPERTYTYPEBASIC(ParkingBrakeStatus, bool)
795 
799  static const Property ParkingBrakeStatusW3C;
800  PROPERTYTYPE(ParkingBrakeStatusW3C, ParkingBrakeStatusW3CType, StringPropertyType, std::string)
801 
805  static const Property ParkingLightStatus;
806  PROPERTYTYPEBASIC(ParkingLightStatus,bool)
807 
811  static const Property HazardLightStatus;
812  PROPERTYTYPEBASIC(HazardLightStatus, bool)
813 
814  static const Property AntilockBrakingSystem;
815  PROPERTYTYPEBASIC(AntilockBrakingSystem, bool)
816 
817  static const Property AntilockBrakingSystemEnabled;
818  PROPERTYTYPEBASIC(AntilockBrakingSystemEnabled, bool)
819 
820  static const Property TractionControlSystem;
821  PROPERTYTYPEBASIC(TractionControlSystem, bool)
822 
823  static const Property TractionControlSystemEnabled;
824  PROPERTYTYPEBASIC(TractionControlSystemEnabled, bool)
825 
826  static const Property VehicleTopSpeedLimit;
827  PROPERTYTYPEBASIC(VehicleTopSpeedLimit,uint16_t)
828 
830  static const Property AirbagStatus;
831  PROPERTYTYPEBASIC(AirbagStatus, Airbag::Status)
832 
833  static const Property AirbagActivated;
834  PROPERTYTYPEBASIC(AirbagActivated, bool)
835 
836  static const Property AirbagDeployed;
837  PROPERTYTYPEBASIC(AirbagDeployed, bool)
838 
840  static const Property DoorStatus;
841  PROPERTYTYPEBASIC(DoorStatus, Door::Status)
842 
847  static const Property DoorStatusW3C;
848  PROPERTYTYPE(DoorStatusW3C, DoorStatusW3CType, StringPropertyType, std::string)
849 
850  static const Property DoorLockStatus;
851  PROPERTYTYPEBASIC(DoorLockStatus, bool)
852 
853  static const Property ChildLockStatus;
854  PROPERTYTYPEBASIC(ChildLockStatus, bool)
855 
856  static const Property SeatBeltStatus;
857  PROPERTYTYPEBASIC(SeatBeltStatus, bool)
858 
859  static const Property WindowLockStatus;
860  PROPERTYTYPEBASIC(WindowLockStatus, bool)
861 
863  static const Property OccupantStatus;
864  PROPERTYTYPEBASIC(OccupantStatus, Seat::Occupant)
865 
866  static const Property OccupantStatusW3C;
867  PROPERTYTYPE(OccupantStatusW3C, OccupantStatusW3CType, StringPropertyType, std::string)
868 
869  static const Property ObstacleDistance;
870  PROPERTYTYPEBASIC(ObstacleDistance, double)
871 
872  static const Property RainSensor;
873  PROPERTYTYPEBASIC(RainSensor, uint16_t)
874 
876  static const Property WindshieldWiper;
877  PROPERTYTYPEBASIC(WindshieldWiper, Window::WiperSpeed)
878 
883  static const Property WindshieldWiperSpeed;
884  PROPERTYTYPE(WindshieldWiperSpeed, WindshieldWiperSpeedType, StringPropertyType, std::string)
885 
890  static const Property WindshieldWiperSetting;
891  PROPERTYTYPE(WindshieldWiperSetting, WindshieldWiperSettingType, StringPropertyType, std::string)
892 
894  static const Property AirflowDirection;
895  PROPERTYTYPEBASIC(AirflowDirection,HVAC::AirflowDirection)
896 
897  static const Property AirflowDirectionW3C;
898  PROPERTYTYPE(AirflowDirectionW3C, AirflowDirectionW3CType, StringPropertyType, std::string)
899 
900  static const Property FanSpeed;
901  PROPERTYTYPEBASIC(FanSpeed, uint16_t)
902 
903  static const Property TargetTemperature;
904  PROPERTYTYPEBASIC(TargetTemperature, int)
905 
906  static const Property AirConditioning;
907  PROPERTYTYPEBASIC(AirConditioning,bool)
908 
909  static const Property AirRecirculation;
910  PROPERTYTYPEBASIC(AirRecirculation,bool)
911 
912  static const Property Heater;
913  PROPERTYTYPEBASIC(Heater, bool)
914 
916  static const Property Defrost;
917  PROPERTYTYPEBASIC(Defrost, bool )
918 
919  static const Property DefrostWindow;
920  PROPERTYTYPEBASIC(DefrostWindow, bool )
921 
922  static const Property DefrostMirror;
923  PROPERTYTYPEBASIC(DefrostMirror, bool )
924 
925  static const Property SteeringWheelHeater;
926  PROPERTYTYPEBASIC(SteeringWheelHeater,bool)
927  //typedef BasicPropertyType<bool> SteeringWheelHeaterType;
928 
929  static const Property SeatHeater;
930  PROPERTYTYPEBASIC(SeatHeater,int)
931  //typedef BasicPropertyType<bool> SeatHeaterType;
932 
933  static const Property SeatCooler;
934  PROPERTYTYPEBASIC(SeatCooler,bool)
935 // /typedef BasicPropertyType<bool> SeatCoolerType;
936 
937  static const Property WindowStatus;
938  PROPERTYTYPEBASIC(WindowStatus, uint16_t)
939 
940  static const Property Sunroof;
941  PROPERTYTYPEBASIC(Sunroof, uint16_t)
942  //typedef BasicPropertyType<uint16_t> SunroofType;
943 
944  static const Property SunroofTilt;
945  PROPERTYTYPEBASIC(SunroofTilt,uint16_t)
946  //typedef BasicPropertyType<uint16_t> SunroofTiltType;
947 
948  static const Property ConvertibleRoof;
949  PROPERTYTYPEBASIC(ConvertibleRoof, bool)
950 
954  static const Property ConvertibleRoofStatus;
955  PROPERTYTYPE(ConvertibleRoofStatus, ConvertibleRoofStatusType, StringPropertyType, std::string)
956 
957  static const Property NightMode;
958  PROPERTYTYPEBASIC(NightMode, bool)
959 
960  static const Property DrivingMode;
961  PROPERTYTYPEBASIC(DrivingMode, Driving::Mode)
962 
963  static const Property DrivingModeW3C;
964  PROPERTYTYPEBASIC(DrivingModeW3C, bool)
965 
966  static const Property KeyId;
967  PROPERTYTYPE(KeyId, KeyIdType, StringPropertyType, std::string)
968 
969  static const Property Language;
970  PROPERTYTYPE(Language, LanguageType, StringPropertyType, std::string)
971 
972  static const Property MeasurementSystem;
973  PROPERTYTYPEBASIC(MeasurementSystem, Measurement::Type)
974 
975  static const Property MirrorSettingPan;
976  static const Property MirrorSettingTilt;
977 
978  PROPERTYTYPEBASIC(MirrorSettingPan, uint16_t)
979  PROPERTYTYPEBASIC(MirrorSettingTilt, uint16_t)
980 
981  static const Property SteeringWheelPositionSlide;
982  static const Property SteeringWheelPositionTilt;
983 
984  PROPERTYTYPEBASIC(SteeringWheelPositionSlide, uint16_t)
985  PROPERTYTYPEBASIC(SteeringWheelPositionTilt, uint16_t)
986 
987  static const Property SeatPositionRecline;
988  static const Property SeatPositionSlide;
989  static const Property SeatPositionCushionHeight;
990  static const Property SeatPositionHeadrest;
991  static const Property SeatPositionBackCushion;
992  static const Property SeatPositionSideCushion;
993 
994  PROPERTYTYPEBASIC(SeatPositionRecline, uint16_t)
995  PROPERTYTYPEBASIC(SeatPositionSlide, uint16_t)
996  PROPERTYTYPEBASIC(SeatPositionCushionHeight, uint16_t)
997  PROPERTYTYPEBASIC(SeatPositionHeadrest, uint16_t)
998  PROPERTYTYPEBASIC(SeatPositionBackCushion, uint16_t)
999  PROPERTYTYPEBASIC(SeatPositionSideCushion, uint16_t)
1000 
1001  static const Property DashboardIllumination;
1002  PROPERTYTYPEBASIC(DashboardIllumination, uint16_t)
1003 
1004  static const Property GeneratedVehicleSoundMode;
1005  PROPERTYTYPEBASIC(GeneratedVehicleSoundMode, Vehicle::SoundMode)
1006 
1007  static const Property DriverId;
1008  PROPERTYTYPE(DriverId, DriverIdType, StringPropertyType, std::string)
1009 
1010  static const Property PowertrainTorque;
1011  PROPERTYTYPEBASIC(PowertrainTorque, uint16_t)
1012 
1013  static const Property AcceleratorPedalPosition;
1014  PROPERTYTYPEBASIC(AcceleratorPedalPosition, uint16_t)
1015 
1016  static const Property Chime;
1017  PROPERTYTYPEBASIC(Chime, bool)
1018 
1019  static const Property WheelTick;
1020  PROPERTYTYPEBASIC(WheelTick, uint)
1021 
1022  static const Property IgnitionTimeOn;
1023  PROPERTYTYPEBASIC(IgnitionTimeOn, uint64_t)
1024 
1025  static const Property IgnitionTimeOff;
1026  PROPERTYTYPEBASIC(IgnitionTimeOff, uint64_t)
1027 
1028  static const Property YawRate;
1029  PROPERTYTYPEBASIC(YawRate, int16_t)
1030 
1031  static const Property BrakePadWear;
1032  PROPERTYTYPEBASIC(BrakePadWear, uint16_t)
1033 
1034  static const Property BrakeFluidLevelLow;
1035  PROPERTYTYPEBASIC(BrakeFluidLevelLow, bool)
1036 
1037  static const Property BrakesWorn;
1038  PROPERTYTYPEBASIC(BrakesWorn, bool)
1039 
1040  static const Property MalfunctionIndicatorOn;
1041  PROPERTYTYPEBASIC(MalfunctionIndicatorOn, bool)
1042 
1043  static const Property AccumulatedEngineRuntime;
1044  PROPERTYTYPEBASIC(AccumulatedEngineRuntime, uint32_t)
1045 
1046  static const Property DistanceSinceCodeCleared;
1047  PROPERTYTYPEBASIC(DistanceSinceCodeCleared, uint32_t)
1048 
1049  static const Property DistanceWithMILOn;
1050  PROPERTYTYPEBASIC(DistanceWithMILOn, uint32_t)
1051 
1052  static const Property TimeRunMILOn;
1053  PROPERTYTYPEBASIC(TimeRunMILOn, uint32_t)
1054 
1055  static const Property TimeTroubleCodeClear;
1056  PROPERTYTYPEBASIC(TimeTroubleCodeClear, uint32_t)
1057 
1058  static const Property VehicleDriveMode;
1059  PROPERTYTYPE(VehicleDriveMode, VehicleDriveModeType, StringPropertyType, std::string)
1060 
1061  static const Property ActiveNoiseControlMode;
1062  PROPERTYTYPEBASIC(ActiveNoiseControlMode, bool)
1063 
1064  static const Property AvailableSounds;
1065  PROPERTYTYPE(AvailableSounds, AvailableSoundsType, ListPropertyType<StringPropertyType>, StringPropertyType)
1066 
1067  static const Property EngineSoundEnhancementMode;
1068  PROPERTYTYPE(EngineSoundEnhancementMode, EngineSoundEnhancementModeType, StringPropertyType, std::string)
1069 
1070  static const Property ElectronicStabilityControlEnabled;
1071  PROPERTYTYPEBASIC(ElectronicStabilityControlEnabled, bool)
1072 
1073  static const Property ElectronicStabilityControlEngaged;
1074  PROPERTYTYPEBASIC(ElectronicStabilityControlEngaged, bool)
1075 
1076  static const Property OccupantIdentificationType;
1077  PROPERTYTYPE(OccupantIdentificationType, OccupantIdentificationTypeType, StringPropertyType, std::string)
1078 
1079  static const Property OccupantName;
1080  PROPERTYTYPE(OccupantName, OccupantNameType, StringPropertyType, std::string)
1081 
1082  static const Property AtmosphericPressure;
1083  PROPERTYTYPEBASIC(AtmosphericPressure, uint16_t)
1084 
1085  static const Property LaneDepartureStatus;
1086  PROPERTYTYPE(LaneDepartureStatus, LaneDepartureStatusType, StringPropertyType, std::string)
1087 
1091  static const Property AlarmStatus;
1092  PROPERTYTYPE(AlarmStatus, AlarmStatusType, StringPropertyType, std::string)
1093 
1094  //static const Property Lane
1095 
1103  static PropertyList capabilities();
1104 
1109  static PropertyList customProperties();
1110 
1115  static AbstractPropertyType* getPropertyTypeForPropertyNameValue(Property name, std::string value="");
1116 
1135  static bool registerProperty(Property name, PropertyTypeFactoryCallback factory);
1136 
1137 
1138 
1139 private:
1140 
1141  VehicleProperty();
1142 
1143  static std::unique_ptr<VehicleProperty> thereCanOnlyBeOne;
1144 
1145  static bool registerPropertyPriv(Property name, PropertyTypeFactoryCallback factory);
1146 
1147  static std::map<Property, PropertyTypeFactoryCallback> registeredPropertyFactoryMap;
1148  static PropertyList mCapabilities;
1149  static PropertyList mCustomProperties;
1150 };
1151 
1152 #endif // VEHICLEPROPERTY_H
1153 
1154 
Definition: mappropertytype.hpp:12
Corresponds with DBus Interface org.automotive.ThrottlePosition.
Definition: ambdbusmappings.idl:451
Definition: vehicleproperty.h:362
Corresponds with DBus Interface org.automotive.WheelTick.
Definition: ambdbusmappings.idl:541
Definition: vehicleproperty.h:167
Definition: vehicleproperty.h:214
Corresponds with DBus Interface org.automotive.TractionControlSystem.
Definition: ambdbusmappings.idl:1417
Corresponds with DBus Interface org.automotive.InteriorLightStatus.
Definition: ambdbusmappings.idl:259
static const Property NoValue
Various property types:
Definition: vehicleproperty.h:431
static const Property ParkingLightStatus
Definition: vehicleproperty.h:805
Definition: vehicleproperty.h:342
static const Property WindshieldWiperSpeed
WindshieldWiperSpeed Use WiperSpeedSetting::W3C::* for value.
Definition: vehicleproperty.h:883
static const Property TurnSignal
Definition: vehicleproperty.h:507
Definition: vehicleproperty.h:130
Corresponds with DBus Interface org.automotive.AirbagStatus.
Definition: ambdbusmappings.idl:1461
Definition: abstractpropertytype.h:70
Definition: vehicleproperty.h:291
static const Property WMI
Definition: vehicleproperty.h:601
static const Property WindshieldWiperSetting
WindshieldWiperSetting Use WiperSpeedSetting::W3C::* for value.
Definition: vehicleproperty.h:890
ListPropertyType is a AbstractPropertyType for arrays of AbstractPropertyTypes.
Definition: abstractpropertytype.h:721
Corresponds with DBus Interface org.automotive.Horn.
Definition: ambdbusmappings.idl:290
static const Property TireTemperature
Definition: vehicleproperty.h:614
Mode
Definition: vehicleproperty.h:104
Corresponds with DBus Interface org.automotive.PowertrainTorque.
Definition: ambdbusmappings.idl:502
Definition: vehicleproperty.h:311
Definition: vehicleproperty.h:83
Corresponds with DBus Interface org.automotive.ConvertibleRoof.
Definition: ambdbusmappings.idl:892
Corresponds with DBus Interface org.automotive.RainSensor.
Definition: ambdbusmappings.idl:643
Corresponds with DBus Interface org.automotive.WheelBrake.
Definition: ambdbusmappings.idl:166
static const Property ConvertibleRoofStatus
ConvertibleRoofStatus use with ConvertibleRoofW3C::*.
Definition: vehicleproperty.h:954
Definition: vehicleproperty.h:35
Corresponds with DBus Interface org.automotive.Defrost.
Definition: ambdbusmappings.idl:854
static const Property InteriorLightDriver
TODO: deprecated. Use InteriorLightStatus which is zoned. Remove in 0.14.
Definition: vehicleproperty.h:658
static const Property BatteryVoltage
Definition: vehicleproperty.h:563
Definition: vehicleproperty.h:320
Definition: vehicleproperty.h:411
static const Property AccelerationZ
Definition: vehicleproperty.h:535
Corresponds with DBus Interface org.automotive.Chime.
Definition: ambdbusmappings.idl:528
std::function< AbstractPropertyType *(void)> PropertyTypeFactoryCallback
PropertyTypeFactoryCallback callback used to construct a AbstractPropertyType for a property...
Definition: vehicleproperty.h:427
static const Property SecurityAlertStatus
TODO: Depreciated in 0.14. Use AlarmStatus.
Definition: vehicleproperty.h:786
Corresponds with DBus Interface org.automotive.OccupantStatus.
Definition: ambdbusmappings.idl:1549
PROPERTYTYPE(TransmissionShiftPosition, TransmissionShiftPositionType, BasicPropertyType< Transmission::TransmissionPositions >, Transmission::TransmissionPositions) static const Property TransmissionGearPosition
static const Property EngineCoolantLevel
Definition: vehicleproperty.h:522
Corresponds with DBus Interface org.automotive.VehicleSpeed.
Definition: ambdbusmappings.idl:15
Corresponds with DBus Interface org.automotive.DrivingMode.
Definition: ambdbusmappings.idl:483
Corresponds with DBus Interface org.automotive.YawRate.
Definition: ambdbusmappings.idl:573
static const Property TransmissionClutchWear
Definition: vehicleproperty.h:769
static const Property TirePressureLow
Definition: vehicleproperty.h:610
static const Property BatteryChargeLevel
Definition: vehicleproperty.h:571
static PropertyList customProperties()
customProperties
Definition: vehicleproperty.cpp:531
Corresponds with DBus Interface org.automotive.Sunroof.
Definition: ambdbusmappings.idl:873
Corresponds with DBus Interface org.automotive.WindowStatus.
Definition: ambdbusmappings.idl:816
static void factory()
factory constructs a static instance of VehicleProperty. This should be called once before VehiclePro...
Definition: vehicleproperty.cpp:520
static const Property AlarmStatus
AlarmStatus. Use with Security::W3C*.
Definition: vehicleproperty.h:1091
Corresponds with DBus Interface org.automotive.WindshieldWiper.
Definition: ambdbusmappings.idl:662
Corresponds with DBus Interface org.automotive.ExteriorBrightness.
Definition: ambdbusmappings.idl:599
Corresponds with DBus Interface org.automotive.EngineSpeed.
Definition: ambdbusmappings.idl:34
Definition: vehicleproperty.h:230
static const Property InteriorLightPassenger
TODO: deprecated. Use InteriorLightStatus which is zoned. Remove in 0.14.
Definition: vehicleproperty.h:664
Corresponds with DBus Interface org.automotive.NightMode.
Definition: ambdbusmappings.idl:464
Corresponds with DBus Interface org.automotive.AcceleratorPedalPosition.
Definition: ambdbusmappings.idl:515
static const Property SteeringWheelAngleW3C
TODO: Rename to "SteeringWheel" in 0.14.
Definition: vehicleproperty.h:503
Definition: abstractpropertytype.h:436
Definition: vehicleproperty.h:352
Corresponds with DBus Interface org.automotive.AntilockBrakingSystem.
Definition: ambdbusmappings.idl:1392
static const Property DoorStatusW3C
DoorStatusW3C use with Door::W3C::*.
Definition: vehicleproperty.h:847
Definition: vehicleproperty.h:276
static const Property EngineOilPressure
Definition: vehicleproperty.h:515
static const Property SteeringWheelAngle
Definition: vehicleproperty.h:499
Definition: abstractpropertytype.h:630
Corresponds with DBus Interface org.automotive.VehiclePowerMode.
Definition: ambdbusmappings.idl:53
Definition: vehicleproperty.h:257
static AbstractPropertyType * getPropertyTypeForPropertyNameValue(Property name, std::string value="")
getPropertyTypeForPropertyNameValue returns an AbstractPropertyType* for the property name with the v...
Definition: vehicleproperty.cpp:536
static const Property DistanceSinceStart
Definition: vehicleproperty.h:755
Corresponds with DBus Interface org.automotive.AtmosphericPressure.
Definition: ambdbusmappings.idl:911
static const Property BrakeFluidLevel
Definition: vehicleproperty.h:774
Corresponds with DBus Interface org.automotive.VehicleType.
Definition: ambdbusmappings.idl:987
Corresponds with DBus Interface org.automotive.DoorStatus.
Definition: ambdbusmappings.idl:1486
Definition: vehicleproperty.h:203
Definition: vehicleproperty.h:268
static const Property TirePressure
Definition: vehicleproperty.h:606
Corresponds with DBus Interface org.automotive.ButtonEvent.
Definition: ambdbusmappings.idl:586
static const Property EngineOilChangeIndicator
Definition: vehicleproperty.h:592
static const Property ParkingBrakeStatusW3C
ParkingBrakeStatusW3C use with ParkingBrake::W3C::*.
Definition: vehicleproperty.h:799
Definition: vehicleproperty.h:146
static const Property ClutchStatus
Definition: vehicleproperty.h:511
Corresponds with DBus Interface org.automotive.ObstacleDistance.
Definition: ambdbusmappings.idl:1562
Definition: vehicleproperty.h:185
Corresponds with DBus Interface org.automotive.VehicleTopSpeedLimit.
Definition: ambdbusmappings.idl:1442
static const Property AirflowDirection
TODO: Deprecated. Remove in 0.14.
Definition: vehicleproperty.h:894
static PropertyList capabilities()
capabilities
Definition: vehicleproperty.cpp:526
Corresponds with DBus Interface org.automotive.Odometer.
Definition: ambdbusmappings.idl:1044
Definition: vehicleproperty.h:73
static const Property InteriorLightCenter
TODO: deprecated. Use InteriorLightStatus which is zoned. Remove in 0.14.
Definition: vehicleproperty.h:661
static const Property TransmissionShiftPosition
Definition: vehicleproperty.h:452
Definition: vehicleproperty.h:550