blob: aa92815e5fc27f45c82d63250f042d089258eb31 [file] [log] [blame]
Sanket Agarwalfb636682015-08-11 14:34:29 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_VEHICLE_INTERFACE_H
18#define ANDROID_VEHICLE_INTERFACE_H
19
20#include <stdint.h>
21#include <sys/cdefs.h>
22#include <sys/types.h>
Keun-young Park418c7e82016-04-06 10:44:20 -070023#include <math.h>
Sanket Agarwalfb636682015-08-11 14:34:29 -070024#include <errno.h>
25
26#include <hardware/hardware.h>
27#include <cutils/native_handle.h>
28
29__BEGIN_DECLS
30
31/*****************************************************************************/
32
33#define VEHICLE_HEADER_VERSION 1
34#define VEHICLE_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0)
35#define VEHICLE_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, VEHICLE_HEADER_VERSION)
36
37/**
38 * Vehicle HAL to provide interfaces to various Car related sensors. The HAL is
39 * designed in a property, value maping where each property has a value which
40 * can be "get", "set" and "(un)subscribed" to. Subscribing will require the
41 * user of this HAL to provide parameters such as sampling rate.
42 */
43
44
45/*
46 * The id of this module
47 */
48#define VEHICLE_HARDWARE_MODULE_ID "vehicle"
49
50/**
51 * Name of the vehicle device to open
52 */
53#define VEHICLE_HARDWARE_DEVICE "vehicle_hw_device"
54
55/**
56 * Each vehicle property is defined with various annotations to specify the type of information.
57 * Annotations will be used by scripts to run some type check or generate some boiler-plate codes.
58 * Also the annotations are the specification for each property, and each HAL implementation should
59 * follow what is specified as annotations.
60 * Here is the list of annotations with explanation on what it does:
61 * @value_type: Type of data for this property. One of the value from vehicle_value_type should be
62 * set here.
63 * @change_mode: How this property changes. Value set is from vehicle_prop_change_mode. Some
64 * properties can allow either on change or continuous mode and it is up to HAL
65 * implementation to choose which mode to use.
66 * @access: Define how this property can be accessed. read only, write only or R/W from
67 * vehicle_prop_access
68 * @data_member: Name of member from vehicle_value union to access this data.
69 * @data_enum: enum type that should be used for the data.
70 * @unit: Unit of data. Should be from vehicle_unit_type.
Keun-young Parkbf877a72015-12-21 14:16:05 -080071 * @config_flags: Usage of config_flags in vehicle_prop_config
72 * @config_array: Usage of config_array in vehicle_prop_config. When this is specified,
73 * @config_flags will not be used.
Sanket Agarwalfb636682015-08-11 14:34:29 -070074 * @config_string: Explains the usage of config_string in vehicle_prop_config. Property with
75 * this annotation is expected to have additional information in config_string
76 * for that property to work.
Keun-young Park14f09002016-01-22 16:29:22 -080077 * @zone_type type of zoned used. defined for zoned property
Sanket Agarwalfb636682015-08-11 14:34:29 -070078 * @range_start, @range_end : define range of specific property values.
Keun-young Park418c7e82016-04-06 10:44:20 -070079 * @allow_out_of_range_value : This property allows out of range value to deliver additional
80 * information. Check VEHICLE_*_OUT_OF_RANGE_* for applicable values.
Sanket Agarwalfb636682015-08-11 14:34:29 -070081 */
82//===== Vehicle Information ====
83
84/**
85 * Invalid property value used for argument where invalid property gives different result.
Sanket Agarwalfb636682015-08-11 14:34:29 -070086 */
87#define VEHICLE_PROPERTY_INVALID (0x0)
88
89/**
90 * VIN of vehicle
91 * @value_type VEHICLE_VALUE_TYPE_STRING
92 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
93 * @access VEHICLE_PROP_ACCESS_READ
94 * @data_member info_vin
95 */
96#define VEHICLE_PROPERTY_INFO_VIN (0x00000100)
97
98/**
99 * Maker name of vehicle
100 * @value_type VEHICLE_VALUE_TYPE_STRING
101 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
102 * @access VEHICLE_PROP_ACCESS_READ
103 * @data_member info_make
104 */
105#define VEHICLE_PROPERTY_INFO_MAKE (0x00000101)
106
107/**
108 * Model of vehicle
109 * @value_type VEHICLE_VALUE_TYPE_STRING
110 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
111 * @access VEHICLE_PROP_ACCESS_READ
112 * @data_member info_model
113 */
114#define VEHICLE_PROPERTY_INFO_MODEL (0x00000102)
115
116/**
117 * Model year of vehicle.
118 * @value_type VEHICLE_VALUE_TYPE_INT32
119 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
120 * @access VEHICLE_PROP_ACCESS_READ
121 * @data_member info_model_year
122 * @unit VEHICLE_UNIT_TYPE_YEAR
123 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700124#define VEHICLE_PROPERTY_INFO_MODEL_YEAR (0x00000103)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700125
126/**
127 * Fuel capacity of the vehicle
128 * @value_type VEHICLE_VALUE_TYPE_FLOAT
129 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
130 * @access VEHICLE_PROP_ACCESS_READ
131 * @data_member info_fuel_capacity
132 * @unit VEHICLE_UNIT_TYPE_VEHICLE_UNIT_TYPE_MILLILITER
133 */
134#define VEHICLE_PROPERTY_INFO_FUEL_CAPACITY (0x00000104)
135
136
137//==== Vehicle Performance Sensors ====
138
139/**
140 * Current odometer value of the vehicle
141 * @value_type VEHICLE_VALUE_TYPE_FLOAT
142 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
143 * @access VEHICLE_PROP_ACCESS_READ
144 * @data_member odometer
145 * @unit VEHICLE_UNIT_TYPE_KILOMETER
146 */
147#define VEHICLE_PROPERTY_PERF_ODOMETER (0x00000204)
148
149/**
150 * Speed of the vehicle
151 * @value_type VEHICLE_VALUE_TYPE_FLOAT
152 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
153 * @access VEHICLE_PROP_ACCESS_READ
154 * @data_member vehicle_speed
155 * @unit VEHICLE_UNIT_TYPE_METER_PER_SEC
156 */
157#define VEHICLE_PROPERTY_PERF_VEHICLE_SPEED (0x00000207)
158
159
160//==== Engine Sensors ====
161
162/**
163 * Temperature of engine coolant
164 * @value_type VEHICLE_VALUE_TYPE_FLOAT
165 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
166 * @access VEHICLE_PROP_ACCESS_READ
167 * @data_member engine_coolant_temperature
168 * @unit VEHICLE_UNIT_TYPE_CELCIUS
169 */
170#define VEHICLE_PROPERTY_ENGINE_COOLANT_TEMP (0x00000301)
171
172/**
173 * Temperature of engine oil
174 * @value_type VEHICLE_VALUE_TYPE_FLOAT
175 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
176 * @access VEHICLE_PROP_ACCESS_READ
177 * @data_member engine_oil_temperature
178 * @unit VEHICLE_UNIT_TYPE_CELCIUS
179 */
180#define VEHICLE_PROPERTY_ENGINE_OIL_TEMP (0x00000304)
181/**
182 * Engine rpm
183 * @value_type VEHICLE_VALUE_TYPE_FLOAT
184 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
185 * @access VEHICLE_PROP_ACCESS_READ
186 * @data_member engine_rpm
187 * @unit VEHICLE_UNIT_TYPE_RPM
188 */
189#define VEHICLE_PROPERTY_ENGINE_RPM (0x00000305)
190
191//==== Event Sensors ====
192
193/**
194 * Currently selected gear
195 * @value_type VEHICLE_VALUE_TYPE_INT32
196 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
197 * @access VEHICLE_PROP_ACCESS_READ
198 * @data_member gear_selection
199 * @data_enum vehicle_gear
200 */
201#define VEHICLE_PROPERTY_GEAR_SELECTION (0x00000400)
202
203/**
204 * Current gear. In non-manual case, selected gear does not necessarily match the current gear
205 * @value_type VEHICLE_VALUE_TYPE_INT32
206 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
207 * @access VEHICLE_PROP_ACCESS_READ
208 * @data_member gear_current_gear
209 * @data_enum vehicle_gear
210 */
211#define VEHICLE_PROPERTY_CURRENT_GEAR (0x00000401)
212
213/**
214 * Parking brake state.
215 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
216 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
217 * @access VEHICLE_PROP_ACCESS_READ
218 * @data_member parking_brake
219 * @data_enum vehicle_boolean
220 */
221#define VEHICLE_PROPERTY_PARKING_BRAKE_ON (0x00000402)
222
223/**
224 * Driving status policy.
225 * @value_type VEHICLE_VALUE_TYPE_INT32
226 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
227 * @access VEHICLE_PROP_ACCESS_READ
228 * @data_member driving_status
229 * @data_enum vehicle_driving_status
230 */
231#define VEHICLE_PROPERTY_DRIVING_STATUS (0x00000404)
232
233/**
234 * Warning for fuel low level.
235 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
236 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
237 * @access VEHICLE_PROP_ACCESS_READ
238 * @data_member is_fuel_level_low
239 * @data_enum vehicle_boolean
240 */
241#define VEHICLE_PROPERTY_FUEL_LEVEL_LOW (0x00000405)
242
243/**
244 * Night mode or not.
245 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
246 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
247 * @access VEHICLE_PROP_ACCESS_READ
248 * @data_member night_mode
249 * @data_enum vehicle_boolean
250 */
251#define VEHICLE_PROPERTY_NIGHT_MODE (0x00000407)
252
253
254
Steve Paike588bae2016-06-29 17:06:16 -0700255//==== HVAC Properties ====
Sanket Agarwalfb636682015-08-11 14:34:29 -0700256
257/**
258 * Fan speed setting
259 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
260 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
261 * @access VEHICLE_PROP_ACCESS_READ_WRITE
262 * @data_member hvac.fan_speed
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700263 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Keun-young Park418c7e82016-04-06 10:44:20 -0700264 * @allow_out_of_range_value : OFF
Sanket Agarwalfb636682015-08-11 14:34:29 -0700265 */
266#define VEHICLE_PROPERTY_HVAC_FAN_SPEED (0x00000500)
267
268/**
269 * Fan direction setting
270 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
271 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
272 * @access VEHICLE_PROP_ACCESS_READ_WRITE
273 * @data_member hvac.fan_direction
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700274 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paikbfbbb672016-07-08 16:12:38 -0700275 * @data_enum vehicle_hvac_fan_direction
Keun-young Park418c7e82016-04-06 10:44:20 -0700276 * @allow_out_of_range_value : OFF
Sanket Agarwalfb636682015-08-11 14:34:29 -0700277 */
278#define VEHICLE_PROPERTY_HVAC_FAN_DIRECTION (0x00000501)
279
Steve Paikd2ba70f2015-12-10 14:58:27 -0800280/*
281 * Bit flags for fan direction
282 */
Steve Paik159349e2016-02-09 18:45:58 -0800283enum vehicle_hvac_fan_direction {
284 VEHICLE_HVAC_FAN_DIRECTION_FACE = 0x1,
285 VEHICLE_HVAC_FAN_DIRECTION_FLOOR = 0x2,
286 VEHICLE_HVAC_FAN_DIRECTION_FACE_AND_FLOOR = 0x3,
287 VEHICLE_HVAC_FAN_DIRECTION_DEFROST = 0x4,
288 VEHICLE_HVAC_FAN_DIRECTION_DEFROST_AND_FLOOR = 0x5
Steve Paikd2ba70f2015-12-10 14:58:27 -0800289};
290
Sanket Agarwalfb636682015-08-11 14:34:29 -0700291/**
292 * HVAC current temperature.
293 * @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
Keun-young Parkda3cb912016-05-12 11:21:04 -0700294 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700295 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700296 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700297 * @data_member hvac.temperature_current
298 */
299#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_CURRENT (0x00000502)
300
301/**
302 * HVAC, target temperature set.
303 * @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
Keun-young Parkda3cb912016-05-12 11:21:04 -0700304 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700305 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700306 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700307 * @data_member hvac.temperature_set
Keun-young Park418c7e82016-04-06 10:44:20 -0700308 * @allow_out_of_range_value : MIN / MAX / OFF
Sanket Agarwalfb636682015-08-11 14:34:29 -0700309 */
310#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_SET (0x00000503)
311
312/**
313 * On/off defrost
314 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
315 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
316 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700317 * @zone_type VEHICLE_ZONE_TYPE_WINDOW
Sanket Agarwalfb636682015-08-11 14:34:29 -0700318 * @data_member hvac.defrost_on
319 */
320#define VEHICLE_PROPERTY_HVAC_DEFROSTER (0x00000504)
321
322/**
323 * On/off AC
324 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
325 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
326 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -0800327 * @config_flags Supported zones
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700328 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700329 * @data_member hvac.ac_on
330 */
331#define VEHICLE_PROPERTY_HVAC_AC_ON (0x00000505)
332
333/**
Steve Paikd2ba70f2015-12-10 14:58:27 -0800334 * On/off max AC
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700335 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800336 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
337 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700338 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800339 * @data_member hvac.max_ac_on
340 */
341#define VEHICLE_PROPERTY_HVAC_MAX_AC_ON (0x00000506)
342
343/**
344 * On/off max defrost
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700345 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800346 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
347 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700348 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800349 * @data_member hvac.max_defrost_on
350 */
351#define VEHICLE_PROPERTY_HVAC_MAX_DEFROST_ON (0x00000507)
352
353/**
354 * On/off re-circulation
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700355 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800356 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
357 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700358 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800359 * @data_member hvac.max_recirc_on
360 */
361#define VEHICLE_PROPERTY_HVAC_RECIRC_ON (0x00000508)
362
363/**
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700364 * On/off dual. This will be defined per each row.
365 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800366 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
367 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700368 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800369 * @data_member hvac.dual_on
370 */
371#define VEHICLE_PROPERTY_HVAC_DUAL_ON (0x00000509)
372
373/**
Steve Paikcc9e2922016-04-21 11:40:17 -0700374 * On/off automatic mode
375 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
376 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
377 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700378 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paik670e7ab2016-04-29 16:32:02 -0700379 * @data_member hvac.auto_on
Steve Paikcc9e2922016-04-21 11:40:17 -0700380 */
381#define VEHICLE_PROPERTY_HVAC_AUTO_ON (0x0000050A)
382
383/**
Steve Paike588bae2016-06-29 17:06:16 -0700384 * Seat temperature
385 *
386 * Negative values indicate cooling.
387 * 0 indicates off.
388 * Positive values indicate heating.
389 *
390 * Some vehicles may have multiple levels of heating and cooling. The min/max
391 * range defines the allowable range and number of steps in each direction.
392 *
393 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
394 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
Steve Paik983e9292016-07-20 21:06:54 -0700395 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700396 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -0700397 * @data_member int32_value
398 */
399#define VEHICLE_PROPERTY_HVAC_SEAT_TEMPERATURE (0x0000050B)
400
401/**
Steve Paikbfbbb672016-07-08 16:12:38 -0700402 * Side Mirror Heat
403 *
404 * Increase values denote higher heating levels for side mirrors.
405 * 0 indicates heating is turned off.
406 *
407 * @value_type VEHICLE_VALUE_TYPE_INT32
408 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
409 * @access VEHICLE_PROP_ACCESS_READ_WRITE
410 * @data_member int32_value
411 */
412#define VEHICLE_PROPERTY_HVAC_SIDE_MIRROR_HEAT (0x0000050C)
413
414/**
415 * Steering Wheel Temperature
416 *
417 * Sets the temperature for the steering wheel
418 * Positive value indicates heating.
419 * Negative value indicates cooling.
420 * 0 indicates tempreature control is off.
421 *
422 * @value_type VEHICLE_VALUE_TYPE_INT32
423 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
424 * @access VEHICLE_PROP_ACCESS_READ_WRITE
425 * @data_member int32_value
426 */
427#define VEHICLE_PROPERTY_HVAC_STEERING_WHEEL_TEMP (0x0000050D)
428
429/**
430 * Temperature units
431 *
432 * Indicates whether the temperature is in Celsius, Fahrenheit, or a different unit.
433 * This parameter affects all HVAC temperatures in the system.
434 *
435 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
436 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
437 * @access VEHICLE_PROP_ACCESS_READ
438 * @data_enum vehicle_unit_type
439 * @data_member int32_value
440 */
441#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_UNITS (0x0000050E)
442
443/**
444 * Actual fan speed
445 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
446 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
447 * @access VEHICLE_PROP_ACCESS_READ
448 * @data_member hvac.fan_speed
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700449 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paikbfbbb672016-07-08 16:12:38 -0700450 * @allow_out_of_range_value : OFF
451 */
452#define VEHICLE_PROPERTY_HVAC_ACTUAL_FAN_SPEED_RPM (0x0000050F)
453
454
455/**
Keun-young Park418c7e82016-04-06 10:44:20 -0700456 * Represents power state for HVAC. Some HVAC properties will require matching power to be turned on
457 * to get out of OFF state. For non-zoned HVAC properties, VEHICLE_ALL_ZONE corresponds to
458 * global power state.
459 *
460 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
461 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
462 * @access VEHICLE_PROP_ACCESS_READ_WRITE
463 * @config_string list of HVAC properties whose power is controlled by this property. Format is
464 * hexa-decimal number (0x...) separated by comma like "0x500,0x503". All zones
465 * defined in these affected properties should be available in the property.
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700466 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Keun-young Park418c7e82016-04-06 10:44:20 -0700467 * @data_member hvac.power_on
468 */
469#define VEHICLE_PROPERTY_HVAC_POWER_ON (0x00000510)
470
471/**
Steve Paikbfbbb672016-07-08 16:12:38 -0700472 * Fan Positions Available
473 *
474 * This is a bit mask of fan positions available for the zone. Each entry in
475 * vehicle_hvac_fan_direction is selected by bit position. For instance, if
476 * only the FAN_DIRECTION_FACE (0x1) and FAN_DIRECTION_DEFROST (0x4) are available,
477 * then this value shall be set to 0x12.
478 *
479 * 0x12 = (1 << 1) | (1 << 4)
480 *
481 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
482 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
483 * @access VEHICLE_PROP_ACCESS_READ
484 * @data_member int32_value
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700485 * @zone_type VEHICLE_ZONE_TYPE_ZONE
Steve Paikbfbbb672016-07-08 16:12:38 -0700486 * @allow_out_of_range_value : OFF
487 */
488#define VEHICLE_PROPERTY_HVAC_FAN_DIRECTION_AVAILABLE (0x00000511)
489
490/**
Sanket Agarwalfb636682015-08-11 14:34:29 -0700491 * Outside temperature
492 * @value_type VEHICLE_VALUE_TYPE_FLOAT
493 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
494 * @access VEHICLE_PROP_ACCESS_READ
495 * @data_member outside_temperature
496 * @unit VEHICLE_UNIT_TYPE_CELCIUS
497 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700498#define VEHICLE_PROPERTY_ENV_OUTSIDE_TEMPERATURE (0x00000703)
Keun-young Parkcb354502016-02-08 18:15:55 -0800499
500
501/**
502 * Cabin temperature
503 * @value_type VEHICLE_VALUE_TYPE_FLOAT
504 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
505 * @access VEHICLE_PROP_ACCESS_READ
506 * @data_member cabin_temperature
507 * @unit VEHICLE_UNIT_TYPE_CELCIUS
508 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700509#define VEHICLE_PROPERTY_ENV_CABIN_TEMPERATURE (0x00000704)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700510
511
512/*
513 * Radio features.
514 */
515/**
516 * Radio presets stored on the Car radio module. The data type used is int32
517 * array with the following fields:
518 * <ul>
519 * <li> int32_array[0]: Preset number </li>
520 * <li> int32_array[1]: Band type (see #RADIO_BAND_FM in
521 * system/core/include/system/radio.h).
522 * <li> int32_array[2]: Channel number </li>
523 * <li> int32_array[3]: Sub channel number </li>
524 * </ul>
525 *
526 * NOTE: When getting a current preset config ONLY set preset number (i.e.
527 * int32_array[0]). For setting a preset other fields are required.
528 *
529 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
530 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
531 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -0800532 * @config_flags Number of presets supported
Sanket Agarwalfb636682015-08-11 14:34:29 -0700533 * @data_member int32_array
534 */
Steve Paik5052d312016-07-14 16:05:19 -0700535#define VEHICLE_PROPERTY_RADIO_PRESET (0x00000801)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700536
537/**
538 * Constants relevant to radio.
539 */
540enum vehicle_radio_consts {
541 /** Minimum value for the radio preset */
542 VEHICLE_RADIO_PRESET_MIN_VALUE = 1,
543};
544
545/**
Sanket Agarwalfb636682015-08-11 14:34:29 -0700546 * Property to control power state of application processor.
547 *
548 * It is assumed that AP's power state is controller by separate power controller.
549 *
550 * For configuration information, vehicle_prop_config.config_flags can have bit flag combining
551 * values in vehicle_ap_power_state_config_type.
552 *
553 * For get / notification, data type looks like this:
554 * int32_array[0] : vehicle_ap_power_state_type
555 * int32_array[1] : additional parameter relevant for each state. should be 0 if not used.
556 * For set, data type looks like this:
557 * int32_array[0] : vehicle_ap_power_state_set_type
558 * int32_array[1] : additional parameter relevant for each request. should be 0 if not used.
559 *
560 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
561 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
562 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -0800563 * @config_flags Additional info on power state. Should use vehicle_ap_power_state_config_flag.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700564 * @data_member int32_array
565 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700566#define VEHICLE_PROPERTY_AP_POWER_STATE (0x00000A00)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700567
568enum vehicle_ap_power_state_config_flag {
569 /**
570 * AP can enter deep sleep state. If not set, AP will always shutdown from
571 * VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE power state.
572 */
573 VEHICLE_AP_POWER_STATE_CONFIG_ENABLE_DEEP_SLEEP_FLAG = 0x1,
574
575 /**
576 * The power controller can power on AP from off state after timeout specified in
577 * VEHICLE_AP_POWER_SET_SHUTDOWN_READY message.
578 */
579 VEHICLE_AP_POWER_STATE_CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2,
580};
581
582enum vehicle_ap_power_state {
583 /** vehicle HAL will never publish this state to AP */
584 VEHICLE_AP_POWER_STATE_OFF = 0,
585 /** vehicle HAL will never publish this state to AP */
586 VEHICLE_AP_POWER_STATE_DEEP_SLEEP = 1,
587 /** AP is on but display should be off. */
588 VEHICLE_AP_POWER_STATE_ON_DISP_OFF = 2,
589 /** AP is on with display on. This state allows full user interaction. */
590 VEHICLE_AP_POWER_STATE_ON_FULL = 3,
591 /**
592 * The power controller has requested AP to shutdown. AP can either enter sleep state or start
593 * full shutdown. AP can also request postponing shutdown by sending
594 * VEHICLE_AP_POWER_SET_SHUTDOWN_POSTPONE message. The power controller should change power
595 * state to this state to shutdown system.
596 *
597 * int32_array[1] : one of enum_vehicle_ap_power_state_shutdown_param_type
598 */
599 VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE = 4,
600};
601
602enum vehicle_ap_power_state_shutdown_param {
603 /** AP should shutdown immediately. Postponing is not allowed. */
604 VEHICLE_AP_POWER_SHUTDOWN_PARAM_SHUTDOWN_IMMEDIATELY = 1,
605 /** AP can enter deep sleep instead of shutting down completely. */
606 VEHICLE_AP_POWER_SHUTDOWN_PARAM_CAN_SLEEP = 2,
607 /** AP can only shutdown with postponing allowed. */
608 VEHICLE_AP_POWER_SHUTDOWN_PARAM_SHUTDOWN_ONLY = 3,
609};
610
611enum vehicle_ap_power_set_state {
612 /**
613 * AP has finished boot up, and can start shutdown if requested by power controller.
614 */
615 VEHICLE_AP_POWER_SET_BOOT_COMPLETE = 0x1,
616 /**
617 * AP is entering deep sleep state. How this state is implemented may vary depending on
618 * each H/W, but AP's power should be kept in this state.
619 */
620 VEHICLE_AP_POWER_SET_DEEP_SLEEP_ENTRY = 0x2,
621 /**
622 * AP is exiting from deep sleep state, and is in VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE state.
623 * The power controller may change state to other ON states based on the current state.
624 */
625 VEHICLE_AP_POWER_SET_DEEP_SLEEP_EXIT = 0x3,
626 /**
627 * int32_array[1]: Time to postpone shutdown in ms. Maximum value can be 5000 ms.
628 * If AP needs more time, it will send another POSTPONE message before
629 * the previous one expires.
630 */
631 VEHICLE_AP_POWER_SET_SHUTDOWN_POSTPONE = 0x4,
632 /**
633 * AP is starting shutting down. When system completes shutdown, everything will stop in AP
634 * as kernel will stop all other contexts. It is responsibility of vehicle HAL or lower level
635 * to synchronize that state with external power controller. As an example, some kind of ping
636 * with timeout in power controller can be a solution.
637 *
638 * int32_array[1]: Time to turn on AP in secs. Power controller may turn on AP after specified
639 * time so that AP can run tasks like update. If it is set to 0, there is no
640 * wake up, and power controller may not necessarily support wake-up.
641 * If power controller turns on AP due to timer, it should start with
642 * VEHICLE_AP_POWER_STATE_ON_DISP_OFF state, and after receiving
643 * VEHICLE_AP_POWER_SET_BOOT_COMPLETE, it shall do state transition to
644 * VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE.
645 */
646 VEHICLE_AP_POWER_SET_SHUTDOWN_START = 0x5,
647 /**
648 * User has requested to turn off headunit's display, which is detected in android side.
649 * The power controller may change the power state to VEHICLE_AP_POWER_STATE_ON_DISP_OFF.
650 */
651 VEHICLE_AP_POWER_SET_DISPLAY_OFF = 0x6,
652 /**
653 * User has requested to turn on headunit's display, most probably from power key input which
654 * is attached to headunit. The power controller may change the power state to
655 * VEHICLE_AP_POWER_STATE_ON_FULL.
656 */
657 VEHICLE_AP_POWER_SET_DISPLAY_ON = 0x7,
658};
659
660/**
661 * Property to represent brightness of the display. Some cars have single control for
662 * the brightness of all displays and this property is to share change in that control.
663 *
664 * If this is writable, android side can set this value when user changes display brightness
665 * from Settings. If this is read only, user may still change display brightness from Settings,
666 * but that will not be reflected to other displays.
667 *
668 * @value_type VEHICLE_VALUE_TYPE_INT32
669 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
670 * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_READ_WRITE
671 * @data_member int32
672 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700673#define VEHICLE_PROPERTY_DISPLAY_BRIGHTNESS (0x00000A01)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700674
675
676/**
677 * Index in int32_array for VEHICLE_PROPERTY_AP_POWER_STATE property.
678 */
679enum vehicle_ap_power_state_index {
680 VEHICLE_AP_POWER_STATE_INDEX_STATE = 0,
681 VEHICLE_AP_POWER_STATE_INDEX_ADDITIONAL = 1,
682};
683
684/**
685* Property to report bootup reason for the current power on. This is a static property that will
686* not change for the whole duration until power off. For example, even if user presses power on
687* button after automatic power on with door unlock, bootup reason should stay with
688* VEHICLE_AP_POWER_BOOTUP_REASON_USER_UNLOCK.
689*
690* int32_value should be vehicle_ap_power_bootup_reason.
691*
692* @value_type VEHICLE_VALUE_TYPE_INT32
693* @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
694* @access VEHICLE_PROP_ACCESS_READ
695* @data_member int32_value
696*/
697#define VEHICLE_PROPERTY_AP_POWER_BOOTUP_REASON (0x00000A02)
698
699/**
700 * Enum to represent bootup reason.
701 */
702enum vehicle_ap_power_bootup_reason {
703 /**
704 * Power on due to user's pressing of power key or rotating of ignition switch.
705 */
706 VEHICLE_AP_POWER_BOOTUP_REASON_USER_POWER_ON = 0,
707 /**
708 * Automatic power on triggered by door unlock or any other kind of automatic user detection.
709 */
710 VEHICLE_AP_POWER_BOOTUP_REASON_USER_UNLOCK = 1,
711 /**
712 * Automatic power on triggered by timer. This only happens when AP has asked wake-up after
713 * certain time through time specified in VEHICLE_AP_POWER_SET_SHUTDOWN_START.
714 */
715 VEHICLE_AP_POWER_BOOTUP_REASON_TIMER = 2,
716};
717
Keun-young Parkcb354502016-02-08 18:15:55 -0800718
719/**
720 * Property to feed H/W input events to android
721 *
722 * int32_array[0] : action defined by vehicle_hw_key_input_action
723 * int32_array[1] : key code, should use standard android key code
724 * int32_array[2] : target display defined in vehicle_display. Events not tied
725 * to specific display should be sent to DISPLAY_MAIN.
726 * int32_array[3] : reserved for now. should be zero
727 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
728 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
729 * @access VEHICLE_PROP_ACCESS_READ
730 * @config_flags
731 * @data_member int32_array
732 */
733#define VEHICLE_PROPERTY_HW_KEY_INPUT (0x00000A10)
734
735enum vehicle_hw_key_input_action {
736 /** Key down */
737 VEHICLE_HW_KEY_INPUT_ACTION_DOWN = 0,
738 /** Key up */
739 VEHICLE_HW_KEY_INPUT_ACTION_UP = 1,
740};
741
742enum vehicle_display {
743 /** center console */
744 VEHICLE_DISPLAY_MAIN = 0,
745 VEHICLE_DISPLAY_INSTRUMENT_CLUSTER = 1,
746};
747
Sanket Agarwalfb636682015-08-11 14:34:29 -0700748/**
Keun-young Parkfe599a82016-02-12 14:26:57 -0800749 * Property to define instrument cluster information.
750 * For CLUSTER_TYPE_EXTERNAL_DISPLAY:
751 * READ:
752 * int32_array[0] : The current screen mode index. Screen mode is defined
753 * as a configuration in car service and represents which
754 * area of screen is renderable.
755 * int32_array[1] : Android can render to instrument cluster (=1) or not(=0). When this is 0,
756 * instrument cluster may be rendering some information in the area
757 * allocated for android and android side rendering is invisible. *
758 * int32_array[2..3] : should be zero
759 * WRITE from android:
760 * int32_array[0] : Preferred mode for android side. Depending on the app rendering to instrument
761 * cluster, preferred mode can change. Instrument cluster still needs to send
762 * event with new mode to trigger actual mode change.
763 * int32_array[1] : The current app context relevant for instrument cluster. Use the same flag
764 * with vehicle_audio_context_flag but this context represents active apps, not
765 * active audio. Instrument cluster side may change mode depending on the
766 * currently active contexts.
767 * int32_array[2..3] : should be zero
768 * When system boots up, Android side will write {0, 0, 0, 0} when it is ready to render to
769 * instrument cluster. Before this message, rendering from android should not be visible in the
770 * cluster.
771 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
772 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
773 * @access VEHICLE_PROP_ACCESS_READ_WRITE
774 * @config_array 0:vehicle_instument_cluster_type 1:hw type
775 * @data_member int32_array
776 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700777#define VEHICLE_PROPERTY_INSTRUMENT_CLUSTER_INFO (0x00000A20)
Keun-young Parkfe599a82016-02-12 14:26:57 -0800778
779/**
780 * Represents instrument cluster type available in system
781 */
782enum vehicle_instument_cluster_type {
783 /** Android has no access to instument cluster */
784 VEHICLE_INSTRUMENT_CLUSTER_TYPE_NONE = 0,
785 /**
786 * Instrument cluster can communicate through vehicle hal with additional
787 * properties to exchange meta-data
788 */
789 VEHICLE_INSTRUMENT_CLUSTER_TYPE_HAL_INTERFACE = 1,
790 /**
791 * Instrument cluster is external display where android can render contents
792 */
793 VEHICLE_INSTRUMENT_CLUSTER_TYPE_EXTERNAL_DISPLAY = 2,
794};
795
Steve Paikd432fc02016-05-11 16:25:33 -0700796/**
797 * Current date and time, encoded as Unix time.
798 * This value denotes the number of seconds that have elapsed since 1/1/1970.
799 *
800 * @value_type VEHICLE_VALUE_TYPE_INT64
Keun-young Parkda3cb912016-05-12 11:21:04 -0700801 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_SET
Steve Paikd432fc02016-05-11 16:25:33 -0700802 * @access VEHICLE_PROP_ACCESS_READ_WRITE
803 * @data_member int64_value
804 * @unit VEHICLE_UNIT_TYPE_SECS
805 */
806#define VEHICLE_PROPERTY_UNIX_TIME (0x00000A30)
807
808/**
809 * Current time only.
810 * Some vehicles may not keep track of date. This property only affects the current time, in
811 * seconds during the day. Thus, the max value for this parameter is 86,400 (24 * 60 * 60)
812 *
813 * @value_type VEHICLE_VALUE_TYPE_INT32
Keun-young Parkda3cb912016-05-12 11:21:04 -0700814 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_SET
Steve Paikd432fc02016-05-11 16:25:33 -0700815 * @access VEHICLE_PROP_ACCESS_READ_WRITE
816 * @data_member int32_value
817 * @unit VEHICLE_UNIT_TYPE_SECS
818 */
819#define VEHICLE_PROPERTY_CURRENT_TIME_IN_SECONDS (0x00000A31)
Steve Paikcc9e2922016-04-21 11:40:17 -0700820
Steve Paike588bae2016-06-29 17:06:16 -0700821
822//==== Car Cabin Properties ====
Steve Paikcc9e2922016-04-21 11:40:17 -0700823/**
Steve Paike588bae2016-06-29 17:06:16 -0700824 * Most Car Cabin properties have both a MOVE and POSITION parameter associated with them.
Steve Paikcc9e2922016-04-21 11:40:17 -0700825 *
Steve Paike588bae2016-06-29 17:06:16 -0700826 * The MOVE parameter will start moving the device in the indicated direction. The magnitude
827 * indicates the relative speed. For instance, setting the WINDOW_MOVE parameter to +1 will roll
828 * the window up. Setting it to +2 (if available) will roll it up faster.
Steve Paikcc9e2922016-04-21 11:40:17 -0700829 *
Steve Paike588bae2016-06-29 17:06:16 -0700830 * The POSITION parameter will move the device to the desired position. For instance, if the
831 * WINDOW_POS has a range of 0-100, then setting this parameter to 50 will open the window halfway.
832 * Depending upon the initial position, the window may move up or down to the 50% value.
Steve Paikcc9e2922016-04-21 11:40:17 -0700833 *
Steve Paike588bae2016-06-29 17:06:16 -0700834 * OEMs may choose to implement one or both of the MOVE/POSITION parameters depending upon the
835 * capability of the hardware.
836 */
837
838// Doors
839/**
840 * Door position
841 *
842 * This is an integer in case a door may be set to a particular position. Max
843 * value indicates fully open, min value (0) indicates fully closed.
844 *
845 * Some vehicles (minivans) can open the door electronically. Hence, the ability
846 * to write this property.
847 *
Steve Paikada16692016-07-07 17:08:39 -0700848 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paikcc9e2922016-04-21 11:40:17 -0700849 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
Steve Paike588bae2016-06-29 17:06:16 -0700850 * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700851 * @zone_type VEHICLE_ZONE_TYPE_DOOR
Steve Paikd432fc02016-05-11 16:25:33 -0700852 * @data_member int32_value
Steve Paikcc9e2922016-04-21 11:40:17 -0700853 */
Steve Paike588bae2016-06-29 17:06:16 -0700854#define VEHICLE_PROPERTY_DOOR_POS (0x00000B00)
Steve Paikcc9e2922016-04-21 11:40:17 -0700855
856/**
Steve Paike588bae2016-06-29 17:06:16 -0700857 * Door move
858 *
Steve Paikada16692016-07-07 17:08:39 -0700859 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -0700860 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
861 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700862 * @zone_type VEHICLE_ZONE_TYPE_DOOR
Steve Paike588bae2016-06-29 17:06:16 -0700863 * @data_member int32_value
864 */
865#define VEHICLE_PROPERTY_DOOR_MOVE (0x00000B01)
866
867
868/**
869 * Door lock
870 *
871 * 'true' indicates door is locked
872 *
Steve Paikada16692016-07-07 17:08:39 -0700873 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -0700874 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
875 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700876 * @zone_type VEHICLE_ZONE_TYPE_DOOR
Steve Paike588bae2016-06-29 17:06:16 -0700877 * @data_member boolean_value
878 */
879#define VEHICLE_PROPERTY_DOOR_LOCK (0x00000B02)
880
881// Mirrors
882/**
883 * Mirror Z Position
884 *
885 * Positive value indicates tilt upwards, negative value is downwards
886 *
Steve Paikada16692016-07-07 17:08:39 -0700887 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -0700888 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
889 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700890 * @zone_type VEHICLE_ZONE_TYPE_MIRROR
Steve Paike588bae2016-06-29 17:06:16 -0700891 * @data_member int32_value
892 */
893#define VEHICLE_PROPERTY_MIRROR_Z_POS (0x00000B40)
894
895/**
896 * Mirror Z Move
897 *
898 * Positive value indicates tilt upwards, negative value is downwards
899 *
Steve Paikada16692016-07-07 17:08:39 -0700900 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -0700901 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
902 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700903 * @zone_type VEHICLE_ZONE_TYPE_MIRROR
Steve Paike588bae2016-06-29 17:06:16 -0700904 * @data_member int32_value
905 */
906#define VEHICLE_PROPERTY_MIRROR_Z_MOVE (0x00000B41)
907
908/**
909 * Mirror Y Position
910 *
911 * Positive value indicate tilt right, negative value is left
912 *
Steve Paikada16692016-07-07 17:08:39 -0700913 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -0700914 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
915 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700916 * @zone_type VEHICLE_ZONE_TYPE_MIRROR
Steve Paike588bae2016-06-29 17:06:16 -0700917 * @data_member int32_value
918 */
919#define VEHICLE_PROPERTY_MIRROR_Y_POS (0x00000B42)
920
921/**
922 * Mirror Y Move
923 *
924 * Positive value indicate tilt right, negative value is left
925 *
Steve Paikada16692016-07-07 17:08:39 -0700926 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -0700927 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
928 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700929 * @zone_type VEHICLE_ZONE_TYPE_MIRROR
Steve Paike588bae2016-06-29 17:06:16 -0700930 * @data_member int32_value
931 */
932#define VEHICLE_PROPERTY_MIRROR_Y_MOVE (0x00000B43)
933
934/**
935 * Mirror Lock
936 *
937 * True indicates mirror positions are locked and not changeable
938 *
Steve Paikada16692016-07-07 17:08:39 -0700939 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -0700940 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
941 * @access VEHICLE_PROP_ACCESS_READ_WRITE
942 * @data_member boolean_value
943 */
944#define VEHICLE_PROPERTY_MIRROR_LOCK (0x00000B44)
945
946/**
Steve Paike588bae2016-06-29 17:06:16 -0700947 * Mirror Fold
948 *
949 * True indicates mirrors are folded
950 *
Steve Paikada16692016-07-07 17:08:39 -0700951 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -0700952 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
953 * @access VEHICLE_PROP_ACCESS_READ_WRITE
954 * @data_member boolean_value
955 */
Steve Paikbfbbb672016-07-08 16:12:38 -0700956#define VEHICLE_PROPERTY_MIRROR_FOLD (0x00000B45)
Steve Paike588bae2016-06-29 17:06:16 -0700957
958// Seats
959/**
960 * Seat memory select
Steve Paikcc9e2922016-04-21 11:40:17 -0700961 *
962 * This parameter selects the memory preset to use to select the seat position.
963 * The minValue is always 0, and the maxValue determines the number of seat
964 * positions available.
965 *
966 * For instance, if the driver's seat has 3 memory presets, the maxValue will be 3.
967 * When the user wants to select a preset, the desired preset number (1, 2, or 3)
968 * is set.
969 *
Keun-young Park7cb258e2016-04-25 18:37:28 -0700970 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paikcc9e2922016-04-21 11:40:17 -0700971 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
972 * @access VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700973 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paikd432fc02016-05-11 16:25:33 -0700974 * @data_member int32_value
Steve Paikcc9e2922016-04-21 11:40:17 -0700975 */
Steve Paike588bae2016-06-29 17:06:16 -0700976#define VEHICLE_PROPERTY_SEAT_MEMORY_SELECT (0x00000B80)
Steve Paikcc9e2922016-04-21 11:40:17 -0700977
978/**
979 * Seat memory set
980 *
981 * This setting allows the user to save the current seat position settings into
982 * the selected preset slot. The maxValue for each seat position shall match
983 * the maxValue for VEHICLE_PROPERTY_SEAT_MEMORY_SELECT.
984 *
Keun-young Park7cb258e2016-04-25 18:37:28 -0700985 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paikcc9e2922016-04-21 11:40:17 -0700986 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
987 * @access VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -0700988 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paikd432fc02016-05-11 16:25:33 -0700989 * @data_member int32_value
Steve Paikcc9e2922016-04-21 11:40:17 -0700990 */
Steve Paike588bae2016-06-29 17:06:16 -0700991#define VEHICLE_PROPERTY_SEAT_MEMORY_SET (0x00000B81)
992
993/**
994 * Seatbelt buckled
995 *
996 * True indicates belt is buckled.
997 *
998 * Write access indicates automatic seat buckling capabilities. There are no known cars at this
999 * time, but you never know...
1000 *
1001 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
1002 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1003 * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001004 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001005 * @data_member boolean_value
1006 */
1007#define VEHICLE_PROPERTY_SEAT_BELT_BUCKLED (0x00000B82)
1008
1009/**
1010 * Seatbelt height position
1011 *
1012 * Adjusts the shoulder belt anchor point.
1013 * Max value indicates highest position
1014 * Min value indicates lowest position
1015 *
1016 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1017 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1018 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001019 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001020 * @data_member int32_value
1021 */
1022#define VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_POS (0x00000B83)
1023
1024/**
1025 * Seatbelt height move
1026 *
1027 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1028 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1029 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001030 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001031 * @data_member int32_value
1032 */
1033#define VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_MOVE (0x00000B84)
1034
1035/**
1036 * Seat fore/aft position
1037 *
1038 * Sets the seat position forward (closer to steering wheel) and backwards.
1039 * Max value indicates closest to wheel, min value indicates most rearward
1040 * position.
1041 *
1042 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1043 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1044 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001045 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001046 * @data_member int32_value
1047 */
1048#define VEHICLE_PROPERTY_SEAT_FORE_AFT_POS (0x00000B85)
1049
1050/**
1051 * Seat fore/aft move
1052 *
1053 * Moves the seat position forward and aft.
1054 *
1055 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1056 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1057 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001058 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001059 * @data_member int32_value
1060 */
1061#define VEHICLE_PROPERTY_SEAT_FORE_AFT_MOVE (0x00000B86)
1062
1063/**
1064 * Seat backrest angle 1 position
1065 *
1066 * Backrest angle 1 is the actuator closest to the bottom of the seat.
1067 * Max value indicates angling forward towards the steering wheel.
1068 * Min value indicates full recline.
1069 *
1070 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1071 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1072 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001073 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001074 * @data_member int32_value
1075 */
1076#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_POS (0x00000B87)
1077
1078/**
1079 * Seat backrest angle 1 move
1080 *
1081 * Moves the backrest forward or recline.
1082 *
1083 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1084 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1085 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001086 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001087 * @data_member int32_value
1088 */
1089#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_MOVE (0x00000B88)
1090
1091/**
1092 * Seat backrest angle 2 position
1093 *
1094 * Backrest angle 2 is the next actuator up from the bottom of the seat.
1095 * Max value indicates angling forward towards the steering wheel.
1096 * Min value indicates full recline.
1097 *
1098 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1099 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1100 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001101 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001102 * @data_member int32_value
1103 */
1104#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_POS (0x00000B89)
1105
1106/**
1107 * Seat backrest angle 2 move
1108 *
1109 * Moves the backrest forward or recline.
1110 *
1111 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1112 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1113 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001114 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001115 * @data_member int32_value
1116 */
1117#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_MOVE (0x00000B8A)
1118
1119/**
1120 * Seat height position
1121 *
1122 * Sets the seat height.
1123 * Max value indicates highest position.
1124 * Min value indicates lowest position.
1125 *
1126 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1127 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1128 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001129 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001130 * @data_member int32_value
1131 */
1132#define VEHICLE_PROPERTY_SEAT_HEIGHT_POS (0x00000B8B)
1133
1134/**
1135 * Seat height move
1136 *
1137 * Moves the seat height.
1138 *
1139 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1140 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1141 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001142 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001143 * @data_member int32_value
1144 */
1145#define VEHICLE_PROPERTY_SEAT_HEIGHT_MOVE (0x00000B8C)
1146
1147/**
1148 * Seat depth position
1149 *
1150 * Sets the seat depth, distance from back rest to front edge of seat.
1151 * Max value indicates longest depth position.
1152 * Min value indicates shortest position.
1153 *
1154 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1155 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1156 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001157 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001158 * @data_member int32_value
1159 */
1160#define VEHICLE_PROPERTY_SEAT_DEPTH_POS (0x00000B8D)
1161
1162/**
1163 * Seat depth move
1164 *
1165 * Adjusts the seat depth.
1166 *
1167 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1168 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1169 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001170 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001171 * @data_member int32_value
1172 */
1173#define VEHICLE_PROPERTY_SEAT_DEPTH_MOVE (0x00000B8E)
1174
1175/**
1176 * Seat tilt position
1177 *
1178 * Sets the seat tilt.
1179 * Max value indicates front edge of seat higher than back edge.
1180 * Min value indicates front edge of seat lower than back edge.
1181 *
1182 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1183 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1184 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001185 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001186 * @data_member int32_value
1187 */
1188#define VEHICLE_PROPERTY_SEAT_TILT_POS (0x00000B8F)
1189
1190/**
1191 * Seat tilt move
1192 *
1193 * Tilts the seat.
1194 *
1195 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1196 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1197 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001198 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001199 * @data_member int32_value
1200 */
1201#define VEHICLE_PROPERTY_SEAT_TILT_MOVE (0x00000B90)
1202
1203/**
1204 * Lumber fore/aft position
1205 *
1206 * Pushes the lumbar support forward and backwards
1207 * Max value indicates most forward position.
1208 * Min value indicates most rearward position.
1209 *
1210 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1211 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1212 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001213 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001214 * @data_member int32_value
1215 */
1216#define VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_POS (0x00000B91)
1217
1218/**
1219 * Lumbar fore/aft move
1220 *
1221 * Adjusts the lumbar support.
1222 *
1223 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1224 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1225 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001226 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001227 * @data_member int32_value
1228 */
1229#define VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_MOVE (0x00000B92)
1230
1231/**
1232 * Lumbar side support position
1233 *
1234 * Sets the amount of lateral lumbar support.
1235 * Max value indicates widest lumbar setting (i.e. least support)
1236 * Min value indicates thinnest lumbar setting.
1237 *
1238 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1239 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1240 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001241 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001242 * @data_member int32_value
1243 */
1244#define VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_POS (0x00000B93)
1245
1246/**
1247 * Lumbar side support move
1248 *
1249 * Adjusts the amount of lateral lumbar support.
1250 *
1251 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1252 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1253 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001254 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001255 * @data_member int32_value
1256 */
1257#define VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_MOVE (0x00000B94)
1258
1259/**
1260 * Headrest height position
1261 *
1262 * Sets the headrest height.
1263 * Max value indicates tallest setting.
1264 * Min value indicates shortest setting.
1265 *
1266 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1267 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1268 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001269 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001270 * @data_member int32_value
1271 */
1272#define VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_POS (0x00000B95)
1273
1274/**
Steve Paik5052d312016-07-14 16:05:19 -07001275 * Headrest height move
Steve Paike588bae2016-06-29 17:06:16 -07001276 *
1277 * Moves the headrest up and down.
1278 *
1279 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1280 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1281 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001282 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001283 * @data_member int32_value
1284 */
1285#define VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_MOVE (0x00000B96)
1286
1287/**
1288 * Headrest angle position
1289 *
1290 * Sets the angle of the headrest.
1291 * Max value indicates most upright angle.
1292 * Min value indicates shallowest headrest angle.
1293 *
1294 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1295 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1296 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001297 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001298 * @data_member int32_value
1299 */
1300#define VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_POS (0x00000B97)
1301
1302/**
1303 * Headrest angle move
1304 *
1305 * Adjusts the angle of the headrest
1306 *
1307 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1308 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1309 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001310 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001311 * @data_member int32_value
1312 */
1313#define VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_MOVE (0x00000B98)
1314
1315/**
Steve Paik5052d312016-07-14 16:05:19 -07001316 * Headrest fore/aft position
1317 *
1318 * Adjusts the headrest forwards and backwards.
1319 * Max value indicates position closest to front of car.
1320 * Min value indicates position closest to rear of car.
Steve Paike588bae2016-06-29 17:06:16 -07001321 *
1322 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1323 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1324 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001325 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001326 * @data_member int32_value
1327 */
1328#define VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_POS (0x00000B99)
1329
1330/**
Steve Paik5052d312016-07-14 16:05:19 -07001331 * Headrest fore/aft move
Steve Paike588bae2016-06-29 17:06:16 -07001332 *
1333 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1334 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1335 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001336 * @zone_type VEHICLE_ZONE_TYPE_SEAT
Steve Paike588bae2016-06-29 17:06:16 -07001337 * @data_member int32_value
1338 */
1339#define VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_MOVE (0x00000B9A)
1340
1341
1342// Windows
1343/**
1344 * Window Position
1345 *
1346 * Max = window up / closed
1347 * Min = window down / open
1348 *
Steve Paikada16692016-07-07 17:08:39 -07001349 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001350 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1351 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1352 * @data_member int32_value
1353 */
1354#define VEHICLE_PROPERTY_WINDOW_POS (0x00000BC0)
1355
1356/**
1357 * Window Move
1358 *
1359 * Max = window up / closed
1360 * Min = window down / open
1361 * Magnitude denotes relative speed. I.e. +2 is faster than +1 in raising the window.
1362 *
Steve Paikada16692016-07-07 17:08:39 -07001363 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001364 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1365 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1366 * @data_member int32_value
1367 */
1368#define VEHICLE_PROPERTY_WINDOW_MOVE (0x00000BC1)
1369
1370/**
1371 * Window Vent Position
1372 *
1373 * This feature is used to control the vent feature on a sunroof.
1374 *
1375 * Max = vent open
1376 * Min = vent closed
1377 *
Steve Paikada16692016-07-07 17:08:39 -07001378 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001379 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1380 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1381 * @data_member int32_value
1382 */
1383#define VEHICLE_PROPERTY_WINDOW_VENT_POS (0x00000BC2)
1384
1385/**
1386 * Window Vent Move
1387 *
1388 * This feature is used to control the vent feature on a sunroof.
1389 *
1390 * Max = vent open
1391 * Min = vent closed
1392 *
Steve Paikada16692016-07-07 17:08:39 -07001393 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001394 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1395 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1396 * @data_member int32_value
1397 */
1398#define VEHICLE_PROPERTY_WINDOW_VENT_MOVE (0x00000BC3)
1399
1400/**
1401 * Window Lock
1402 *
1403 * True indicates windows are locked and can't be moved.
1404 *
Steve Paikada16692016-07-07 17:08:39 -07001405 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -07001406 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1407 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1408 * @data_member boolean_value
1409 */
1410#define VEHICLE_PROPERTY_WINDOW_LOCK (0x00000BC4)
1411
1412
Steve Paikcc9e2922016-04-21 11:40:17 -07001413
Keun-young Parkfe599a82016-02-12 14:26:57 -08001414/**
Sanket Agarwalfb636682015-08-11 14:34:29 -07001415 * H/W specific, non-standard property can be added as necessary. Such property should use
1416 * property number in range of [VEHICLE_PROPERTY_CUSTOM_START, VEHICLE_PROPERTY_CUSTOM_END].
1417 * Definition of property in this range is completely up to each HAL implementation.
1418 * For such property, it is recommended to fill vehicle_prop_config.config_string with some
1419 * additional information to help debugging. For example, company XYZ's custom extension may
1420 * include config_string of "com.XYZ.some_further_details".
1421 * @range_start
1422 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001423#define VEHICLE_PROPERTY_CUSTOM_START (0x70000000)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001424/** @range_end */
Steve Paikcc9e2922016-04-21 11:40:17 -07001425#define VEHICLE_PROPERTY_CUSTOM_END (0x73ffffff)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001426
1427/**
1428 * Property range allocated for system's internal usage like testing. HAL should never declare
1429 * property in this range.
1430 * @range_start
1431 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001432#define VEHICLE_PROPERTY_INTERNAL_START (0x74000000)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001433/**
1434 * @range_end
1435 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001436#define VEHICLE_PROPERTY_INTERNAL_END (0x74ffffff)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001437
1438/**
1439 * Value types for various properties.
1440 */
1441enum vehicle_value_type {
1442 VEHICLE_VALUE_TYPE_SHOUD_NOT_USE = 0x00, // value_type should never set to 0.
1443 VEHICLE_VALUE_TYPE_STRING = 0x01,
1444 VEHICLE_VALUE_TYPE_BYTES = 0x02,
1445 VEHICLE_VALUE_TYPE_BOOLEAN = 0x03,
Keun-young Park73d7f222016-01-14 11:02:38 -08001446 VEHICLE_VALUE_TYPE_ZONED_BOOLEAN = 0x04,
1447 VEHICLE_VALUE_TYPE_INT64 = 0x05,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001448 VEHICLE_VALUE_TYPE_FLOAT = 0x10,
1449 VEHICLE_VALUE_TYPE_FLOAT_VEC2 = 0x11,
1450 VEHICLE_VALUE_TYPE_FLOAT_VEC3 = 0x12,
1451 VEHICLE_VALUE_TYPE_FLOAT_VEC4 = 0x13,
1452 VEHICLE_VALUE_TYPE_INT32 = 0x20,
1453 VEHICLE_VALUE_TYPE_INT32_VEC2 = 0x21,
1454 VEHICLE_VALUE_TYPE_INT32_VEC3 = 0x22,
1455 VEHICLE_VALUE_TYPE_INT32_VEC4 = 0x23,
Keun-young Park73d7f222016-01-14 11:02:38 -08001456 VEHICLE_VALUE_TYPE_ZONED_FLOAT = 0x30,
1457 VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2 = 0x31,
1458 VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3 = 0x32,
Keun-young Parkab68e372016-03-10 16:28:42 -08001459 VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4 = 0x33,
Keun-young Park73d7f222016-01-14 11:02:38 -08001460 VEHICLE_VALUE_TYPE_ZONED_INT32 = 0x40,
1461 VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2 = 0x41,
1462 VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3 = 0x42,
Keun-young Parkab68e372016-03-10 16:28:42 -08001463 VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4 = 0x43,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001464};
1465
1466/**
1467 * Units used for int or float type with no attached enum types.
1468 */
1469enum vehicle_unit_type {
1470 VEHICLE_UNIT_TYPE_SHOULD_NOT_USE = 0x00000000,
1471 // speed related items
1472 VEHICLE_UNIT_TYPE_METER_PER_SEC = 0x00000001,
1473 VEHICLE_UNIT_TYPE_RPM = 0x00000002,
1474 VEHICLE_UNIT_TYPE_HZ = 0x00000003,
1475 // kind of ratio
1476 VEHICLE_UNIT_TYPE_PERCENTILE = 0x00000010,
1477 // length
1478 VEHICLE_UNIT_TYPE_MILLIMETER = 0x00000020,
1479 VEHICLE_UNIT_TYPE_METER = 0x00000021,
1480 VEHICLE_UNIT_TYPE_KILOMETER = 0x00000023,
1481 // temperature
Steve Paikbfbbb672016-07-08 16:12:38 -07001482 VEHICLE_UNIT_TYPE_CELSIUS = 0x00000030,
1483 VEHICLE_UNIT_TYPE_FAHRENHEIT = 0x00000031,
1484 VEHICLE_UNIT_TYPE_KELVIN = 0x00000032,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001485 // volume
1486 VEHICLE_UNIT_TYPE_MILLILITER = 0x00000040,
1487 // time
1488 VEHICLE_UNIT_TYPE_NANO_SECS = 0x00000050,
Steve Paikd432fc02016-05-11 16:25:33 -07001489 VEHICLE_UNIT_TYPE_SECS = 0x00000053,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001490 VEHICLE_UNIT_TYPE_YEAR = 0x00000059,
1491};
1492
1493/**
Sanket Agarwalfb636682015-08-11 14:34:29 -07001494 * This describes how value of property can change.
1495 */
1496enum vehicle_prop_change_mode {
1497 /**
1498 * Property of this type will *never* change. This property will not support subscription, but
1499 * will support get
1500 */
1501 VEHICLE_PROP_CHANGE_MODE_STATIC = 0x00,
1502 /**
Keun-young Parkda3cb912016-05-12 11:21:04 -07001503 * Property of this type will be reported when there is a change.
1504 * get call should return the current value.
1505 * Set operation for this property is assumed to be asynchronous. When the property is read
Keun-young Parke086bd72016-05-24 09:41:54 -07001506 * (get) after set, it may still return old value until underlying H/W backing this property
Keun-young Parkda3cb912016-05-12 11:21:04 -07001507 * has actually changed the state. Once state is changed, the property will dispatch changed
1508 * value as event.
Sanket Agarwalfb636682015-08-11 14:34:29 -07001509 */
1510 VEHICLE_PROP_CHANGE_MODE_ON_CHANGE = 0x01,
1511 /**
1512 * Property of this type change continuously and requires fixed rate of sampling to retrieve
1513 * the data.
1514 */
1515 VEHICLE_PROP_CHANGE_MODE_CONTINUOUS = 0x02,
Steve Paikd432fc02016-05-11 16:25:33 -07001516 /**
1517 * Property of this type may be polled to get the current value.
1518 */
1519 VEHICLE_PROP_CHANGE_MODE_POLL = 0x03,
Keun-young Parkda3cb912016-05-12 11:21:04 -07001520 /**
1521 * This is for property where change event should be sent only when the value is
1522 * set from external component. Normal value change will not trigger event.
1523 * For example, clock property can send change event only when it is set, outside android,
1524 * for case like user setting time or time getting update. There is no need to send it
1525 * per every value change.
1526 */
1527 VEHICLE_PROP_CHANGE_MODE_ON_SET = 0x04,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001528};
1529
1530/**
1531 * Property config defines the capabilities of it. User of the API
1532 * should first get the property config to understand the output from get()
1533 * commands and also to ensure that set() or events commands are in sync with
1534 * the expected output.
1535 */
1536enum vehicle_prop_access {
1537 VEHICLE_PROP_ACCESS_READ = 0x01,
1538 VEHICLE_PROP_ACCESS_WRITE = 0x02,
1539 VEHICLE_PROP_ACCESS_READ_WRITE = 0x03
1540};
1541
1542/**
1543 * These permissions define how the OEMs want to distribute their information and security they
1544 * want to apply. On top of these restrictions, android will have additional
1545 * 'app-level' permissions that the apps will need to ask the user before the apps have the
1546 * information.
1547 * This information should be kept in vehicle_prop_config.permission_model.
1548 */
1549enum vehicle_permission_model {
1550 /**
1551 * No special restriction, but each property can still require specific android app-level
1552 * permission.
1553 */
1554 VEHICLE_PERMISSION_NO_RESTRICTION = 0,
1555 /** Signature only. Only APKs signed with OEM keys are allowed. */
1556 VEHICLE_PERMISSION_OEM_ONLY = 0x1,
1557 /** System only. APKs built-in to system can access the property. */
1558 VEHICLE_PERMISSION_SYSTEM_APP_ONLY = 0x2,
1559 /** Equivalent to “system|signature” */
1560 VEHICLE_PERMISSION_OEM_OR_SYSTEM_APP = 0x3
1561};
1562
Keun-young Park418c7e82016-04-06 10:44:20 -07001563
1564/**
1565 * Special values for INT32/FLOAT (including ZONED types)
1566 * These values represent special state, which is outside MIN/MAX range but can happen.
1567 * For example, HVAC temperature may use out of range min / max to represent that
1568 * it is working in full power although target temperature has separate min / max.
1569 * OUT_OF_RANGE_OFF can represent a state where the property is powered off.
1570 * Usually such property will have separate property to control power.
1571 */
1572
1573#define VEHICLE_INT_OUT_OF_RANGE_MAX (INT32_MAX)
1574#define VEHICLE_INT_OUT_OF_RANGE_MIN (INT32_MIN)
1575#define VEHICLE_INT_OUT_OF_RANGE_OFF (INT32_MIN + 1)
1576
1577#define VEHICLE_FLOAT_OUT_OF_RANGE_MAX (INFINITY)
1578#define VEHICLE_FLOAT_OUT_OF_RANGE_MIN (-INFINITY)
Keun-young Parkf1ccec12016-04-22 13:19:53 -07001579#define VEHICLE_FLOAT_OUT_OF_RANGE_OFF (NAN)
Keun-young Park418c7e82016-04-06 10:44:20 -07001580
Sanket Agarwalfb636682015-08-11 14:34:29 -07001581/**
1582 * Car states.
1583 *
1584 * The driving states determine what features of the UI will be accessible.
1585 */
1586enum vehicle_driving_status {
1587 VEHICLE_DRIVING_STATUS_UNRESTRICTED = 0x00,
1588 VEHICLE_DRIVING_STATUS_NO_VIDEO = 0x01,
1589 VEHICLE_DRIVING_STATUS_NO_KEYBOARD_INPUT = 0x02,
1590 VEHICLE_DRIVING_STATUS_NO_VOICE_INPUT = 0x04,
1591 VEHICLE_DRIVING_STATUS_NO_CONFIG = 0x08,
1592 VEHICLE_DRIVING_STATUS_LIMIT_MESSAGE_LEN = 0x10
1593};
1594
1595/**
1596 * Various gears which can be selected by user and chosen in system.
1597 */
1598enum vehicle_gear {
1599 // Gear selections present in both automatic and manual cars.
1600 VEHICLE_GEAR_NEUTRAL = 0x0001,
1601 VEHICLE_GEAR_REVERSE = 0x0002,
1602
1603 // Gear selections (mostly) present only in automatic cars.
Keun-young Park77761e22016-03-08 15:02:44 -08001604 VEHICLE_GEAR_PARK = 0x0004,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001605 VEHICLE_GEAR_DRIVE = 0x0008,
Keun-young Park77761e22016-03-08 15:02:44 -08001606 VEHICLE_GEAR_LOW = 0x0010,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001607
1608 // Other possible gear selections (maybe present in manual or automatic
1609 // cars).
1610 VEHICLE_GEAR_1 = 0x0010,
1611 VEHICLE_GEAR_2 = 0x0020,
1612 VEHICLE_GEAR_3 = 0x0040,
1613 VEHICLE_GEAR_4 = 0x0080,
1614 VEHICLE_GEAR_5 = 0x0100,
1615 VEHICLE_GEAR_6 = 0x0200,
1616 VEHICLE_GEAR_7 = 0x0400,
1617 VEHICLE_GEAR_8 = 0x0800,
1618 VEHICLE_GEAR_9 = 0x1000
1619};
1620
1621
1622/**
1623 * Various zones in the car.
1624 *
1625 * Zones are used for Air Conditioning purposes and divide the car into physical
1626 * area zones.
1627 */
1628enum vehicle_zone {
1629 VEHICLE_ZONE_ROW_1_LEFT = 0x00000001,
1630 VEHICLE_ZONE_ROW_1_CENTER = 0x00000002,
1631 VEHICLE_ZONE_ROW_1_RIGHT = 0x00000004,
1632 VEHICLE_ZONE_ROW_1_ALL = 0x00000008,
1633 VEHICLE_ZONE_ROW_2_LEFT = 0x00000010,
1634 VEHICLE_ZONE_ROW_2_CENTER = 0x00000020,
1635 VEHICLE_ZONE_ROW_2_RIGHT = 0x00000040,
1636 VEHICLE_ZONE_ROW_2_ALL = 0x00000080,
1637 VEHICLE_ZONE_ROW_3_LEFT = 0x00000100,
1638 VEHICLE_ZONE_ROW_3_CENTER = 0x00000200,
1639 VEHICLE_ZONE_ROW_3_RIGHT = 0x00000400,
1640 VEHICLE_ZONE_ROW_3_ALL = 0x00000800,
1641 VEHICLE_ZONE_ROW_4_LEFT = 0x00001000,
1642 VEHICLE_ZONE_ROW_4_CENTER = 0x00002000,
1643 VEHICLE_ZONE_ROW_4_RIGHT = 0x00004000,
1644 VEHICLE_ZONE_ROW_4_ALL = 0x00008000,
1645 VEHICLE_ZONE_ALL = 0x80000000,
1646};
1647
1648/**
1649 * Various Seats in the car.
1650 */
1651enum vehicle_seat {
Steve Paik76c9c0f2016-10-06 20:26:03 -07001652 VEHICLE_SEAT_ROW_1_LEFT = 0x0001,
1653 VEHICLE_SEAT_ROW_1_CENTER = 0x0002,
1654 VEHICLE_SEAT_ROW_1_RIGHT = 0x0004,
1655 VEHICLE_SEAT_ROW_2_LEFT = 0x0010,
1656 VEHICLE_SEAT_ROW_2_CENTER = 0x0020,
1657 VEHICLE_SEAT_ROW_2_RIGHT = 0x0040,
1658 VEHICLE_SEAT_ROW_3_LEFT = 0x0100,
1659 VEHICLE_SEAT_ROW_3_CENTER = 0x0200,
1660 VEHICLE_SEAT_ROW_3_RIGHT = 0x0400
Sanket Agarwalfb636682015-08-11 14:34:29 -07001661};
1662
1663/**
1664 * Various windshields/windows in the car.
1665 */
1666enum vehicle_window {
1667 VEHICLE_WINDOW_FRONT_WINDSHIELD = 0x0001,
1668 VEHICLE_WINDOW_REAR_WINDSHIELD = 0x0002,
1669 VEHICLE_WINDOW_ROOF_TOP = 0x0004,
1670 VEHICLE_WINDOW_ROW_1_LEFT = 0x0010,
1671 VEHICLE_WINDOW_ROW_1_RIGHT = 0x0020,
1672 VEHICLE_WINDOW_ROW_2_LEFT = 0x0100,
1673 VEHICLE_WINDOW_ROW_2_RIGHT = 0x0200,
1674 VEHICLE_WINDOW_ROW_3_LEFT = 0x1000,
1675 VEHICLE_WINDOW_ROW_3_RIGHT = 0x2000,
1676};
1677
Keun-young Parkcb354502016-02-08 18:15:55 -08001678enum vehicle_door {
1679 VEHICLE_DOOR_ROW_1_LEFT = 0x00000001,
1680 VEHICLE_DOOR_ROW_1_RIGHT = 0x00000004,
1681 VEHICLE_DOOR_ROW_2_LEFT = 0x00000010,
1682 VEHICLE_DOOR_ROW_2_RIGHT = 0x00000040,
1683 VEHICLE_DOOR_ROW_3_LEFT = 0x00000100,
1684 VEHICLE_DOOR_ROW_3_RIGHT = 0x00000400,
1685 VEHICLE_DOOR_HOOD = 0x10000000,
1686 VEHICLE_DOOR_REAR = 0x20000000,
1687};
1688
1689enum vehicle_mirror {
1690 VEHICLE_MIRROR_DRIVER_LEFT = 0x00000001,
1691 VEHICLE_MIRROR_DRIVER_RIGHT = 0x00000002,
1692 VEHICLE_MIRROR_DRIVER_CENTER = 0x00000004,
1693};
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001694
Sanket Agarwalfb636682015-08-11 14:34:29 -07001695enum vehicle_turn_signal {
1696 VEHICLE_SIGNAL_NONE = 0x00,
1697 VEHICLE_SIGNAL_RIGHT = 0x01,
1698 VEHICLE_SIGNAL_LEFT = 0x02,
1699 VEHICLE_SIGNAL_EMERGENCY = 0x04
1700};
1701
Vitalii Tomkiv0ca8f0e2016-10-11 11:01:20 -07001702enum vehicle_zone_type {
1703 VEHICLE_ZONE_TYPE_NONE = 0x00,
1704 VEHICLE_ZONE_TYPE_ZONE = 0x01,
1705 VEHICLE_ZONE_TYPE_SEAT = 0x02,
1706 VEHICLE_ZONE_TYPE_DOOR = 0x04,
1707 VEHICLE_ZONE_TYPE_WINDOW = 0x10,
1708 VEHICLE_ZONE_TYPE_MIRROR = 0x20,
1709};
1710
Sanket Agarwalfb636682015-08-11 14:34:29 -07001711/*
1712 * Boolean type.
1713 */
1714enum vehicle_boolean {
1715 VEHICLE_FALSE = 0x00,
1716 VEHICLE_TRUE = 0x01
1717};
1718
1719typedef int32_t vehicle_boolean_t;
1720
1721/**
1722 * Vehicle string.
1723 *
1724 * Defines a UTF8 encoded sequence of bytes that should be used for string
1725 * representation throughout.
1726 */
1727typedef struct vehicle_str {
1728 uint8_t* data;
1729 int32_t len;
1730} vehicle_str_t;
1731
1732/**
1733 * Vehicle byte array.
1734 * This is for passing generic raw data.
1735 */
1736typedef vehicle_str_t vehicle_bytes_t;
1737
Sanket Agarwalfb636682015-08-11 14:34:29 -07001738typedef struct vehicle_prop_config {
1739 int32_t prop;
1740
1741 /**
1742 * Defines if the property is read or write. Value should be one of
1743 * enum vehicle_prop_access.
1744 */
1745 int32_t access;
1746
1747 /**
1748 * Defines if the property is continuous or on-change. Value should be one
1749 * of enum vehicle_prop_change_mode.
1750 */
1751 int32_t change_mode;
1752
1753 /**
1754 * Type of data used for this property. This type is fixed per each property.
1755 * Check vehicle_value_type for allowed value.
1756 */
1757 int32_t value_type;
1758
1759 /**
1760 * Define necessary permission model to access the data.
1761 */
1762 int32_t permission_model;
Keun-young Parkab68e372016-03-10 16:28:42 -08001763
Sanket Agarwalfb636682015-08-11 14:34:29 -07001764 /**
1765 * Some of the properties may have associated zones (such as hvac), in these
1766 * cases the config should contain an ORed value for the associated zone.
1767 */
1768 union {
1769 /**
Sanket Agarwalfb636682015-08-11 14:34:29 -07001770 * The value is derived by ORing one or more of enum vehicle_zone members.
1771 */
1772 int32_t vehicle_zone_flags;
1773 /** The value is derived by ORing one or more of enum vehicle_seat members. */
1774 int32_t vehicle_seat_flags;
1775 /** The value is derived by ORing one or more of enum vehicle_window members. */
1776 int32_t vehicle_window_flags;
Keun-young Parkab68e372016-03-10 16:28:42 -08001777 };
Sanket Agarwalfb636682015-08-11 14:34:29 -07001778
Keun-young Parkab68e372016-03-10 16:28:42 -08001779 /**
1780 * Property specific configuration information. Usage of this will be defined per each property.
1781 */
1782 union {
1783 /**
1784 * For generic configuration information
1785 */
1786 int32_t config_flags;
Sanket Agarwalfb636682015-08-11 14:34:29 -07001787 /** The number of presets that are stored by the radio module. Pass 0 if
1788 * there are no presets available. The range of presets is defined to be
1789 * from 1 (see VEHICLE_RADIO_PRESET_MIN_VALUE) to vehicle_radio_num_presets.
1790 */
1791 int32_t vehicle_radio_num_presets;
Keun-young Parkbf877a72015-12-21 14:16:05 -08001792 int32_t config_array[4];
Sanket Agarwalfb636682015-08-11 14:34:29 -07001793 };
1794
1795 /**
1796 * Some properties may require additional information passed over this string. Most properties
1797 * do not need to set this and in that case, config_string.data should be NULL and
1798 * config_string.len should be 0.
1799 */
1800 vehicle_str_t config_string;
1801
1802 /**
1803 * Specify minimum allowed value for the property. This is necessary for property which does
1804 * not have specified enum.
1805 */
1806 union {
1807 float float_min_value;
1808 int32_t int32_min_value;
1809 int64_t int64_min_value;
1810 };
1811
1812 /**
1813 * Specify maximum allowed value for the property. This is necessary for property which does
1814 * not have specified enum.
1815 */
1816 union {
1817 float float_max_value;
1818 int32_t int32_max_value;
1819 int64_t int64_max_value;
1820 };
1821
1822 /**
Keun-young Parkfe599a82016-02-12 14:26:57 -08001823 * Array of min values for zoned properties. Zoned property can specify min / max value in two
1824 * different ways:
1825 * 1. All zones having the same min / max value: *_min/max_value should be set and this
1826 * array should be set to NULL.
1827 * 2. All zones having separate min / max value: *_min/max_values array should be populated
1828 * and its length should be the same as number of active zones specified by *_zone_flags.
Keun-young Parkab68e372016-03-10 16:28:42 -08001829 *
1830 * Should be NULL if each zone does not have separate max values.
Keun-young Parkfe599a82016-02-12 14:26:57 -08001831 */
1832 union {
1833 float* float_min_values;
1834 int32_t* int32_min_values;
1835 int64_t* int64_min_values;
1836 };
1837
1838 /**
1839 * Array of max values for zoned properties. See above for its usage.
Keun-young Parkab68e372016-03-10 16:28:42 -08001840 * Should be NULL if each zone does not have separate max values.
1841 * If not NULL, length of array should match that of min_values.
Keun-young Parkfe599a82016-02-12 14:26:57 -08001842 */
1843 union {
1844 float* float_max_values;
1845 int32_t* int32_max_values;
1846 int64_t* int64_max_values;
1847 };
1848
1849 /**
Sanket Agarwalfb636682015-08-11 14:34:29 -07001850 * Min sample rate in Hz. Should be 0 for sensor type of VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1851 */
1852 float min_sample_rate;
1853 /**
1854 * Max sample rate in Hz. Should be 0 for sensor type of VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1855 */
1856 float max_sample_rate;
1857 /**
1858 * Place holder for putting HAL implementation specific data. Usage is wholly up to HAL
1859 * implementation.
1860 */
1861 void* hal_data;
1862} vehicle_prop_config_t;
1863
1864/**
1865 * HVAC property fields.
1866 *
1867 * Defines various HVAC properties which are packed into vehicle_hvac_t (see
1868 * below). We define these properties outside in global scope so that HAL
1869 * implementation and HAL users (JNI) can typecast vehicle_hvac correctly.
1870 */
Sanket Agarwalfb636682015-08-11 14:34:29 -07001871typedef struct vehicle_hvac {
1872 /**
1873 * Define one structure for each possible HVAC property.
1874 * NOTES:
Keun-young Parkab68e372016-03-10 16:28:42 -08001875 * a) Fan speed is a number from (0 - 6) where 6 is the highest speed. (TODO define enum)
1876 * b) Temperature is a floating point Celcius scale.
1877 * c) Direction is defined in enum vehicle_fan_direction.
Sanket Agarwalfb636682015-08-11 14:34:29 -07001878 *
1879 * The HAL should create #entries number of vehicle_hvac_properties and
1880 * assign it to "properties" variable below.
1881 */
1882 union {
Keun-young Parkab68e372016-03-10 16:28:42 -08001883 int32_t fan_speed;
1884 int32_t fan_direction;
1885 vehicle_boolean_t ac_on;
1886 vehicle_boolean_t max_ac_on;
1887 vehicle_boolean_t max_defrost_on;
1888 vehicle_boolean_t recirc_on;
1889 vehicle_boolean_t dual_on;
Steve Paik670e7ab2016-04-29 16:32:02 -07001890 vehicle_boolean_t auto_on;
Keun-young Park418c7e82016-04-06 10:44:20 -07001891 vehicle_boolean_t power_on;
Sanket Agarwalfb636682015-08-11 14:34:29 -07001892
Keun-young Parkab68e372016-03-10 16:28:42 -08001893 float temperature_current;
1894 float temperature_set;
Sanket Agarwalfb636682015-08-11 14:34:29 -07001895
Keun-young Parkab68e372016-03-10 16:28:42 -08001896 vehicle_boolean_t defrost_on;
Sanket Agarwalfb636682015-08-11 14:34:29 -07001897 };
1898} vehicle_hvac_t;
1899
1900/*
1901 * Defines how the values for various properties are represented.
1902 *
1903 * There are two ways to populate and access the fields:
1904 * a) Using the individual fields. Use this mechanism (see
1905 * info_manufacture_date, fuel_capacity fields etc).
1906 * b) Using the union accessors (see uint32_value, float_value etc).
1907 *
1908 * To add a new field make sure that it does not exceed the total union size
1909 * (defined in int_array) and it is one of the vehicle_value_type. Then add the
1910 * field name with its unit to union. If the field type is not yet defined (as
1911 * of this draft, we don't use int64_t) then add that type to vehicle_value_type
1912 * and have an accessor (so for int64_t it will be int64_t int64_value).
1913 */
1914typedef union vehicle_value {
1915 /** Define the max size of this structure. */
1916 int32_t int32_array[4];
1917 float float_array[4];
1918
1919 // Easy accessors for union members (HAL implementation SHOULD NOT USE these
1920 // fields while populating, use the property specific fields below instead).
1921 int32_t int32_value;
1922 int64_t int64_value;
1923 float float_value;
1924 vehicle_str_t str_value;
1925 vehicle_bytes_t bytes_value;
1926 vehicle_boolean_t boolean_value;
Sanket Agarwalfb636682015-08-11 14:34:29 -07001927
1928 // Vehicle Information.
1929 vehicle_str_t info_vin;
1930 vehicle_str_t info_make;
1931 vehicle_str_t info_model;
1932 int32_t info_model_year;
1933
1934 // Represented in milliliters.
1935 float info_fuel_capacity;
1936
1937 float vehicle_speed;
1938 float odometer;
1939
1940 // Engine sensors.
1941
1942 // Represented in milliliters.
1943 //float engine_coolant_level;
1944 // Represented in celcius.
1945 float engine_coolant_temperature;
1946 // Represented in a percentage value.
1947 //float engine_oil_level;
1948 // Represented in celcius.
1949 float engine_oil_temperature;
1950 float engine_rpm;
1951
1952 // Event sensors.
1953 // Value should be one of enum vehicle_gear_selection.
1954 int32_t gear_selection;
1955 // Value should be one of enum vehicle_gear.
1956 int32_t gear_current_gear;
1957 // Value should be one of enum vehicle_boolean.
1958 int32_t parking_brake;
1959 // If cruise_set_speed > 0 then cruise is ON otherwise cruise is OFF.
1960 // Unit: meters / second (m/s).
1961 //int32_t cruise_set_speed;
1962 // Value should be one of enum vehicle_boolean.
1963 int32_t is_fuel_level_low;
1964 // Value should be one of enum vehicle_driving_status.
1965 int32_t driving_status;
1966 int32_t night_mode;
1967 // Value should be one of emum vehicle_turn_signal.
1968 int32_t turn_signals;
1969 // Value should be one of enum vehicle_boolean.
1970 //int32_t engine_on;
1971
1972 // HVAC properties.
1973 vehicle_hvac_t hvac;
1974
1975 float outside_temperature;
Keun-young Parkcb354502016-02-08 18:15:55 -08001976 float cabin_temperature;
1977
Sanket Agarwalfb636682015-08-11 14:34:29 -07001978} vehicle_value_t;
1979
1980/*
1981 * Encapsulates the property name and the associated value. It
1982 * is used across various API calls to set values, get values or to register for
1983 * events.
1984 */
1985typedef struct vehicle_prop_value {
1986 /* property identifier */
1987 int32_t prop;
1988
1989 /* value type of property for quick conversion from union to appropriate
1990 * value. The value must be one of enum vehicle_value_type.
1991 */
1992 int32_t value_type;
1993
1994 /** time is elapsed nanoseconds since boot */
1995 int64_t timestamp;
1996
Keun-young Parkab68e372016-03-10 16:28:42 -08001997 /**
1998 * Zone information for zoned property. For non-zoned property, this should be ignored.
1999 */
2000 union {
2001 int32_t zone;
2002 int32_t seat;
2003 int32_t window;
2004 };
2005
Sanket Agarwalfb636682015-08-11 14:34:29 -07002006 vehicle_value_t value;
2007} vehicle_prop_value_t;
2008
2009/*
2010 * Event callback happens whenever a variable that the API user has subscribed
2011 * to needs to be reported. This may be based purely on threshold and frequency
2012 * (a regular subscription, see subscribe call's arguments) or when the set()
2013 * command is executed and the actual change needs to be reported.
2014 *
2015 * event_data is OWNED by the HAL and should be copied before the callback
2016 * finishes.
2017 */
2018typedef int (*vehicle_event_callback_fn)(const vehicle_prop_value_t *event_data);
2019
2020
2021/**
2022 * Represent the operation where the current error has happened.
2023 */
2024enum vehicle_property_operation {
2025 /** Generic error to this property which is not tied to any operation. */
2026 VEHICLE_OPERATION_GENERIC = 0,
2027 /** Error happened while handling property set. */
2028 VEHICLE_OPERATION_SET = 1,
2029 /** Error happened while handling property get. */
2030 VEHICLE_OPERATION_GET = 2,
2031 /** Error happened while handling property subscription. */
2032 VEHICLE_OPERATION_SUBSCRIBE = 3,
2033};
2034
2035/*
Keun-young Parkab68e372016-03-10 16:28:42 -08002036 * Suggests that an error condition has occurred.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002037 *
Keun-young Parkab68e372016-03-10 16:28:42 -08002038 * @param error_code Error code. error_code should be standard error code with
2039 * negative value like -EINVAL.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002040 * @parm property Note a property where error has happened. If this is generic error, property
2041 * should be VEHICLE_PROPERTY_INVALID.
2042 * @param operation Represent the operation where the error has happened. Should be one of
2043 * vehicle_property_operation.
2044 */
2045typedef int (*vehicle_error_callback_fn)(int32_t error_code, int32_t property, int32_t operation);
2046
2047/************************************************************************************/
2048
2049/*
2050 * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
2051 * and the fields of this data structure must begin with hw_module_t
2052 * followed by module specific information.
2053 */
2054typedef struct vehicle_module {
2055 struct hw_module_t common;
2056} vehicle_module_t;
2057
2058
2059typedef struct vehicle_hw_device {
2060 struct hw_device_t common;
2061
2062 /**
2063 * After calling open on device the user should register callbacks for event and error
2064 * functions.
2065 */
2066 int (*init)(struct vehicle_hw_device* device,
2067 vehicle_event_callback_fn event_fn, vehicle_error_callback_fn err_fn);
2068 /**
2069 * Before calling close the user should destroy the registered callback
2070 * functions.
2071 * In case the unsubscribe() call is not called on all properties before
2072 * release() then release() will unsubscribe the properties itself.
2073 */
2074 int (*release)(struct vehicle_hw_device* device);
2075
2076 /**
2077 * Enumerate all available properties. The list is returned in "list".
2078 * @param num_properties number of properties contained in the retuned array.
2079 * @return array of property configs supported by this car. Note that returned data is const
2080 * and caller cannot modify it. HAL implementation should keep this memory until HAL
2081 * is released to avoid copying this again.
2082 */
2083 vehicle_prop_config_t const *(*list_properties)(struct vehicle_hw_device* device,
2084 int* num_properties);
2085
2086 /**
2087 * Get a vehicle property value immediately. data should be allocated
2088 * properly.
2089 * The caller of the API OWNS the data field.
Keun-young Park08c255e2015-12-09 13:47:30 -08002090 * Caller will set data->prop, data->value_type, and optionally zone value for zoned property.
2091 * But HAL implementation needs to fill all entries properly when returning.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002092 * For pointer type, HAL implementation should allocate necessary memory and caller is
Keun-young Parkab68e372016-03-10 16:28:42 -08002093 * responsible for calling release_memory_from_get, which allows HAL to release allocated
2094 * memory.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002095 * For VEHICLE_PROP_CHANGE_MODE_STATIC type of property, get should return the same value
2096 * always.
2097 * For VEHICLE_PROP_CHANGE_MODE_ON_CHANGE type of property, it should return the latest value.
Keun-young Parkab68e372016-03-10 16:28:42 -08002098 * If there is no data available yet, which can happen during initial stage, this call should
2099 * return immediately with error code of -EAGAIN.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002100 */
2101 int (*get)(struct vehicle_hw_device* device, vehicle_prop_value_t *data);
2102
2103 /**
Keun-young Parkab68e372016-03-10 16:28:42 -08002104 * Release memory allocated to data in previous get call. get call for byte or string involves
2105 * allocating necessary memory from vehicle hal.
2106 * To be safe, memory allocated by vehicle hal should be released by vehicle hal and vehicle
2107 * network service will call this when data from vehicle hal is no longer necessary.
2108 * vehicle hal implementation should only release member of vehicle_prop_value_t like
2109 * data->str_value.data or data->bytes_value.data but not data itself as data itself is
2110 * allocated from vehicle network service. Once memory is freed, corresponding pointer should
2111 * be set to NULL bu vehicle hal.
2112 */
2113 void (*release_memory_from_get)(struct vehicle_hw_device* device, vehicle_prop_value_t *data);
2114
2115 /**
Sanket Agarwalfb636682015-08-11 14:34:29 -07002116 * Set a vehicle property value. data should be allocated properly and not
2117 * NULL.
2118 * The caller of the API OWNS the data field.
2119 * timestamp of data will be ignored for set operation.
Keun-young Park418c7e82016-04-06 10:44:20 -07002120 * Setting some properties require having initial state available. Depending on the vehicle hal,
2121 * such initial data may not be available for short time after init. In such case, set call
2122 * can return -EAGAIN like get call.
Keun-young Parkf7097582016-04-25 18:10:45 -07002123 * For a property with separate power control, set can fail if the property is not powered on.
2124 * In such case, hal should return -ESHUTDOWN error.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002125 */
2126 int (*set)(struct vehicle_hw_device* device, const vehicle_prop_value_t *data);
2127
2128 /**
2129 * Subscribe to events.
2130 * Depending on output of list_properties if the property is:
2131 * a) on-change: sample_rate should be set to 0.
2132 * b) supports frequency: sample_rate should be set from min_sample_rate to
2133 * max_sample_rate.
Keun-young Park418c7e82016-04-06 10:44:20 -07002134 * For on-change type of properties, vehicle network service will make another get call to check
2135 * the initial state. Due to this, vehicle hal implementation does not need to send initial
2136 * state for on-change type of properties.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002137 * @param device
2138 * @param prop
2139 * @param sample_rate
Keun-young Parkbf877a72015-12-21 14:16:05 -08002140 * @param zones All subscribed zones for zoned property. can be ignored for non-zoned property.
2141 * 0 means all zones supported instead of no zone.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002142 */
Keun-young Parkbf877a72015-12-21 14:16:05 -08002143 int (*subscribe)(struct vehicle_hw_device* device, int32_t prop, float sample_rate,
2144 int32_t zones);
Sanket Agarwalfb636682015-08-11 14:34:29 -07002145
2146 /** Cancel subscription on a property. */
2147 int (*unsubscribe)(struct vehicle_hw_device* device, int32_t prop);
Keun-young Park418c7e82016-04-06 10:44:20 -07002148
2149 /**
2150 * Print out debugging state for the vehicle hal. This will be called by
2151 * the vehicle network service and will be included into the service' dump.
2152 *
2153 * The passed-in file descriptor can be used to write debugging text using
2154 * dprintf() or write(). The text should be in ASCII encoding only.
2155 *
2156 * Performance requirements:
2157 *
2158 * This must be a non-blocking call. The HAL should return from this call
2159 * in 1ms, must return from this call in 10ms. This call must avoid
2160 * deadlocks, as it may be called at any point of operation.
2161 * Any synchronization primitives used (such as mutex locks or semaphores)
2162 * should be acquired with a timeout.
2163 */
2164 int (*dump)(struct vehicle_hw_device* device, int fd);
2165
Sanket Agarwalfb636682015-08-11 14:34:29 -07002166} vehicle_hw_device_t;
2167
2168__END_DECLS
2169
2170#endif // ANDROID_VEHICLE_INTERFACE_H