c4e8bbf94f81eecd7af659943abd4b4e6ac6c74a
[profile/ivi/automotive-message-broker.git] / lib / client / libamb-objects.h
1 /*
2  * Automotive Message Broker Client Library
3  *
4  * Copyright (C) 2016 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the License)
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __LIBSAMSUNG_CAN_H__
20 #define __LIBSAMSUNG_CAN_H__
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #include "libamb-util.h"
27
28 enum GearboxPositionDisplay {
29         PARKING = (1<<3) | (1<<1), // 10, 0x0A
30         DRIVE,                     // 11, 0x0B
31         NEUTRAL,
32         REVERSE,
33 };
34
35 enum DriveMode {
36         NORMAL = (1<<3) | (1<<1),       // 10, 0x0A
37         ECO = (1<<3) | (1<<2),          // 12, 0x0C
38         SPORT,                          // 13, 0x0D
39 };
40
41 /**
42  * Gear Information
43  * CANID: 257 (0x101)
44  */
45 CAN_OBJECT(GearboxPositionDisplay, guint16, NULL);
46 CAN_OBJECT(GearboxPosition, guint16, NULL);
47 CAN_OBJECT(DriveMode, guint16, NULL);
48 CAN_OBJECT(AliveCounter, guchar, NULL);
49
50 /**
51  * Vehicle Speed & Odometer
52  * CANID: 258 (0x102)
53  */
54 CAN_OBJECT(Vehicle_Speed,       guint16, NULL);
55 CAN_OBJECT(VehicleOdometer,     guint32, NULL);
56
57 /**
58  * Engine Information
59  * CANID: 259 (0x103)
60  */
61 CAN_OBJECT(EngineRPM,           guint16, NULL);
62 CAN_OBJECT(WarterTemperature,   guint16, NULL);
63 CAN_OBJECT(OutsideTemperature,  gdouble,  NULL);
64 CAN_OBJECT(FuelGage,            guint16,  NULL);
65
66 /**
67  * TPMS Tire Air pressure
68  * CANID: 260 (0x104)
69  */
70 CAN_OBJECT(TPMS_FL, guint16, NULL);
71 CAN_OBJECT(TPMS_FR, guint16, NULL);
72 CAN_OBJECT(TPMS_RL, guint16, NULL);
73 CAN_OBJECT(TPMS_RR, guint16, NULL);
74
75 /**
76  * Battery Status
77  * CANID: 261 (0x105)
78  */
79 CAN_OBJECT(LampAutomaticHold,   guchar, NULL);
80 CAN_OBJECT(Battery_Voltage,      gdouble, NULL);
81 CAN_OBJECT(Battery_Current,      guint16, NULL);
82 CAN_OBJECT(Battery_Charge_Level,   guint16, NULL);
83 CAN_OBJECT(Washer_Shot, gboolean, NULL);
84 CAN_OBJECT(Wiper_Lo,    gboolean, NULL);
85 CAN_OBJECT(Wiper_Speed, guint16, NULL);
86 CAN_OBJECT(Wiper_Hi,    gboolean, NULL);
87 CAN_OBJECT(Wiper_Mist,  gboolean, NULL);
88 CAN_OBJECT(Wiper_Auto,  gboolean, NULL);
89
90 /**
91  * Object Detection
92  * CANID: 262 (0x106)
93  */
94 CAN_OBJECT(Object_Detect_Front_Left,    guint16, NULL);
95 CAN_OBJECT(Object_Detect_Front_Right,   guint16, NULL);
96 CAN_OBJECT(Object_Detect_Front,         guint16, NULL);
97 CAN_OBJECT(Object_Detect_Rear,          guint16, NULL);
98 CAN_OBJECT(Object_Detect_Rear_Left,     guint16, NULL);
99 CAN_OBJECT(Object_Detect_Rear_Right,    guint16, NULL);
100 CAN_OBJECT(Object_Detect,               gboolean, NULL);
101
102 /**
103  * Warning Message & Status
104  * CANID: 518 (0x206)
105  */
106 CAN_OBJECT(WarningSafetybelts,  gboolean, NULL);
107 CAN_OBJECT(WarningAirbag,       gboolean, NULL);
108 CAN_OBJECT(CheckCharging,       gboolean, NULL);
109 CAN_OBJECT(WarningLowOilLevel,  gboolean, NULL);
110 CAN_OBJECT(CheckPowerSteering,  gboolean, NULL);
111 CAN_OBJECT(WarningBrake,        gboolean, NULL);
112 CAN_OBJECT(WarningEBD,          gboolean, NULL);
113
114 CAN_OBJECT(LeftTurnSignal,  gboolean, NULL);
115 CAN_OBJECT(RightTurnSignal,  gboolean, NULL);
116
117 CAN_OBJECT(CheckEnging,         gboolean, NULL);
118 CAN_OBJECT(EmergencyFlasher,    gboolean, NULL);
119 CAN_OBJECT(FuelLeveltooLow,     gboolean, NULL);
120 CAN_OBJECT(WarningTPM,          gboolean, NULL);
121 CAN_OBJECT(LowWasher,           gboolean, NULL);
122 CAN_OBJECT(SystemESC,           gboolean, NULL);
123 CAN_OBJECT(SystemESCOff,        gboolean, NULL);
124
125 CAN_OBJECT(WarningABS,          gboolean, NULL);
126 CAN_OBJECT(StsDoorOpen,         gboolean, NULL);
127 CAN_OBJECT(StsTrunkOpen,        gboolean, NULL);
128 CAN_OBJECT(WarningImmobilizer,  gboolean, NULL);
129 CAN_OBJECT(LampRearFogLights,   gboolean, NULL);
130 CAN_OBJECT(LampHeadBeam,        gboolean, NULL);
131
132 CAN_OBJECT(LampHazardLight,     gboolean, NULL);
133 CAN_OBJECT(LampFrontFog,        gboolean, NULL);
134 CAN_OBJECT(LampTailLight,       gboolean, NULL);
135 CAN_OBJECT(LampHighBeamAuto,    gboolean, NULL);
136 CAN_OBJECT(LampHighBeam,        gboolean, NULL);
137 CAN_OBJECT(LampCruiseCnt,       gboolean, NULL);
138 CAN_OBJECT(LampCruiseCntSet,    gboolean, NULL);
139
140 CAN_OBJECT(LampDoorOpenF_L,     gboolean, NULL);
141 CAN_OBJECT(LampDoorOpenF_R,     gboolean, NULL);
142 CAN_OBJECT(LampDoorOpenR_L,     gboolean, NULL);
143 CAN_OBJECT(LampDoorOpenR_R,     gboolean, NULL);
144 CAN_OBJECT(LampDoorOpenBonnet,  gboolean, NULL);
145 CAN_OBJECT(LampDoorOpenTrunk,   gboolean, NULL);
146 CAN_OBJECT(WarningParkingBreak, gboolean, NULL);
147 CAN_OBJECT(CheckInRear,         gboolean, NULL);
148
149 CAN_OBJECT(CheckSeatHeaterL,    guchar, NULL);
150 CAN_OBJECT(CheckSeatHeaterR,    guchar, NULL);
151 CAN_OBJECT(CheckSeatCoolerL,    guchar, NULL);
152 CAN_OBJECT(CheckSeatCoolerR,    guchar, NULL);
153
154 CAN_OBJECT(InsideRecirculatedAirMode,   gboolean, NULL);
155 CAN_OBJECT(FrontDefrostion,     gboolean, NULL);
156 CAN_OBJECT(RearDefrostion,      gboolean, NULL);
157
158 /**
159  * Wheel Remote Controller Key Event
160  * CANID: 519 (0x207)
161  */
162 CAN_OBJECT(FR_KeyEvent01,       gboolean, NULL);
163 CAN_OBJECT(FR_KeyEvent02,       gboolean, NULL);
164 CAN_OBJECT(FR_KeyEvent03,       gboolean, NULL);
165 CAN_OBJECT(FR_KeyEvent04,       gboolean, NULL);
166 CAN_OBJECT(FR_KeyEvent05,       gboolean, NULL);
167 CAN_OBJECT(FR_KeyEvent06,       gboolean, NULL);
168 CAN_OBJECT(FR_KeyEvent07,       gboolean, NULL);
169 CAN_OBJECT(FR_KeyEvent08,       gboolean, NULL);
170
171 CAN_OBJECT(FR_KeyEvent09,       gboolean, NULL);
172 CAN_OBJECT(FR_KeyEvent10,       gboolean, NULL);
173 CAN_OBJECT(FR_KeyEvent11,       gboolean, NULL);
174 CAN_OBJECT(FR_KeyEvent12,       gboolean, NULL);
175 CAN_OBJECT(FR_KeyEvent13,       gboolean, NULL);
176 CAN_OBJECT(FR_KeyEvent14,       gboolean, NULL);
177 CAN_OBJECT(FR_KeyEvent15,       gboolean, NULL);
178 CAN_OBJECT(FR_KeyEvent16,       gboolean, NULL);
179
180 CAN_OBJECT(FR_KeyEvent17,       gboolean, NULL);
181 CAN_OBJECT(FR_KeyEvent18,       gboolean, NULL);
182 CAN_OBJECT(FR_KeyEvent19,       gboolean, NULL);
183 CAN_OBJECT(FR_KeyEvent20,       gboolean, NULL);
184 CAN_OBJECT(FR_KeyEvent21,       gboolean, NULL);
185 CAN_OBJECT(FR_KeyEvent22,       gboolean, NULL);
186 CAN_OBJECT(FR_KeyEvent23,       gboolean, NULL);
187 CAN_OBJECT(FR_KeyEvent24,       gboolean, NULL);
188
189 /**
190  * CID Time Information
191  * CANID: 1025 (0x401)
192  */
193 CAN_OBJECT(CidWatchHour,        guchar, NULL);
194 CAN_OBJECT(CidWatchMin,         guchar, NULL);
195 CAN_OBJECT(CidWatchSec,         guchar, NULL);
196 CAN_OBJECT(CidWatchYY,      guint16, NULL);
197 CAN_OBJECT(CidWatchMM,      guchar, NULL);
198 CAN_OBJECT(CidWatchDD,      guchar, NULL);
199
200 /**
201  * CID Climate & Media Volumn Information
202  * CANID: 1026 (0x402)
203  */
204 CAN_OBJECT(CidACOnOff,                  gboolean, NULL);
205 CAN_OBJECT(AirDistributionCID,  guchar, NULL);
206 CAN_OBJECT(LeftTemperatureCID,  gdouble, NULL);
207 CAN_OBJECT(LeftAirflowCID,      guint16, NULL);
208 CAN_OBJECT(RightTemperatureCID, gdouble, NULL);
209 CAN_OBJECT(RightAirflowCID,     guint16, NULL);
210 CAN_OBJECT(MediaVolumeCID,      guint16, NULL);
211
212 /**
213  * CID Climate & Defrosion Information
214  * CANID: 1027 (0x403)
215  */
216 CAN_OBJECT(CidCheckSeatHeaterL,         guint16, NULL);
217 CAN_OBJECT(CidCheckSeatHeaterR,         guint16, NULL);
218 CAN_OBJECT(CidCheckSeatCoolerL,         guint16, NULL);
219 CAN_OBJECT(CidCheckSeatCoolerR,         guint16, NULL);
220 CAN_OBJECT(CidInsideRecirculatedAirMode,        gboolean, NULL);
221 CAN_OBJECT(CidFrontDefrostion,  gboolean, NULL);
222 CAN_OBJECT(CidRearDefrostion,   gboolean, NULL);
223 CAN_OBJECT(CidBtnAutoMode,              gboolean, NULL);
224
225 /**
226  * Cluster Trip Information A
227  * CANID: 769 (0x301)
228  */
229 CAN_OBJECT(TRIP_A_Range,        guint32, NULL);
230 CAN_OBJECT(TRIP_A_Fuel_Used,    guchar, NULL);
231 CAN_OBJECT(TRIP_A_Avg_Speed,    guint16, NULL);
232 CAN_OBJECT(TRIP_A_EllapsedTime, guint16, NULL);
233
234 /**
235  * Cluster Trip Information B
236  * CANID: 770 (0x302)
237  */
238 CAN_OBJECT(TRIP_B_Range,        guint32, NULL);
239 CAN_OBJECT(TRIP_B_Fuel_Used,    guchar, NULL);
240 CAN_OBJECT(TRIP_B_Avg_Speed,    guint16, NULL);
241 CAN_OBJECT(TRIP_B_EllapsedTime, guint16, NULL);
242
243 /**
244  * Left Knob Control
245  * CANID: 1793 (0x701)
246  */
247 CAN_OBJECT(AirDistributionLeftKnob,     guchar, NULL);
248 CAN_OBJECT(LeftTemperatureLeftKnob,     gdouble, NULL);
249 CAN_OBJECT(LeftAirflowLeftKnob,         guint16, NULL);
250 CAN_OBJECT(MediaVolumeLeftKnob,         guint16, NULL);
251
252 /**
253  * Right Knob Control
254  * CANID: 1794 (0x702)
255  */
256 CAN_OBJECT(AirDistributionRightKnob,    guchar, NULL);
257 CAN_OBJECT(RightTemperatureRightKnob,   gdouble, NULL);
258 CAN_OBJECT(RightAirflowLeftKnob,        guint16, NULL);
259 CAN_OBJECT(MediaVolumeRightKnob,        guint16, NULL);
260
261 /**
262  * Writable AMB Object
263  * Climate
264  */
265 CAN_OBJECT_WRITABLE(CidCheckSeatHeaterL,            guint16, NULL);
266 CAN_OBJECT_WRITABLE(CidCheckSeatHeaterR,            guint16, NULL);
267 CAN_OBJECT_WRITABLE(CidCheckSeatCoolerL,            guint16, NULL);
268 CAN_OBJECT_WRITABLE(CidCheckSeatCoolerR,            guint16, NULL);
269 CAN_OBJECT_WRITABLE(AirDistributionCID,     guint16, NULL);
270 CAN_OBJECT_WRITABLE(LeftTemperatureCID,     gdouble, NULL);
271 CAN_OBJECT_WRITABLE(LeftAirflowCID,             guint16, NULL);
272 CAN_OBJECT_WRITABLE(RightTemperatureCID,    gdouble, NULL);
273 CAN_OBJECT_WRITABLE(RightAirflowCID,        guint16, NULL);
274 CAN_OBJECT_WRITABLE(CidInsideRecirculatedAirMode,       gboolean, NULL);
275 CAN_OBJECT_WRITABLE(CidFrontDefrostion, gboolean, NULL);
276 CAN_OBJECT_WRITABLE(CidRearDefrostion,  gboolean, NULL);
277 CAN_OBJECT_WRITABLE(CidBtnAutoMode,             gboolean, NULL);
278 CAN_OBJECT_WRITABLE(CidACOnOff, gboolean, NULL);
279
280 CAN_OBJECT_WRITABLE(CheckSeatHeaterL,       guchar, NULL);              /* defrecated */
281 CAN_OBJECT_WRITABLE(CheckSeatHeaterR,       guchar, NULL);              /* defrecated */
282 CAN_OBJECT_WRITABLE(CheckSeatCoolerL,       guchar, NULL);              /* defrecated */
283 CAN_OBJECT_WRITABLE(CheckSeatCoolerR,       guchar, NULL);              /* defrecated */
284
285 /**
286  * Writable AMB Object
287  * Media Volumn
288  */
289 CAN_OBJECT_WRITABLE(MediaVolumeCID,     guint16, NULL);
290
291 /**
292  * Writable AMB Object
293  * Left Knob Control
294  */
295 CAN_OBJECT_WRITABLE(AirDistributionLeftKnob,    guchar, NULL);
296 CAN_OBJECT_WRITABLE(LeftTemperatureLeftKnob,    gdouble, NULL);
297 CAN_OBJECT_WRITABLE(LeftAirflowLeftKnob,        guint16, NULL);
298 CAN_OBJECT_WRITABLE(MediaVolumeLeftKnob,        guint16, NULL);
299
300 /**
301  * Writable AMB Object
302  * Right Knob Control
303  */
304 CAN_OBJECT_WRITABLE(AirDistributionRightKnob,   guchar, NULL);
305 CAN_OBJECT_WRITABLE(RightTemperatureRightKnob,  gdouble, NULL);
306 CAN_OBJECT_WRITABLE(RightAirflowLeftKnob,       guint16, NULL);
307 CAN_OBJECT_WRITABLE(MediaVolumeRightKnob,       guint16, NULL);
308
309 #ifdef __cplusplus
310 }
311 #endif
312
313 #endif /* __LIBSAMSUNG_CAN_H__ */