blob: b179d4ed3bc2309183a5d4bfd8db312b8192a0f8 [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.
86 * @range_start
87 */
88#define VEHICLE_PROPERTY_INVALID (0x0)
89
90/**
91 * VIN of vehicle
92 * @value_type VEHICLE_VALUE_TYPE_STRING
93 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
94 * @access VEHICLE_PROP_ACCESS_READ
95 * @data_member info_vin
96 */
97#define VEHICLE_PROPERTY_INFO_VIN (0x00000100)
98
99/**
100 * Maker name of vehicle
101 * @value_type VEHICLE_VALUE_TYPE_STRING
102 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
103 * @access VEHICLE_PROP_ACCESS_READ
104 * @data_member info_make
105 */
106#define VEHICLE_PROPERTY_INFO_MAKE (0x00000101)
107
108/**
109 * Model of vehicle
110 * @value_type VEHICLE_VALUE_TYPE_STRING
111 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
112 * @access VEHICLE_PROP_ACCESS_READ
113 * @data_member info_model
114 */
115#define VEHICLE_PROPERTY_INFO_MODEL (0x00000102)
116
117/**
118 * Model year of vehicle.
119 * @value_type VEHICLE_VALUE_TYPE_INT32
120 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
121 * @access VEHICLE_PROP_ACCESS_READ
122 * @data_member info_model_year
123 * @unit VEHICLE_UNIT_TYPE_YEAR
124 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700125#define VEHICLE_PROPERTY_INFO_MODEL_YEAR (0x00000103)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700126
127/**
128 * Fuel capacity of the vehicle
129 * @value_type VEHICLE_VALUE_TYPE_FLOAT
130 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
131 * @access VEHICLE_PROP_ACCESS_READ
132 * @data_member info_fuel_capacity
133 * @unit VEHICLE_UNIT_TYPE_VEHICLE_UNIT_TYPE_MILLILITER
134 */
135#define VEHICLE_PROPERTY_INFO_FUEL_CAPACITY (0x00000104)
136
137
138//==== Vehicle Performance Sensors ====
139
140/**
141 * Current odometer value of the vehicle
142 * @value_type VEHICLE_VALUE_TYPE_FLOAT
143 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
144 * @access VEHICLE_PROP_ACCESS_READ
145 * @data_member odometer
146 * @unit VEHICLE_UNIT_TYPE_KILOMETER
147 */
148#define VEHICLE_PROPERTY_PERF_ODOMETER (0x00000204)
149
150/**
151 * Speed of the vehicle
152 * @value_type VEHICLE_VALUE_TYPE_FLOAT
153 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
154 * @access VEHICLE_PROP_ACCESS_READ
155 * @data_member vehicle_speed
156 * @unit VEHICLE_UNIT_TYPE_METER_PER_SEC
157 */
158#define VEHICLE_PROPERTY_PERF_VEHICLE_SPEED (0x00000207)
159
160
161//==== Engine Sensors ====
162
163/**
164 * Temperature of engine coolant
165 * @value_type VEHICLE_VALUE_TYPE_FLOAT
166 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
167 * @access VEHICLE_PROP_ACCESS_READ
168 * @data_member engine_coolant_temperature
169 * @unit VEHICLE_UNIT_TYPE_CELCIUS
170 */
171#define VEHICLE_PROPERTY_ENGINE_COOLANT_TEMP (0x00000301)
172
173/**
174 * Temperature of engine oil
175 * @value_type VEHICLE_VALUE_TYPE_FLOAT
176 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
177 * @access VEHICLE_PROP_ACCESS_READ
178 * @data_member engine_oil_temperature
179 * @unit VEHICLE_UNIT_TYPE_CELCIUS
180 */
181#define VEHICLE_PROPERTY_ENGINE_OIL_TEMP (0x00000304)
182/**
183 * Engine rpm
184 * @value_type VEHICLE_VALUE_TYPE_FLOAT
185 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
186 * @access VEHICLE_PROP_ACCESS_READ
187 * @data_member engine_rpm
188 * @unit VEHICLE_UNIT_TYPE_RPM
189 */
190#define VEHICLE_PROPERTY_ENGINE_RPM (0x00000305)
191
192//==== Event Sensors ====
193
194/**
195 * Currently selected gear
196 * @value_type VEHICLE_VALUE_TYPE_INT32
197 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
198 * @access VEHICLE_PROP_ACCESS_READ
199 * @data_member gear_selection
200 * @data_enum vehicle_gear
201 */
202#define VEHICLE_PROPERTY_GEAR_SELECTION (0x00000400)
203
204/**
205 * Current gear. In non-manual case, selected gear does not necessarily match the current gear
206 * @value_type VEHICLE_VALUE_TYPE_INT32
207 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
208 * @access VEHICLE_PROP_ACCESS_READ
209 * @data_member gear_current_gear
210 * @data_enum vehicle_gear
211 */
212#define VEHICLE_PROPERTY_CURRENT_GEAR (0x00000401)
213
214/**
215 * Parking brake state.
216 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
217 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
218 * @access VEHICLE_PROP_ACCESS_READ
219 * @data_member parking_brake
220 * @data_enum vehicle_boolean
221 */
222#define VEHICLE_PROPERTY_PARKING_BRAKE_ON (0x00000402)
223
224/**
225 * Driving status policy.
226 * @value_type VEHICLE_VALUE_TYPE_INT32
227 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
228 * @access VEHICLE_PROP_ACCESS_READ
229 * @data_member driving_status
230 * @data_enum vehicle_driving_status
231 */
232#define VEHICLE_PROPERTY_DRIVING_STATUS (0x00000404)
233
234/**
235 * Warning for fuel low level.
236 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
237 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
238 * @access VEHICLE_PROP_ACCESS_READ
239 * @data_member is_fuel_level_low
240 * @data_enum vehicle_boolean
241 */
242#define VEHICLE_PROPERTY_FUEL_LEVEL_LOW (0x00000405)
243
244/**
245 * Night mode or not.
246 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
247 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
248 * @access VEHICLE_PROP_ACCESS_READ
249 * @data_member night_mode
250 * @data_enum vehicle_boolean
251 */
252#define VEHICLE_PROPERTY_NIGHT_MODE (0x00000407)
253
254
255
Steve Paike588bae2016-06-29 17:06:16 -0700256//==== HVAC Properties ====
Sanket Agarwalfb636682015-08-11 14:34:29 -0700257
258/**
259 * Fan speed setting
260 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
261 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
262 * @access VEHICLE_PROP_ACCESS_READ_WRITE
263 * @data_member hvac.fan_speed
Keun-young Park14f09002016-01-22 16:29:22 -0800264 * @zone_type VEHICLE_ZONE
Keun-young Park418c7e82016-04-06 10:44:20 -0700265 * @allow_out_of_range_value : OFF
Sanket Agarwalfb636682015-08-11 14:34:29 -0700266 */
267#define VEHICLE_PROPERTY_HVAC_FAN_SPEED (0x00000500)
268
269/**
270 * Fan direction setting
271 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
272 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
273 * @access VEHICLE_PROP_ACCESS_READ_WRITE
274 * @data_member hvac.fan_direction
Keun-young Park14f09002016-01-22 16:29:22 -0800275 * @zone_type VEHICLE_ZONE
Steve Paikbfbbb672016-07-08 16:12:38 -0700276 * @data_enum vehicle_hvac_fan_direction
Keun-young Park418c7e82016-04-06 10:44:20 -0700277 * @allow_out_of_range_value : OFF
Sanket Agarwalfb636682015-08-11 14:34:29 -0700278 */
279#define VEHICLE_PROPERTY_HVAC_FAN_DIRECTION (0x00000501)
280
Steve Paikd2ba70f2015-12-10 14:58:27 -0800281/*
282 * Bit flags for fan direction
283 */
Steve Paik159349e2016-02-09 18:45:58 -0800284enum vehicle_hvac_fan_direction {
285 VEHICLE_HVAC_FAN_DIRECTION_FACE = 0x1,
286 VEHICLE_HVAC_FAN_DIRECTION_FLOOR = 0x2,
287 VEHICLE_HVAC_FAN_DIRECTION_FACE_AND_FLOOR = 0x3,
288 VEHICLE_HVAC_FAN_DIRECTION_DEFROST = 0x4,
289 VEHICLE_HVAC_FAN_DIRECTION_DEFROST_AND_FLOOR = 0x5
Steve Paikd2ba70f2015-12-10 14:58:27 -0800290};
291
Sanket Agarwalfb636682015-08-11 14:34:29 -0700292/**
293 * HVAC current temperature.
294 * @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
Keun-young Parkda3cb912016-05-12 11:21:04 -0700295 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700296 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Park14f09002016-01-22 16:29:22 -0800297 * @zone_type VEHICLE_ZONE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700298 * @data_member hvac.temperature_current
299 */
300#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_CURRENT (0x00000502)
301
302/**
303 * HVAC, target temperature set.
304 * @value_type VEHICLE_VALUE_TYPE_ZONED_FLOAT
Keun-young Parkda3cb912016-05-12 11:21:04 -0700305 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700306 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Park14f09002016-01-22 16:29:22 -0800307 * @zone_type VEHICLE_ZONE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700308 * @data_member hvac.temperature_set
Keun-young Park418c7e82016-04-06 10:44:20 -0700309 * @allow_out_of_range_value : MIN / MAX / OFF
Sanket Agarwalfb636682015-08-11 14:34:29 -0700310 */
311#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_SET (0x00000503)
312
313/**
314 * On/off defrost
315 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
316 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
317 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Park418c7e82016-04-06 10:44:20 -0700318 * @zone_type VEHICLE_WINDOW
Sanket Agarwalfb636682015-08-11 14:34:29 -0700319 * @data_member hvac.defrost_on
320 */
321#define VEHICLE_PROPERTY_HVAC_DEFROSTER (0x00000504)
322
323/**
324 * On/off AC
325 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
326 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
327 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -0800328 * @config_flags Supported zones
Keun-young Park14f09002016-01-22 16:29:22 -0800329 * @zone_type VEHICLE_ZONE
Sanket Agarwalfb636682015-08-11 14:34:29 -0700330 * @data_member hvac.ac_on
331 */
332#define VEHICLE_PROPERTY_HVAC_AC_ON (0x00000505)
333
334/**
Steve Paikd2ba70f2015-12-10 14:58:27 -0800335 * On/off max AC
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700336 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800337 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
338 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700339 * @zone_type VEHICLE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800340 * @data_member hvac.max_ac_on
341 */
342#define VEHICLE_PROPERTY_HVAC_MAX_AC_ON (0x00000506)
343
344/**
345 * On/off max defrost
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700346 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800347 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
348 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700349 * @zone_type VEHICLE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800350 * @data_member hvac.max_defrost_on
351 */
352#define VEHICLE_PROPERTY_HVAC_MAX_DEFROST_ON (0x00000507)
353
354/**
355 * On/off re-circulation
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700356 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800357 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
358 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700359 * @zone_type VEHICLE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800360 * @data_member hvac.max_recirc_on
361 */
362#define VEHICLE_PROPERTY_HVAC_RECIRC_ON (0x00000508)
363
364/**
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700365 * On/off dual. This will be defined per each row.
366 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paikd2ba70f2015-12-10 14:58:27 -0800367 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
368 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkf1ccec12016-04-22 13:19:53 -0700369 * @zone_type VEHICLE_ZONE
Steve Paikd2ba70f2015-12-10 14:58:27 -0800370 * @data_member hvac.dual_on
371 */
372#define VEHICLE_PROPERTY_HVAC_DUAL_ON (0x00000509)
373
374/**
Steve Paikcc9e2922016-04-21 11:40:17 -0700375 * On/off automatic mode
376 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
377 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
378 * @access VEHICLE_PROP_ACCESS_READ_WRITE
379 * @zone_type VEHICLE_ZONE
Steve Paik670e7ab2016-04-29 16:32:02 -0700380 * @data_member hvac.auto_on
Steve Paikcc9e2922016-04-21 11:40:17 -0700381 */
382#define VEHICLE_PROPERTY_HVAC_AUTO_ON (0x0000050A)
383
384/**
Steve Paike588bae2016-06-29 17:06:16 -0700385 * Seat temperature
386 *
387 * Negative values indicate cooling.
388 * 0 indicates off.
389 * Positive values indicate heating.
390 *
391 * Some vehicles may have multiple levels of heating and cooling. The min/max
392 * range defines the allowable range and number of steps in each direction.
393 *
394 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
395 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
396 * @access VEHICLE_PROP_ACCESS_WRITE
397 * @zone_type VEHICLE_SEAT
398 * @data_member int32_value
399 */
400#define VEHICLE_PROPERTY_HVAC_SEAT_TEMPERATURE (0x0000050B)
401
402/**
Steve Paikbfbbb672016-07-08 16:12:38 -0700403 * Side Mirror Heat
404 *
405 * Increase values denote higher heating levels for side mirrors.
406 * 0 indicates heating is turned off.
407 *
408 * @value_type VEHICLE_VALUE_TYPE_INT32
409 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
410 * @access VEHICLE_PROP_ACCESS_READ_WRITE
411 * @data_member int32_value
412 */
413#define VEHICLE_PROPERTY_HVAC_SIDE_MIRROR_HEAT (0x0000050C)
414
415/**
416 * Steering Wheel Temperature
417 *
418 * Sets the temperature for the steering wheel
419 * Positive value indicates heating.
420 * Negative value indicates cooling.
421 * 0 indicates tempreature control is off.
422 *
423 * @value_type VEHICLE_VALUE_TYPE_INT32
424 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
425 * @access VEHICLE_PROP_ACCESS_READ_WRITE
426 * @data_member int32_value
427 */
428#define VEHICLE_PROPERTY_HVAC_STEERING_WHEEL_TEMP (0x0000050D)
429
430/**
431 * Temperature units
432 *
433 * Indicates whether the temperature is in Celsius, Fahrenheit, or a different unit.
434 * This parameter affects all HVAC temperatures in the system.
435 *
436 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
437 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
438 * @access VEHICLE_PROP_ACCESS_READ
439 * @data_enum vehicle_unit_type
440 * @data_member int32_value
441 */
442#define VEHICLE_PROPERTY_HVAC_TEMPERATURE_UNITS (0x0000050E)
443
444/**
445 * Actual fan speed
446 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
447 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
448 * @access VEHICLE_PROP_ACCESS_READ
449 * @data_member hvac.fan_speed
450 * @zone_type VEHICLE_ZONE
451 * @allow_out_of_range_value : OFF
452 */
453#define VEHICLE_PROPERTY_HVAC_ACTUAL_FAN_SPEED_RPM (0x0000050F)
454
455
456/**
Keun-young Park418c7e82016-04-06 10:44:20 -0700457 * Represents power state for HVAC. Some HVAC properties will require matching power to be turned on
458 * to get out of OFF state. For non-zoned HVAC properties, VEHICLE_ALL_ZONE corresponds to
459 * global power state.
460 *
461 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
462 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
463 * @access VEHICLE_PROP_ACCESS_READ_WRITE
464 * @config_string list of HVAC properties whose power is controlled by this property. Format is
465 * hexa-decimal number (0x...) separated by comma like "0x500,0x503". All zones
466 * defined in these affected properties should be available in the property.
467 * @zone_type VEHICLE_ZONE
468 * @data_member hvac.power_on
469 */
470#define VEHICLE_PROPERTY_HVAC_POWER_ON (0x00000510)
471
472/**
Steve Paikbfbbb672016-07-08 16:12:38 -0700473 * Fan Positions Available
474 *
475 * This is a bit mask of fan positions available for the zone. Each entry in
476 * vehicle_hvac_fan_direction is selected by bit position. For instance, if
477 * only the FAN_DIRECTION_FACE (0x1) and FAN_DIRECTION_DEFROST (0x4) are available,
478 * then this value shall be set to 0x12.
479 *
480 * 0x12 = (1 << 1) | (1 << 4)
481 *
482 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
483 * @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
484 * @access VEHICLE_PROP_ACCESS_READ
485 * @data_member int32_value
486 * @zone_type VEHICLE_ZONE
487 * @allow_out_of_range_value : OFF
488 */
489#define VEHICLE_PROPERTY_HVAC_FAN_DIRECTION_AVAILABLE (0x00000511)
490
491/**
Sanket Agarwalfb636682015-08-11 14:34:29 -0700492 * Outside temperature
493 * @value_type VEHICLE_VALUE_TYPE_FLOAT
494 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
495 * @access VEHICLE_PROP_ACCESS_READ
496 * @data_member outside_temperature
497 * @unit VEHICLE_UNIT_TYPE_CELCIUS
498 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700499#define VEHICLE_PROPERTY_ENV_OUTSIDE_TEMPERATURE (0x00000703)
Keun-young Parkcb354502016-02-08 18:15:55 -0800500
501
502/**
503 * Cabin temperature
504 * @value_type VEHICLE_VALUE_TYPE_FLOAT
505 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE|VEHICLE_PROP_CHANGE_MODE_CONTINUOUS
506 * @access VEHICLE_PROP_ACCESS_READ
507 * @data_member cabin_temperature
508 * @unit VEHICLE_UNIT_TYPE_CELCIUS
509 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700510#define VEHICLE_PROPERTY_ENV_CABIN_TEMPERATURE (0x00000704)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700511
512
513/*
514 * Radio features.
515 */
516/**
517 * Radio presets stored on the Car radio module. The data type used is int32
518 * array with the following fields:
519 * <ul>
520 * <li> int32_array[0]: Preset number </li>
521 * <li> int32_array[1]: Band type (see #RADIO_BAND_FM in
522 * system/core/include/system/radio.h).
523 * <li> int32_array[2]: Channel number </li>
524 * <li> int32_array[3]: Sub channel number </li>
525 * </ul>
526 *
527 * NOTE: When getting a current preset config ONLY set preset number (i.e.
528 * int32_array[0]). For setting a preset other fields are required.
529 *
530 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
531 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
532 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -0800533 * @config_flags Number of presets supported
Sanket Agarwalfb636682015-08-11 14:34:29 -0700534 * @data_member int32_array
535 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700536#define VEHICLE_PROPERTY_RADIO_PRESET (0x0000801)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700537
538/**
539 * Constants relevant to radio.
540 */
541enum vehicle_radio_consts {
542 /** Minimum value for the radio preset */
543 VEHICLE_RADIO_PRESET_MIN_VALUE = 1,
544};
545
546/**
547 * Represents audio focus state of Android side. Note that car's audio module will own audio
548 * focus and grant audio focus to Android side when requested by Android side. The focus has both
549 * per stream characteristics and global characteristics.
550 *
551 * Focus request (get of this property) will take the following form in int32_vec4:
Keun-young Park08c255e2015-12-09 13:47:30 -0800552 * int32_array[0]: vehicle_audio_focus_request type
Sanket Agarwalfb636682015-08-11 14:34:29 -0700553 * int32_array[1]: bit flags of streams requested by this focus request. There can be up to
554 * 32 streams.
555 * int32_array[2]: External focus state flags. For request, only flag like
Keun-young Park418c7e82016-04-06 10:44:20 -0700556 * VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG or
557 * VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG can be used.
558 * VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG is for case like radio where android
559 * side app still needs to hold focus but playback is done outside Android.
560 * VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG is for muting media channel
561 * including radio. VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG can be set even
562 * if android side releases focus (request type REQUEST_RELEASE). In that case,
563 * audio module should maintain mute state until user's explicit action to
564 * play some media.
Keun-young Park637fb202016-03-29 09:52:41 -0700565 * int32_array[3]: Currently active audio contexts. Use combination of flags from
Keun-young Parkfe599a82016-02-12 14:26:57 -0800566 * vehicle_audio_context_flag.
567 * This can be used as a hint to adjust audio policy or other policy decision.
568 * Note that there can be multiple context active at the same time. And android
569 * can send the same focus request type gain due to change in audio contexts.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700570 * Note that each focus request can request multiple streams that is expected to be used for
571 * the current request. But focus request itself is global behavior as GAIN or GAIN_TRANSIENT
572 * expects all sounds played by car's audio module to stop. Note that stream already allocated to
573 * android before this focus request should not be affected by focus request.
574 *
575 * Focus response (set and subscription callback for this property) will take the following form:
Keun-young Park08c255e2015-12-09 13:47:30 -0800576 * int32_array[0]: vehicle_audio_focus_state type
Sanket Agarwalfb636682015-08-11 14:34:29 -0700577 * int32_array[1]: bit flags of streams allowed.
578 * int32_array[2]: External focus state: bit flags of currently active audio focus in car
579 * side (outside Android). Active audio focus does not necessarily mean currently
580 * playing, but represents the state of having focus or waiting for focus
581 * (pause state).
582 * One or combination of flags from vehicle_audio_ext_focus_flag.
583 * 0 means no active audio focus holder outside Android.
584 * The state will have following values for each vehicle_audio_focus_state_type:
585 * GAIN: 0 or VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY when radio is active in
586 * Android side.
587 * GAIN_TRANSIENT: 0. Can be VEHICLE_AUDIO_EXT_FOCUS_CAR_PERMANENT or
588 * VEHICLE_AUDIO_EXT_FOCUS_CAR_TRANSIENT if android side has requested
589 * GAIN_TRANSIENT_MAY_DUCK and car side is ducking.
590 * LOSS: 0 when no focus is audio is active in car side.
591 * VEHICLE_AUDIO_EXT_FOCUS_CAR_PERMANENT when car side is playing something
592 * permanent.
593 * LOSS_TRANSIENT: always should be VEHICLE_AUDIO_EXT_FOCUS_CAR_TRANSIENT
Keun-young Parkda3cb912016-05-12 11:21:04 -0700594 * int32_array[3]: context requested by android side when responding to focus request.
595 * When car side is taking focus away, this should be zero.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700596 *
Keun-young Park254dbce2016-03-28 09:37:04 -0700597 * A focus response should be sent per each focus request even if there is no change in
598 * focus state. This can happen in case like focus request only involving context change
599 * where android side still needs matching focus response to confirm that audio module
600 * has made necessary changes.
601 *
Sanket Agarwalfb636682015-08-11 14:34:29 -0700602 * If car does not support VEHICLE_PROPERTY_AUDIO_FOCUS, focus is assumed to be granted always.
603 *
Keun-young Parkfe599a82016-02-12 14:26:57 -0800604 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
Sanket Agarwalfb636682015-08-11 14:34:29 -0700605 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
606 * @access VEHICLE_PROP_ACCESS_READ_WRITE
607 * @data_member int32_array
608 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700609#define VEHICLE_PROPERTY_AUDIO_FOCUS (0x00000900)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700610
611enum vehicle_audio_focus_request {
612 VEHICLE_AUDIO_FOCUS_REQUEST_GAIN = 0x1,
613 VEHICLE_AUDIO_FOCUS_REQUEST_GAIN_TRANSIENT = 0x2,
614 VEHICLE_AUDIO_FOCUS_REQUEST_GAIN_TRANSIENT_MAY_DUCK = 0x3,
Keun-young Parkcb354502016-02-08 18:15:55 -0800615 /**
616 * This is for the case where android side plays sound like UI feedback
617 * and car side does not need to duck existing playback as long as
618 * requested stream is available.
619 */
620 VEHICLE_AUDIO_FOCUS_REQUEST_GAIN_TRANSIENT_NO_DUCK = 0x4,
621 VEHICLE_AUDIO_FOCUS_REQUEST_RELEASE = 0x5,
Sanket Agarwalfb636682015-08-11 14:34:29 -0700622};
623
624enum vehicle_audio_focus_state {
625 /**
626 * Android side has permanent focus and can play allowed streams.
627 */
628 VEHICLE_AUDIO_FOCUS_STATE_GAIN = 0x1,
629 /**
630 * Android side has transient focus and can play allowed streams.
631 */
632 VEHICLE_AUDIO_FOCUS_STATE_GAIN_TRANSIENT = 0x2,
633 /**
634 * Car audio module is playing guidance kind of sound outside Android. Android side can
635 * still play through allowed streams with ducking.
636 */
637 VEHICLE_AUDIO_FOCUS_STATE_LOSS_TRANSIENT_CAN_DUCK = 0x3,
638 /**
639 * Car audio module is playing transient sound outside Android. Android side should stop
640 * playing any sounds.
641 */
642 VEHICLE_AUDIO_FOCUS_STATE_LOSS_TRANSIENT = 0x4,
643 /**
644 * Android side has lost focus and cannot play any sound.
645 */
646 VEHICLE_AUDIO_FOCUS_STATE_LOSS = 0x5,
647 /**
648 * car audio module is playing safety critical sound, and Android side cannot request focus
649 * until the current state is finished. car audio module should restore it to the previous
650 * state when it can allow Android to play.
651 */
652 VEHICLE_AUDIO_FOCUS_STATE_LOSS_TRANSIENT_EXLCUSIVE = 0x6,
653};
654
655/**
656 * Flags to represent multiple streams by combining these.
657 */
658enum vehicle_audio_stream_flag {
659 VEHICLE_AUDIO_STREAM_STREAM0_FLAG = (0x1<<0),
660 VEHICLE_AUDIO_STREAM_STREAM1_FLAG = (0x1<<1),
661 VEHICLE_AUDIO_STREAM_STREAM2_FLAG = (0x1<<2),
662};
663
664/**
665 * Represents stream number (always 0 to N -1 where N is max number of streams).
666 * Can be used for audio related property expecting one stream.
667 */
668enum vehicle_audio_stream {
669 VEHICLE_AUDIO_STREAM0 = 0,
670 VEHICLE_AUDIO_STREAM1 = 1,
671};
672
673/**
674 * Flag to represent external focus state (outside Android).
675 */
676enum vehicle_audio_ext_focus_flag {
677 /**
678 * No external focus holder.
679 */
680 VEHICLE_AUDIO_EXT_FOCUS_NONE_FLAG = 0x0,
681 /**
682 * Car side (outside Android) has component holding GAIN kind of focus state.
683 */
684 VEHICLE_AUDIO_EXT_FOCUS_CAR_PERMANENT_FLAG = 0x1,
685 /**
686 * Car side (outside Android) has component holding GAIN_TRANSIENT kind of focus state.
687 */
688 VEHICLE_AUDIO_EXT_FOCUS_CAR_TRANSIENT_FLAG = 0x2,
689 /**
690 * Car side is expected to play something while focus is held by Android side. One example
691 * can be radio attached in car side. But Android's radio app still should have focus,
692 * and Android side should be in GAIN state, but media stream will not be allocated to Android
693 * side and car side can play radio any time while this flag is active.
694 */
695 VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG = 0x4,
Keun-young Park418c7e82016-04-06 10:44:20 -0700696 /**
697 * Car side should mute any media including radio. This can be used with any focus request
698 * including GAIN* and RELEASE.
699 */
700 VEHICLE_AUDIO_EXT_FOCUS_CAR_MUTE_MEDIA_FLAG = 0x8,
Sanket Agarwalfb636682015-08-11 14:34:29 -0700701};
702
703/**
704 * Index in int32_array for VEHICLE_PROPERTY_AUDIO_FOCUS property.
705 */
706enum vehicle_audio_focus_index {
707 VEHICLE_AUDIO_FOCUS_INDEX_FOCUS = 0,
708 VEHICLE_AUDIO_FOCUS_INDEX_STREAMS = 1,
709 VEHICLE_AUDIO_FOCUS_INDEX_EXTERNAL_FOCUS_STATE = 2,
Keun-young Parkfe599a82016-02-12 14:26:57 -0800710 VEHICLE_AUDIO_FOCUS_INDEX_AUDIO_CONTEXTS = 3,
711};
712
713/**
714 * Flags to tell the current audio context.
715 */
716enum vehicle_audio_context_flag {
717 /** Music playback is currently active. */
718 VEHICLE_AUDIO_CONTEXT_MUSIC_FLAG = 0x1,
719 /** Navigation is currently running. */
720 VEHICLE_AUDIO_CONTEXT_NAVIGATION_FLAG = 0x2,
721 /** Voice command session is currently running. */
722 VEHICLE_AUDIO_CONTEXT_VOICE_COMMAND_FLAG = 0x4,
723 /** Voice call is currently active. */
724 VEHICLE_AUDIO_CONTEXT_CALL_FLAG = 0x8,
725 /** Alarm is active. This may be only used in VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY. */
726 VEHICLE_AUDIO_CONTEXT_ALARM_FLAG = 0x10,
727 /**
728 * Notification sound is active. This may be only used in VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY.
729 */
730 VEHICLE_AUDIO_CONTEXT_NOTIFICATION_FLAG = 0x20,
731 /**
732 * Context unknown. Only used for VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY to represent default
733 * stream for unknown contents.
734 */
735 VEHICLE_AUDIO_CONTEXT_UNKNOWN_FLAG = 0x40,
736 /** Safety alert / warning is played. */
737 VEHICLE_AUDIO_CONTEXT_SAFETY_ALERT_FLAG = 0x80,
738 /** CD / DVD kind of audio is played */
Keun-young Park9f376f52016-03-03 17:47:18 -0800739 VEHICLE_AUDIO_CONTEXT_CD_ROM_FLAG = 0x100,
Keun-young Parkfe599a82016-02-12 14:26:57 -0800740 /** Aux audio input is played */
Keun-young Park9f376f52016-03-03 17:47:18 -0800741 VEHICLE_AUDIO_CONTEXT_AUX_AUDIO_FLAG = 0x200,
Keun-young Parkfe599a82016-02-12 14:26:57 -0800742 /** system sound like UI feedback */
Keun-young Park9f376f52016-03-03 17:47:18 -0800743 VEHICLE_AUDIO_CONTEXT_SYSTEM_SOUND_FLAG = 0x400,
Keun-young Parkfe599a82016-02-12 14:26:57 -0800744 /** Radio is played */
Keun-young Park9f376f52016-03-03 17:47:18 -0800745 VEHICLE_AUDIO_CONTEXT_RADIO_FLAG = 0x800,
Keun-young Park726122a2016-06-28 12:54:47 -0700746 /** Ext source is played. This is for tagging generic ext sources. */
747 VEHICLE_AUDIO_CONTEXT_EXT_SOURCE_FLAG = 0x1000,
Sanket Agarwalfb636682015-08-11 14:34:29 -0700748};
749
750/**
Keun-young Parkbf877a72015-12-21 14:16:05 -0800751 * Property to control audio volume of each audio context.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700752 *
Keun-young Park12a3c012016-03-23 17:58:29 -0700753 * vehicle_prop_config_t
754 * config_array[0] : bit flags of all supported audio contexts. If this is 0,
755 * audio volume is controlled per physical stream
756 * config_array[1] : flags defined in vehicle_audio_volume_capability_flag to
757 * represent audio module's capability.
758 *
Sanket Agarwalfb636682015-08-11 14:34:29 -0700759 * Data type looks like:
Keun-young Park12a3c012016-03-23 17:58:29 -0700760 * int32_array[0] : stream context as defined in vehicle_audio_context_flag. If only physical
761 stream is supported (config_array[0] == 0), this will represent physical
762 stream number.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700763 * int32_array[1] : volume level, valid range is 0 to int32_max_value defined in config.
764 * 0 will be mute state. int32_min_value in config should be always 0.
765 * int32_array[2] : One of vehicle_audio_volume_state.
766 *
767 * This property requires per stream based get. HAL implementation should check stream number
768 * in get call to return the right volume.
769 *
770 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC3
771 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
772 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -0800773 * @config_flags all audio contexts supported.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700774 * @data_member int32_array
775 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700776#define VEHICLE_PROPERTY_AUDIO_VOLUME (0x00000901)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700777
Keun-young Park12a3c012016-03-23 17:58:29 -0700778
779/**
780 * flags to represent capability of audio volume property.
781 * used in config_array[1] of vehicle_prop_config_t.
782 */
783enum vehicle_audio_volume_capability_flag {
784 /**
785 * External audio module or vehicle hal has persistent storage
786 * to keep the volume level. This should be set only when per context
787 * volume level is supproted. When this is set, audio volume level per
788 * each context will be retrieved from the property when systen starts up.
789 * And external audio module is also expected to adjust volume automatically
790 * whenever there is an audio context change.
791 * When this flag is not set, android side will assume that there is no
792 * persistent storage and stored value in android side will be used to
793 * initialize the volume level. And android side will set volume level
794 * of each physical streams whenever there is an audio context change.
795 */
796 VEHICLE_AUDIO_VOLUME_CAPABILITY_PERSISTENT_STORAGE = 0x1,
Keun-young Parke086bd72016-05-24 09:41:54 -0700797 /**
798 * When this flag is set, the H/W can support only single master volume for all streams.
799 * There is no way to set volume level differently per each stream or context.
800 */
801 VEHICLE_AUDIO_VOLUME_CAPABILITY_MASTER_VOLUME_ONLY = 0x2,
Keun-young Park12a3c012016-03-23 17:58:29 -0700802};
803
Steve Paikcc9e2922016-04-21 11:40:17 -0700804
Sanket Agarwalfb636682015-08-11 14:34:29 -0700805/**
806 * enum to represent audio volume state.
807 */
808enum vehicle_audio_volume_state {
809 VEHICLE_AUDIO_VOLUME_STATE_OK = 0,
810 /**
811 * Audio volume has reached volume limit set in VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT
812 * and user's request to increase volume further is not allowed.
813 */
814 VEHICLE_AUDIO_VOLUME_STATE_LIMIT_REACHED = 1,
815};
816
817/**
818 * Index in int32_array for VEHICLE_PROPERTY_AUDIO_VOLUME property.
819 */
820enum vehicle_audio_volume_index {
821 VEHICLE_AUDIO_VOLUME_INDEX_STREAM = 0,
822 VEHICLE_AUDIO_VOLUME_INDEX_VOLUME = 1,
823 VEHICLE_AUDIO_VOLUME_INDEX_STATE = 2,
824};
825
826/**
827 * Property for handling volume limit set by user. This limits maximum volume that can be set
Keun-young Park12a3c012016-03-23 17:58:29 -0700828 * per each context or physical stream.
829 *
830 * vehicle_prop_config_t
831 * config_array[0] : bit flags of all supported audio contexts. If this is 0,
832 * audio volume is controlled per physical stream
833 * config_array[1] : flags defined in vehicle_audio_volume_capability_flag to
834 * represent audio module's capability.
835 *
836 * Data type looks like:
837 * int32_array[0] : stream context as defined in vehicle_audio_context_flag. If only physical
838 * stream is supported (config_array[0] == 0), this will represent physical
839 * stream number.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700840 * int32_array[1] : maximum volume set to the stream. If there is no restriction, this value
841 * will be bigger than VEHICLE_PROPERTY_AUDIO_VOLUME's max value.
842 *
843 * If car does not support this feature, this property should not be populated by HAL.
844 * This property requires per stream based get. HAL implementation should check stream number
845 * in get call to return the right volume.
846 *
847 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
848 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
849 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -0800850 * @config_flags all audio contexts supported.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700851 * @data_member int32_array
852 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700853#define VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT (0x00000902)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700854
855/**
856 * Index in int32_array for VEHICLE_PROPERTY_AUDIO_VOLUME_LIMIT property.
857 */
858enum vehicle_audio_volume_limit_index {
859 VEHICLE_AUDIO_VOLUME_LIMIT_INDEX_STREAM = 0,
860 VEHICLE_AUDIO_VOLUME_LIMIT_INDEX_MAX_VOLUME = 1,
861};
862
863/**
864 * Property to share audio routing policy of android side. This property is set at the beginning
865 * to pass audio policy in android side down to vehicle HAL and car audio module.
866 * This can be used as a hint to adjust audio policy or other policy decision.
867 *
868 * int32_array[0] : audio stream where the audio for the application context will be routed
869 * by default. Note that this is the default setting from system, but each app
870 * may still use different audio stream for whatever reason.
Keun-young Parkbf877a72015-12-21 14:16:05 -0800871 * int32_array[1] : All audio contexts that will be sent through the physical stream. Flag
872 * is defined in vehicle_audio_context_flag.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700873
874 * Setting of this property will be done for all available physical streams based on audio H/W
875 * variant information acquired from VEHICLE_PROPERTY_AUDIO_HW_VARIANT property.
876 *
877 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
878 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
879 * @access VEHICLE_PROP_ACCESS_WRITE
880 * @data_member int32_array
881 */
Steve Paikcc9e2922016-04-21 11:40:17 -0700882#define VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY (0x00000903)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700883
884/**
885 * Index in int32_array for VEHICLE_PROPERTY_AUDIO_ROUTING_POLICY property.
886 */
887enum vehicle_audio_routing_policy_index {
888 VEHICLE_AUDIO_ROUTING_POLICY_INDEX_STREAM = 0,
889 VEHICLE_AUDIO_ROUTING_POLICY_INDEX_CONTEXTS = 1,
890};
891
892/**
893* Property to return audio H/W variant type used in this car. This allows android side to
894* support different audio policy based on H/W variant used. Note that other components like
895* CarService may need overlay update to support additional variants. If this property does not
896* exist, default audio policy will be used.
897*
898* @value_type VEHICLE_VALUE_TYPE_INT32
899* @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
900* @access VEHICLE_PROP_ACCESS_READ
Keun-young Parkbf877a72015-12-21 14:16:05 -0800901* @config_flags Additional info on audio H/W. Should use vehicle_audio_hw_variant_config_flag for
902* this.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700903* @data_member int32_value
904*/
Steve Paikcc9e2922016-04-21 11:40:17 -0700905#define VEHICLE_PROPERTY_AUDIO_HW_VARIANT (0x00000904)
Sanket Agarwalfb636682015-08-11 14:34:29 -0700906
907/**
908 * Flag to be used in vehicle_prop_config.config_flags for VEHICLE_PROPERTY_AUDIO_HW_VARIANT.
909 */
910enum vehicle_audio_hw_variant_config_flag {
911 /**
Keun-young Park637fb202016-03-29 09:52:41 -0700912 * Flag to tell that radio is internal to android and radio should
913 * be treated like other android stream like media.
914 * When this flag is not set or AUDIO_HW_VARIANT does not exist,
915 * radio is treated as external module. This brins some delta in audio focus
916 * handling as well.
Sanket Agarwalfb636682015-08-11 14:34:29 -0700917 */
Keun-young Park637fb202016-03-29 09:52:41 -0700918 VEHICLE_AUDIO_HW_VARIANT_FLAG_INTERNAL_RADIO_FLAG = 0x1,
Sanket Agarwalfb636682015-08-11 14:34:29 -0700919};
920
Keun-young Park726122a2016-06-28 12:54:47 -0700921/** audio routing for AM/FM. This should be also be the value when there is only one
922 radio module in the system. */
923#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_AM_FM "RADIO_AM_FM"
924/** Should be added only when there is a separate radio module with HD capability. */
925#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_AM_FM_HD "RADIO_AM_FM_HD"
926/** For digial audio broadcasting type of radio */
927#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_DAB "RADIO_DAB"
928/** For satellite type of radio */
929#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_RADIO_SATELLITE "RADIO_SATELLITE"
930/** For CD or DVD */
931#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_CD_DVD "CD_DVD"
932/** For 1st auxiliary input */
933#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_AUX_IN0 "AUX_IN0"
934/** For 2nd auxiliary input */
935#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_AUX_IN1 "AUX_IN1"
936/** For navigation guidance from outside android */
937#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_NAV_GUIDANCE "EXT_NAV_GUIDANCE"
938/** For voice command from outside android */
939#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_VOICE_COMMAND "EXT_VOICE_COMMAND"
940/** For voice call from outside android */
941#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_VOICE_CALL "EXT_VOICE_CALL"
942/** For safety alert from outside android */
943#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_EXT_SAFETY_ALERT "EXT_SAFETY_ALERT"
944
945/**
946* Property to pass hint on external audio routing. When android side request focus
947* with VEHICLE_AUDIO_EXT_FOCUS_CAR_PLAY_ONLY_FLAG flag, this property will be set
948* before setting AUDIO_FOCUS property as a hint for external audio source routing.
949* Note that setting this property alone should not trigger any change.
950* Audio routing should be changed only when AUDIO_FOCUS property is set. Note that
951* this property allows passing custom value as long as it is defined in config_string.
952* This allows supporting non-standard routing options through this property.
953* It is recommended to use separate name space for custom property to prevent conflict in future
954* android releases.
955* Enabling each external routing option is done by enabling each bit flag for the routing.
956* This property can support up to 128 external routings.
957* To give full flexibility, there is no standard definition for each bit flag and
958* assigning each big flag to specific routing type is decided by config_string.
959* config_string has format of each entry separated by ','
960* and each entry has format of bitFlagPositon:typeString[:physicalStreamNumber].
961* bitFlagPosition: represents which big flag will be set to enable this routing. 0 means
962* LSB in int32_array[0]. 31 will be MSB in int32_array[0]. 127 will MSB in int32_array[3].
963* typeString: string representation of external routing. Some types are already defined
964* in VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_SOURCE_* and use them first before adding something
965* custom. Applications will find each routing using this string.
966* physicalStreamNumber: This part is optional and represents physical stream to android
967* which will be disabled when this routing is enabled. If not specified, this routing
968* should not affect physical streams to android.
969* As an example, let's assume a system with two physical streams, 0 for media and 1 for
970* nav guidance. And let's assume external routing option of am fm radio, external navigation
971* guidance, satellite radio, and one custom. Let's assume that radio and satellite replaces
972* physical stream 0 and external navigation replaces physical stream 1. And bit flag will be
973* assigned in the order listed above. This configuration will look like this in config_string:
974* "0:RADIO_AM_FM:0,1:EXT_NAV_GUIDANCE:1,2:RADIO_SATELLITE:0,3:com.test.SOMETHING_CUSTOM"
975* When android requests RADIO_AM_FM, int32_array[0] will be set to 0x1.
976* When android requests RADIO_SATELLITE + EXT_NAV_GUIDANCE, int32_array[0] will be set to 0x2|0x4.
977*
978* @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
979* @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
980* @access VEHICLE_PROP_ACCESS_WRITE|VEHICLE_PROP_ACCESS_READ_WRITE
981* @config_string List of all avaiable external source in the system.
982* @data_member int32_array
983*/
984#define VEHICLE_PROPERTY_AUDIO_EXT_ROUTING_HINT (0x00000905)
Keun-young Parkcb8c8872016-01-08 09:41:19 -0800985
986/**
Sanket Agarwalfb636682015-08-11 14:34:29 -0700987 * Property to control power state of application processor.
988 *
989 * It is assumed that AP's power state is controller by separate power controller.
990 *
991 * For configuration information, vehicle_prop_config.config_flags can have bit flag combining
992 * values in vehicle_ap_power_state_config_type.
993 *
994 * For get / notification, data type looks like this:
995 * int32_array[0] : vehicle_ap_power_state_type
996 * int32_array[1] : additional parameter relevant for each state. should be 0 if not used.
997 * For set, data type looks like this:
998 * int32_array[0] : vehicle_ap_power_state_set_type
999 * int32_array[1] : additional parameter relevant for each request. should be 0 if not used.
1000 *
1001 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC2
1002 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1003 * @access VEHICLE_PROP_ACCESS_READ_WRITE
Keun-young Parkbf877a72015-12-21 14:16:05 -08001004 * @config_flags Additional info on power state. Should use vehicle_ap_power_state_config_flag.
Sanket Agarwalfb636682015-08-11 14:34:29 -07001005 * @data_member int32_array
1006 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001007#define VEHICLE_PROPERTY_AP_POWER_STATE (0x00000A00)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001008
1009enum vehicle_ap_power_state_config_flag {
1010 /**
1011 * AP can enter deep sleep state. If not set, AP will always shutdown from
1012 * VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE power state.
1013 */
1014 VEHICLE_AP_POWER_STATE_CONFIG_ENABLE_DEEP_SLEEP_FLAG = 0x1,
1015
1016 /**
1017 * The power controller can power on AP from off state after timeout specified in
1018 * VEHICLE_AP_POWER_SET_SHUTDOWN_READY message.
1019 */
1020 VEHICLE_AP_POWER_STATE_CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2,
1021};
1022
1023enum vehicle_ap_power_state {
1024 /** vehicle HAL will never publish this state to AP */
1025 VEHICLE_AP_POWER_STATE_OFF = 0,
1026 /** vehicle HAL will never publish this state to AP */
1027 VEHICLE_AP_POWER_STATE_DEEP_SLEEP = 1,
1028 /** AP is on but display should be off. */
1029 VEHICLE_AP_POWER_STATE_ON_DISP_OFF = 2,
1030 /** AP is on with display on. This state allows full user interaction. */
1031 VEHICLE_AP_POWER_STATE_ON_FULL = 3,
1032 /**
1033 * The power controller has requested AP to shutdown. AP can either enter sleep state or start
1034 * full shutdown. AP can also request postponing shutdown by sending
1035 * VEHICLE_AP_POWER_SET_SHUTDOWN_POSTPONE message. The power controller should change power
1036 * state to this state to shutdown system.
1037 *
1038 * int32_array[1] : one of enum_vehicle_ap_power_state_shutdown_param_type
1039 */
1040 VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE = 4,
1041};
1042
1043enum vehicle_ap_power_state_shutdown_param {
1044 /** AP should shutdown immediately. Postponing is not allowed. */
1045 VEHICLE_AP_POWER_SHUTDOWN_PARAM_SHUTDOWN_IMMEDIATELY = 1,
1046 /** AP can enter deep sleep instead of shutting down completely. */
1047 VEHICLE_AP_POWER_SHUTDOWN_PARAM_CAN_SLEEP = 2,
1048 /** AP can only shutdown with postponing allowed. */
1049 VEHICLE_AP_POWER_SHUTDOWN_PARAM_SHUTDOWN_ONLY = 3,
1050};
1051
1052enum vehicle_ap_power_set_state {
1053 /**
1054 * AP has finished boot up, and can start shutdown if requested by power controller.
1055 */
1056 VEHICLE_AP_POWER_SET_BOOT_COMPLETE = 0x1,
1057 /**
1058 * AP is entering deep sleep state. How this state is implemented may vary depending on
1059 * each H/W, but AP's power should be kept in this state.
1060 */
1061 VEHICLE_AP_POWER_SET_DEEP_SLEEP_ENTRY = 0x2,
1062 /**
1063 * AP is exiting from deep sleep state, and is in VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE state.
1064 * The power controller may change state to other ON states based on the current state.
1065 */
1066 VEHICLE_AP_POWER_SET_DEEP_SLEEP_EXIT = 0x3,
1067 /**
1068 * int32_array[1]: Time to postpone shutdown in ms. Maximum value can be 5000 ms.
1069 * If AP needs more time, it will send another POSTPONE message before
1070 * the previous one expires.
1071 */
1072 VEHICLE_AP_POWER_SET_SHUTDOWN_POSTPONE = 0x4,
1073 /**
1074 * AP is starting shutting down. When system completes shutdown, everything will stop in AP
1075 * as kernel will stop all other contexts. It is responsibility of vehicle HAL or lower level
1076 * to synchronize that state with external power controller. As an example, some kind of ping
1077 * with timeout in power controller can be a solution.
1078 *
1079 * int32_array[1]: Time to turn on AP in secs. Power controller may turn on AP after specified
1080 * time so that AP can run tasks like update. If it is set to 0, there is no
1081 * wake up, and power controller may not necessarily support wake-up.
1082 * If power controller turns on AP due to timer, it should start with
1083 * VEHICLE_AP_POWER_STATE_ON_DISP_OFF state, and after receiving
1084 * VEHICLE_AP_POWER_SET_BOOT_COMPLETE, it shall do state transition to
1085 * VEHICLE_AP_POWER_STATE_SHUTDOWN_PREPARE.
1086 */
1087 VEHICLE_AP_POWER_SET_SHUTDOWN_START = 0x5,
1088 /**
1089 * User has requested to turn off headunit's display, which is detected in android side.
1090 * The power controller may change the power state to VEHICLE_AP_POWER_STATE_ON_DISP_OFF.
1091 */
1092 VEHICLE_AP_POWER_SET_DISPLAY_OFF = 0x6,
1093 /**
1094 * User has requested to turn on headunit's display, most probably from power key input which
1095 * is attached to headunit. The power controller may change the power state to
1096 * VEHICLE_AP_POWER_STATE_ON_FULL.
1097 */
1098 VEHICLE_AP_POWER_SET_DISPLAY_ON = 0x7,
1099};
1100
1101/**
1102 * Property to represent brightness of the display. Some cars have single control for
1103 * the brightness of all displays and this property is to share change in that control.
1104 *
1105 * If this is writable, android side can set this value when user changes display brightness
1106 * from Settings. If this is read only, user may still change display brightness from Settings,
1107 * but that will not be reflected to other displays.
1108 *
1109 * @value_type VEHICLE_VALUE_TYPE_INT32
1110 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1111 * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_READ_WRITE
1112 * @data_member int32
1113 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001114#define VEHICLE_PROPERTY_DISPLAY_BRIGHTNESS (0x00000A01)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001115
1116
1117/**
1118 * Index in int32_array for VEHICLE_PROPERTY_AP_POWER_STATE property.
1119 */
1120enum vehicle_ap_power_state_index {
1121 VEHICLE_AP_POWER_STATE_INDEX_STATE = 0,
1122 VEHICLE_AP_POWER_STATE_INDEX_ADDITIONAL = 1,
1123};
1124
1125/**
1126* Property to report bootup reason for the current power on. This is a static property that will
1127* not change for the whole duration until power off. For example, even if user presses power on
1128* button after automatic power on with door unlock, bootup reason should stay with
1129* VEHICLE_AP_POWER_BOOTUP_REASON_USER_UNLOCK.
1130*
1131* int32_value should be vehicle_ap_power_bootup_reason.
1132*
1133* @value_type VEHICLE_VALUE_TYPE_INT32
1134* @change_mode VEHICLE_PROP_CHANGE_MODE_STATIC
1135* @access VEHICLE_PROP_ACCESS_READ
1136* @data_member int32_value
1137*/
1138#define VEHICLE_PROPERTY_AP_POWER_BOOTUP_REASON (0x00000A02)
1139
1140/**
1141 * Enum to represent bootup reason.
1142 */
1143enum vehicle_ap_power_bootup_reason {
1144 /**
1145 * Power on due to user's pressing of power key or rotating of ignition switch.
1146 */
1147 VEHICLE_AP_POWER_BOOTUP_REASON_USER_POWER_ON = 0,
1148 /**
1149 * Automatic power on triggered by door unlock or any other kind of automatic user detection.
1150 */
1151 VEHICLE_AP_POWER_BOOTUP_REASON_USER_UNLOCK = 1,
1152 /**
1153 * Automatic power on triggered by timer. This only happens when AP has asked wake-up after
1154 * certain time through time specified in VEHICLE_AP_POWER_SET_SHUTDOWN_START.
1155 */
1156 VEHICLE_AP_POWER_BOOTUP_REASON_TIMER = 2,
1157};
1158
Keun-young Parkcb354502016-02-08 18:15:55 -08001159
1160/**
1161 * Property to feed H/W input events to android
1162 *
1163 * int32_array[0] : action defined by vehicle_hw_key_input_action
1164 * int32_array[1] : key code, should use standard android key code
1165 * int32_array[2] : target display defined in vehicle_display. Events not tied
1166 * to specific display should be sent to DISPLAY_MAIN.
1167 * int32_array[3] : reserved for now. should be zero
1168 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
1169 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1170 * @access VEHICLE_PROP_ACCESS_READ
1171 * @config_flags
1172 * @data_member int32_array
1173 */
1174#define VEHICLE_PROPERTY_HW_KEY_INPUT (0x00000A10)
1175
1176enum vehicle_hw_key_input_action {
1177 /** Key down */
1178 VEHICLE_HW_KEY_INPUT_ACTION_DOWN = 0,
1179 /** Key up */
1180 VEHICLE_HW_KEY_INPUT_ACTION_UP = 1,
1181};
1182
1183enum vehicle_display {
1184 /** center console */
1185 VEHICLE_DISPLAY_MAIN = 0,
1186 VEHICLE_DISPLAY_INSTRUMENT_CLUSTER = 1,
1187};
1188
Sanket Agarwalfb636682015-08-11 14:34:29 -07001189/**
Keun-young Parkfe599a82016-02-12 14:26:57 -08001190 * Property to define instrument cluster information.
1191 * For CLUSTER_TYPE_EXTERNAL_DISPLAY:
1192 * READ:
1193 * int32_array[0] : The current screen mode index. Screen mode is defined
1194 * as a configuration in car service and represents which
1195 * area of screen is renderable.
1196 * int32_array[1] : Android can render to instrument cluster (=1) or not(=0). When this is 0,
1197 * instrument cluster may be rendering some information in the area
1198 * allocated for android and android side rendering is invisible. *
1199 * int32_array[2..3] : should be zero
1200 * WRITE from android:
1201 * int32_array[0] : Preferred mode for android side. Depending on the app rendering to instrument
1202 * cluster, preferred mode can change. Instrument cluster still needs to send
1203 * event with new mode to trigger actual mode change.
1204 * int32_array[1] : The current app context relevant for instrument cluster. Use the same flag
1205 * with vehicle_audio_context_flag but this context represents active apps, not
1206 * active audio. Instrument cluster side may change mode depending on the
1207 * currently active contexts.
1208 * int32_array[2..3] : should be zero
1209 * When system boots up, Android side will write {0, 0, 0, 0} when it is ready to render to
1210 * instrument cluster. Before this message, rendering from android should not be visible in the
1211 * cluster.
1212 * @value_type VEHICLE_VALUE_TYPE_INT32_VEC4
1213 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1214 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1215 * @config_array 0:vehicle_instument_cluster_type 1:hw type
1216 * @data_member int32_array
1217 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001218#define VEHICLE_PROPERTY_INSTRUMENT_CLUSTER_INFO (0x00000A20)
Keun-young Parkfe599a82016-02-12 14:26:57 -08001219
1220/**
1221 * Represents instrument cluster type available in system
1222 */
1223enum vehicle_instument_cluster_type {
1224 /** Android has no access to instument cluster */
1225 VEHICLE_INSTRUMENT_CLUSTER_TYPE_NONE = 0,
1226 /**
1227 * Instrument cluster can communicate through vehicle hal with additional
1228 * properties to exchange meta-data
1229 */
1230 VEHICLE_INSTRUMENT_CLUSTER_TYPE_HAL_INTERFACE = 1,
1231 /**
1232 * Instrument cluster is external display where android can render contents
1233 */
1234 VEHICLE_INSTRUMENT_CLUSTER_TYPE_EXTERNAL_DISPLAY = 2,
1235};
1236
Steve Paikd432fc02016-05-11 16:25:33 -07001237/**
1238 * Current date and time, encoded as Unix time.
1239 * This value denotes the number of seconds that have elapsed since 1/1/1970.
1240 *
1241 * @value_type VEHICLE_VALUE_TYPE_INT64
Keun-young Parkda3cb912016-05-12 11:21:04 -07001242 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_SET
Steve Paikd432fc02016-05-11 16:25:33 -07001243 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1244 * @data_member int64_value
1245 * @unit VEHICLE_UNIT_TYPE_SECS
1246 */
1247#define VEHICLE_PROPERTY_UNIX_TIME (0x00000A30)
1248
1249/**
1250 * Current time only.
1251 * Some vehicles may not keep track of date. This property only affects the current time, in
1252 * seconds during the day. Thus, the max value for this parameter is 86,400 (24 * 60 * 60)
1253 *
1254 * @value_type VEHICLE_VALUE_TYPE_INT32
Keun-young Parkda3cb912016-05-12 11:21:04 -07001255 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_SET
Steve Paikd432fc02016-05-11 16:25:33 -07001256 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1257 * @data_member int32_value
1258 * @unit VEHICLE_UNIT_TYPE_SECS
1259 */
1260#define VEHICLE_PROPERTY_CURRENT_TIME_IN_SECONDS (0x00000A31)
Steve Paikcc9e2922016-04-21 11:40:17 -07001261
Steve Paike588bae2016-06-29 17:06:16 -07001262
1263//==== Car Cabin Properties ====
Steve Paikcc9e2922016-04-21 11:40:17 -07001264/**
Steve Paike588bae2016-06-29 17:06:16 -07001265 * Most Car Cabin properties have both a MOVE and POSITION parameter associated with them.
Steve Paikcc9e2922016-04-21 11:40:17 -07001266 *
Steve Paike588bae2016-06-29 17:06:16 -07001267 * The MOVE parameter will start moving the device in the indicated direction. The magnitude
1268 * indicates the relative speed. For instance, setting the WINDOW_MOVE parameter to +1 will roll
1269 * the window up. Setting it to +2 (if available) will roll it up faster.
Steve Paikcc9e2922016-04-21 11:40:17 -07001270 *
Steve Paike588bae2016-06-29 17:06:16 -07001271 * The POSITION parameter will move the device to the desired position. For instance, if the
1272 * WINDOW_POS has a range of 0-100, then setting this parameter to 50 will open the window halfway.
1273 * Depending upon the initial position, the window may move up or down to the 50% value.
Steve Paikcc9e2922016-04-21 11:40:17 -07001274 *
Steve Paike588bae2016-06-29 17:06:16 -07001275 * OEMs may choose to implement one or both of the MOVE/POSITION parameters depending upon the
1276 * capability of the hardware.
1277 */
1278
1279// Doors
1280/**
1281 * Door position
1282 *
1283 * This is an integer in case a door may be set to a particular position. Max
1284 * value indicates fully open, min value (0) indicates fully closed.
1285 *
1286 * Some vehicles (minivans) can open the door electronically. Hence, the ability
1287 * to write this property.
1288 *
Steve Paikada16692016-07-07 17:08:39 -07001289 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paikcc9e2922016-04-21 11:40:17 -07001290 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
Steve Paike588bae2016-06-29 17:06:16 -07001291 * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_WRITE
1292 * @zone_type VEHICLE_DOOR
Steve Paikd432fc02016-05-11 16:25:33 -07001293 * @data_member int32_value
Steve Paikcc9e2922016-04-21 11:40:17 -07001294 */
Steve Paike588bae2016-06-29 17:06:16 -07001295#define VEHICLE_PROPERTY_DOOR_POS (0x00000B00)
Steve Paikcc9e2922016-04-21 11:40:17 -07001296
1297/**
Steve Paike588bae2016-06-29 17:06:16 -07001298 * Door move
1299 *
Steve Paikada16692016-07-07 17:08:39 -07001300 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001301 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1302 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1303 * @zone_type VEHICLE_DOOR
1304 * @data_member int32_value
1305 */
1306#define VEHICLE_PROPERTY_DOOR_MOVE (0x00000B01)
1307
1308
1309/**
1310 * Door lock
1311 *
1312 * 'true' indicates door is locked
1313 *
Steve Paikada16692016-07-07 17:08:39 -07001314 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -07001315 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1316 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1317 * @zone_type VEHICLE_DOOR
1318 * @data_member boolean_value
1319 */
1320#define VEHICLE_PROPERTY_DOOR_LOCK (0x00000B02)
1321
1322// Mirrors
1323/**
1324 * Mirror Z Position
1325 *
1326 * Positive value indicates tilt upwards, negative value is downwards
1327 *
Steve Paikada16692016-07-07 17:08:39 -07001328 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001329 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1330 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1331 * @zone_type VEHICLE_MIRROR
1332 * @data_member int32_value
1333 */
1334#define VEHICLE_PROPERTY_MIRROR_Z_POS (0x00000B40)
1335
1336/**
1337 * Mirror Z Move
1338 *
1339 * Positive value indicates tilt upwards, negative value is downwards
1340 *
Steve Paikada16692016-07-07 17:08:39 -07001341 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001342 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1343 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1344 * @zone_type VEHICLE_MIRROR
1345 * @data_member int32_value
1346 */
1347#define VEHICLE_PROPERTY_MIRROR_Z_MOVE (0x00000B41)
1348
1349/**
1350 * Mirror Y Position
1351 *
1352 * Positive value indicate tilt right, negative value is left
1353 *
Steve Paikada16692016-07-07 17:08:39 -07001354 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001355 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1356 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1357 * @zone_type VEHICLE_MIRROR
1358 * @data_member int32_value
1359 */
1360#define VEHICLE_PROPERTY_MIRROR_Y_POS (0x00000B42)
1361
1362/**
1363 * Mirror Y Move
1364 *
1365 * Positive value indicate tilt right, negative value is left
1366 *
Steve Paikada16692016-07-07 17:08:39 -07001367 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001368 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1369 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1370 * @zone_type VEHICLE_MIRROR
1371 * @data_member int32_value
1372 */
1373#define VEHICLE_PROPERTY_MIRROR_Y_MOVE (0x00000B43)
1374
1375/**
1376 * Mirror Lock
1377 *
1378 * True indicates mirror positions are locked and not changeable
1379 *
Steve Paikada16692016-07-07 17:08:39 -07001380 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -07001381 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1382 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1383 * @data_member boolean_value
1384 */
1385#define VEHICLE_PROPERTY_MIRROR_LOCK (0x00000B44)
1386
1387/**
Steve Paike588bae2016-06-29 17:06:16 -07001388 * Mirror Fold
1389 *
1390 * True indicates mirrors are folded
1391 *
Steve Paikada16692016-07-07 17:08:39 -07001392 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -07001393 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1394 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1395 * @data_member boolean_value
1396 */
Steve Paikbfbbb672016-07-08 16:12:38 -07001397#define VEHICLE_PROPERTY_MIRROR_FOLD (0x00000B45)
Steve Paike588bae2016-06-29 17:06:16 -07001398
1399// Seats
1400/**
1401 * Seat memory select
Steve Paikcc9e2922016-04-21 11:40:17 -07001402 *
1403 * This parameter selects the memory preset to use to select the seat position.
1404 * The minValue is always 0, and the maxValue determines the number of seat
1405 * positions available.
1406 *
1407 * For instance, if the driver's seat has 3 memory presets, the maxValue will be 3.
1408 * When the user wants to select a preset, the desired preset number (1, 2, or 3)
1409 * is set.
1410 *
Keun-young Park7cb258e2016-04-25 18:37:28 -07001411 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paikcc9e2922016-04-21 11:40:17 -07001412 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1413 * @access VEHICLE_PROP_ACCESS_WRITE
1414 * @zone_type VEHICLE_SEAT
Steve Paikd432fc02016-05-11 16:25:33 -07001415 * @data_member int32_value
Steve Paikcc9e2922016-04-21 11:40:17 -07001416 */
Steve Paike588bae2016-06-29 17:06:16 -07001417#define VEHICLE_PROPERTY_SEAT_MEMORY_SELECT (0x00000B80)
Steve Paikcc9e2922016-04-21 11:40:17 -07001418
1419/**
1420 * Seat memory set
1421 *
1422 * This setting allows the user to save the current seat position settings into
1423 * the selected preset slot. The maxValue for each seat position shall match
1424 * the maxValue for VEHICLE_PROPERTY_SEAT_MEMORY_SELECT.
1425 *
Keun-young Park7cb258e2016-04-25 18:37:28 -07001426 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paikcc9e2922016-04-21 11:40:17 -07001427 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1428 * @access VEHICLE_PROP_ACCESS_WRITE
1429 * @zone_type VEHICLE_SEAT
Steve Paikd432fc02016-05-11 16:25:33 -07001430 * @data_member int32_value
Steve Paikcc9e2922016-04-21 11:40:17 -07001431 */
Steve Paike588bae2016-06-29 17:06:16 -07001432#define VEHICLE_PROPERTY_SEAT_MEMORY_SET (0x00000B81)
1433
1434/**
1435 * Seatbelt buckled
1436 *
1437 * True indicates belt is buckled.
1438 *
1439 * Write access indicates automatic seat buckling capabilities. There are no known cars at this
1440 * time, but you never know...
1441 *
1442 * @value_type VEHICLE_VALUE_TYPE_ZONED_BOOLEAN
1443 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1444 * @access VEHICLE_PROP_ACCESS_READ|VEHICLE_PROP_ACCESS_WRITE
1445 * @zone_type VEHICLE_SEAT
1446 * @data_member boolean_value
1447 */
1448#define VEHICLE_PROPERTY_SEAT_BELT_BUCKLED (0x00000B82)
1449
1450/**
1451 * Seatbelt height position
1452 *
1453 * Adjusts the shoulder belt anchor point.
1454 * Max value indicates highest position
1455 * Min value indicates lowest position
1456 *
1457 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1458 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1459 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1460 * @zone_type VEHICLE_SEAT
1461 * @data_member int32_value
1462 */
1463#define VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_POS (0x00000B83)
1464
1465/**
1466 * Seatbelt height move
1467 *
1468 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1469 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1470 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1471 * @zone_type VEHICLE_SEAT
1472 * @data_member int32_value
1473 */
1474#define VEHICLE_PROPERTY_SEAT_BELT_HEIGHT_MOVE (0x00000B84)
1475
1476/**
1477 * Seat fore/aft position
1478 *
1479 * Sets the seat position forward (closer to steering wheel) and backwards.
1480 * Max value indicates closest to wheel, min value indicates most rearward
1481 * position.
1482 *
1483 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1484 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1485 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1486 * @zone_type VEHICLE_SEAT
1487 * @data_member int32_value
1488 */
1489#define VEHICLE_PROPERTY_SEAT_FORE_AFT_POS (0x00000B85)
1490
1491/**
1492 * Seat fore/aft move
1493 *
1494 * Moves the seat position forward and aft.
1495 *
1496 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1497 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1498 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1499 * @zone_type VEHICLE_SEAT
1500 * @data_member int32_value
1501 */
1502#define VEHICLE_PROPERTY_SEAT_FORE_AFT_MOVE (0x00000B86)
1503
1504/**
1505 * Seat backrest angle 1 position
1506 *
1507 * Backrest angle 1 is the actuator closest to the bottom of the seat.
1508 * Max value indicates angling forward towards the steering wheel.
1509 * Min value indicates full recline.
1510 *
1511 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1512 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1513 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1514 * @zone_type VEHICLE_SEAT
1515 * @data_member int32_value
1516 */
1517#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_POS (0x00000B87)
1518
1519/**
1520 * Seat backrest angle 1 move
1521 *
1522 * Moves the backrest forward or recline.
1523 *
1524 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1525 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1526 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1527 * @zone_type VEHICLE_SEAT
1528 * @data_member int32_value
1529 */
1530#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_1_MOVE (0x00000B88)
1531
1532/**
1533 * Seat backrest angle 2 position
1534 *
1535 * Backrest angle 2 is the next actuator up from the bottom of the seat.
1536 * Max value indicates angling forward towards the steering wheel.
1537 * Min value indicates full recline.
1538 *
1539 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1540 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1541 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1542 * @zone_type VEHICLE_SEAT
1543 * @data_member int32_value
1544 */
1545#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_POS (0x00000B89)
1546
1547/**
1548 * Seat backrest angle 2 move
1549 *
1550 * Moves the backrest forward or recline.
1551 *
1552 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1553 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1554 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1555 * @zone_type VEHICLE_SEAT
1556 * @data_member int32_value
1557 */
1558#define VEHICLE_PROPERTY_SEAT_BACKREST_ANGLE_2_MOVE (0x00000B8A)
1559
1560/**
1561 * Seat height position
1562 *
1563 * Sets the seat height.
1564 * Max value indicates highest position.
1565 * Min value indicates lowest position.
1566 *
1567 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1568 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1569 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1570 * @zone_type VEHICLE_SEAT
1571 * @data_member int32_value
1572 */
1573#define VEHICLE_PROPERTY_SEAT_HEIGHT_POS (0x00000B8B)
1574
1575/**
1576 * Seat height move
1577 *
1578 * Moves the seat height.
1579 *
1580 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1581 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1582 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1583 * @zone_type VEHICLE_SEAT
1584 * @data_member int32_value
1585 */
1586#define VEHICLE_PROPERTY_SEAT_HEIGHT_MOVE (0x00000B8C)
1587
1588/**
1589 * Seat depth position
1590 *
1591 * Sets the seat depth, distance from back rest to front edge of seat.
1592 * Max value indicates longest depth position.
1593 * Min value indicates shortest position.
1594 *
1595 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1596 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1597 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1598 * @zone_type VEHICLE_SEAT
1599 * @data_member int32_value
1600 */
1601#define VEHICLE_PROPERTY_SEAT_DEPTH_POS (0x00000B8D)
1602
1603/**
1604 * Seat depth move
1605 *
1606 * Adjusts the seat depth.
1607 *
1608 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1609 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1610 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1611 * @zone_type VEHICLE_SEAT
1612 * @data_member int32_value
1613 */
1614#define VEHICLE_PROPERTY_SEAT_DEPTH_MOVE (0x00000B8E)
1615
1616/**
1617 * Seat tilt position
1618 *
1619 * Sets the seat tilt.
1620 * Max value indicates front edge of seat higher than back edge.
1621 * Min value indicates front edge of seat lower than back edge.
1622 *
1623 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1624 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1625 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1626 * @zone_type VEHICLE_SEAT
1627 * @data_member int32_value
1628 */
1629#define VEHICLE_PROPERTY_SEAT_TILT_POS (0x00000B8F)
1630
1631/**
1632 * Seat tilt move
1633 *
1634 * Tilts the seat.
1635 *
1636 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1637 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1638 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1639 * @zone_type VEHICLE_SEAT
1640 * @data_member int32_value
1641 */
1642#define VEHICLE_PROPERTY_SEAT_TILT_MOVE (0x00000B90)
1643
1644/**
1645 * Lumber fore/aft position
1646 *
1647 * Pushes the lumbar support forward and backwards
1648 * Max value indicates most forward position.
1649 * Min value indicates most rearward position.
1650 *
1651 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1652 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1653 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1654 * @zone_type VEHICLE_SEAT
1655 * @data_member int32_value
1656 */
1657#define VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_POS (0x00000B91)
1658
1659/**
1660 * Lumbar fore/aft move
1661 *
1662 * Adjusts the lumbar support.
1663 *
1664 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1665 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1666 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1667 * @zone_type VEHICLE_SEAT
1668 * @data_member int32_value
1669 */
1670#define VEHICLE_PROPERTY_SEAT_LUMBAR_FORE_AFT_MOVE (0x00000B92)
1671
1672/**
1673 * Lumbar side support position
1674 *
1675 * Sets the amount of lateral lumbar support.
1676 * Max value indicates widest lumbar setting (i.e. least support)
1677 * Min value indicates thinnest lumbar setting.
1678 *
1679 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1680 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1681 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1682 * @zone_type VEHICLE_SEAT
1683 * @data_member int32_value
1684 */
1685#define VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_POS (0x00000B93)
1686
1687/**
1688 * Lumbar side support move
1689 *
1690 * Adjusts the amount of lateral lumbar support.
1691 *
1692 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1693 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1694 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1695 * @zone_type VEHICLE_SEAT
1696 * @data_member int32_value
1697 */
1698#define VEHICLE_PROPERTY_SEAT_LUMBAR_SIDE_SUPPORT_MOVE (0x00000B94)
1699
1700/**
1701 * Headrest height position
1702 *
1703 * Sets the headrest height.
1704 * Max value indicates tallest setting.
1705 * Min value indicates shortest setting.
1706 *
1707 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1708 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1709 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1710 * @zone_type VEHICLE_SEAT
1711 * @data_member int32_value
1712 */
1713#define VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_POS (0x00000B95)
1714
1715/**
1716 * Headrest heigh move
1717 *
1718 * Moves the headrest up and down.
1719 *
1720 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1721 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1722 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1723 * @zone_type VEHICLE_SEAT
1724 * @data_member int32_value
1725 */
1726#define VEHICLE_PROPERTY_SEAT_HEADREST_HEIGHT_MOVE (0x00000B96)
1727
1728/**
1729 * Headrest angle position
1730 *
1731 * Sets the angle of the headrest.
1732 * Max value indicates most upright angle.
1733 * Min value indicates shallowest headrest angle.
1734 *
1735 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1736 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1737 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1738 * @zone_type VEHICLE_SEAT
1739 * @data_member int32_value
1740 */
1741#define VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_POS (0x00000B97)
1742
1743/**
1744 * Headrest angle move
1745 *
1746 * Adjusts the angle of the headrest
1747 *
1748 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1749 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1750 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1751 * @zone_type VEHICLE_SEAT
1752 * @data_member int32_value
1753 */
1754#define VEHICLE_PROPERTY_SEAT_HEADREST_ANGLE_MOVE (0x00000B98)
1755
1756/**
1757 *
1758 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1759 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1760 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1761 * @zone_type VEHICLE_SEAT
1762 * @data_member int32_value
1763 */
1764#define VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_POS (0x00000B99)
1765
1766/**
1767 *
1768 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
1769 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1770 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1771 * @zone_type VEHICLE_SEAT
1772 * @data_member int32_value
1773 */
1774#define VEHICLE_PROPERTY_SEAT_HEADREST_FORE_AFT_MOVE (0x00000B9A)
1775
1776
1777// Windows
1778/**
1779 * Window Position
1780 *
1781 * Max = window up / closed
1782 * Min = window down / open
1783 *
Steve Paikada16692016-07-07 17:08:39 -07001784 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001785 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1786 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1787 * @data_member int32_value
1788 */
1789#define VEHICLE_PROPERTY_WINDOW_POS (0x00000BC0)
1790
1791/**
1792 * Window Move
1793 *
1794 * Max = window up / closed
1795 * Min = window down / open
1796 * Magnitude denotes relative speed. I.e. +2 is faster than +1 in raising the window.
1797 *
Steve Paikada16692016-07-07 17:08:39 -07001798 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001799 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1800 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1801 * @data_member int32_value
1802 */
1803#define VEHICLE_PROPERTY_WINDOW_MOVE (0x00000BC1)
1804
1805/**
1806 * Window Vent Position
1807 *
1808 * This feature is used to control the vent feature on a sunroof.
1809 *
1810 * Max = vent open
1811 * Min = vent closed
1812 *
Steve Paikada16692016-07-07 17:08:39 -07001813 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001814 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1815 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1816 * @data_member int32_value
1817 */
1818#define VEHICLE_PROPERTY_WINDOW_VENT_POS (0x00000BC2)
1819
1820/**
1821 * Window Vent Move
1822 *
1823 * This feature is used to control the vent feature on a sunroof.
1824 *
1825 * Max = vent open
1826 * Min = vent closed
1827 *
Steve Paikada16692016-07-07 17:08:39 -07001828 * @value_type VEHICLE_VALUE_TYPE_ZONED_INT32
Steve Paike588bae2016-06-29 17:06:16 -07001829 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1830 * @access VEHICLE_PROP_ACCESS_READ_WRITE|VEHICLE_PROP_ACCESS_WRITE
1831 * @data_member int32_value
1832 */
1833#define VEHICLE_PROPERTY_WINDOW_VENT_MOVE (0x00000BC3)
1834
1835/**
1836 * Window Lock
1837 *
1838 * True indicates windows are locked and can't be moved.
1839 *
Steve Paikada16692016-07-07 17:08:39 -07001840 * @value_type VEHICLE_VALUE_TYPE_BOOLEAN
Steve Paike588bae2016-06-29 17:06:16 -07001841 * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
1842 * @access VEHICLE_PROP_ACCESS_READ_WRITE
1843 * @data_member boolean_value
1844 */
1845#define VEHICLE_PROPERTY_WINDOW_LOCK (0x00000BC4)
1846
1847
Steve Paikcc9e2922016-04-21 11:40:17 -07001848
Keun-young Parkfe599a82016-02-12 14:26:57 -08001849/**
Sanket Agarwalfb636682015-08-11 14:34:29 -07001850 * H/W specific, non-standard property can be added as necessary. Such property should use
1851 * property number in range of [VEHICLE_PROPERTY_CUSTOM_START, VEHICLE_PROPERTY_CUSTOM_END].
1852 * Definition of property in this range is completely up to each HAL implementation.
1853 * For such property, it is recommended to fill vehicle_prop_config.config_string with some
1854 * additional information to help debugging. For example, company XYZ's custom extension may
1855 * include config_string of "com.XYZ.some_further_details".
1856 * @range_start
1857 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001858#define VEHICLE_PROPERTY_CUSTOM_START (0x70000000)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001859/** @range_end */
Steve Paikcc9e2922016-04-21 11:40:17 -07001860#define VEHICLE_PROPERTY_CUSTOM_END (0x73ffffff)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001861
1862/**
1863 * Property range allocated for system's internal usage like testing. HAL should never declare
1864 * property in this range.
1865 * @range_start
1866 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001867#define VEHICLE_PROPERTY_INTERNAL_START (0x74000000)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001868/**
1869 * @range_end
1870 */
Steve Paikcc9e2922016-04-21 11:40:17 -07001871#define VEHICLE_PROPERTY_INTERNAL_END (0x74ffffff)
Sanket Agarwalfb636682015-08-11 14:34:29 -07001872
1873/**
1874 * Value types for various properties.
1875 */
1876enum vehicle_value_type {
1877 VEHICLE_VALUE_TYPE_SHOUD_NOT_USE = 0x00, // value_type should never set to 0.
1878 VEHICLE_VALUE_TYPE_STRING = 0x01,
1879 VEHICLE_VALUE_TYPE_BYTES = 0x02,
1880 VEHICLE_VALUE_TYPE_BOOLEAN = 0x03,
Keun-young Park73d7f222016-01-14 11:02:38 -08001881 VEHICLE_VALUE_TYPE_ZONED_BOOLEAN = 0x04,
1882 VEHICLE_VALUE_TYPE_INT64 = 0x05,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001883 VEHICLE_VALUE_TYPE_FLOAT = 0x10,
1884 VEHICLE_VALUE_TYPE_FLOAT_VEC2 = 0x11,
1885 VEHICLE_VALUE_TYPE_FLOAT_VEC3 = 0x12,
1886 VEHICLE_VALUE_TYPE_FLOAT_VEC4 = 0x13,
1887 VEHICLE_VALUE_TYPE_INT32 = 0x20,
1888 VEHICLE_VALUE_TYPE_INT32_VEC2 = 0x21,
1889 VEHICLE_VALUE_TYPE_INT32_VEC3 = 0x22,
1890 VEHICLE_VALUE_TYPE_INT32_VEC4 = 0x23,
Keun-young Park73d7f222016-01-14 11:02:38 -08001891 VEHICLE_VALUE_TYPE_ZONED_FLOAT = 0x30,
1892 VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC2 = 0x31,
1893 VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC3 = 0x32,
Keun-young Parkab68e372016-03-10 16:28:42 -08001894 VEHICLE_VALUE_TYPE_ZONED_FLOAT_VEC4 = 0x33,
Keun-young Park73d7f222016-01-14 11:02:38 -08001895 VEHICLE_VALUE_TYPE_ZONED_INT32 = 0x40,
1896 VEHICLE_VALUE_TYPE_ZONED_INT32_VEC2 = 0x41,
1897 VEHICLE_VALUE_TYPE_ZONED_INT32_VEC3 = 0x42,
Keun-young Parkab68e372016-03-10 16:28:42 -08001898 VEHICLE_VALUE_TYPE_ZONED_INT32_VEC4 = 0x43,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001899};
1900
1901/**
1902 * Units used for int or float type with no attached enum types.
1903 */
1904enum vehicle_unit_type {
1905 VEHICLE_UNIT_TYPE_SHOULD_NOT_USE = 0x00000000,
1906 // speed related items
1907 VEHICLE_UNIT_TYPE_METER_PER_SEC = 0x00000001,
1908 VEHICLE_UNIT_TYPE_RPM = 0x00000002,
1909 VEHICLE_UNIT_TYPE_HZ = 0x00000003,
1910 // kind of ratio
1911 VEHICLE_UNIT_TYPE_PERCENTILE = 0x00000010,
1912 // length
1913 VEHICLE_UNIT_TYPE_MILLIMETER = 0x00000020,
1914 VEHICLE_UNIT_TYPE_METER = 0x00000021,
1915 VEHICLE_UNIT_TYPE_KILOMETER = 0x00000023,
1916 // temperature
Steve Paikbfbbb672016-07-08 16:12:38 -07001917 VEHICLE_UNIT_TYPE_CELSIUS = 0x00000030,
1918 VEHICLE_UNIT_TYPE_FAHRENHEIT = 0x00000031,
1919 VEHICLE_UNIT_TYPE_KELVIN = 0x00000032,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001920 // volume
1921 VEHICLE_UNIT_TYPE_MILLILITER = 0x00000040,
1922 // time
1923 VEHICLE_UNIT_TYPE_NANO_SECS = 0x00000050,
Steve Paikd432fc02016-05-11 16:25:33 -07001924 VEHICLE_UNIT_TYPE_SECS = 0x00000053,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001925 VEHICLE_UNIT_TYPE_YEAR = 0x00000059,
1926};
1927
1928/**
Sanket Agarwalfb636682015-08-11 14:34:29 -07001929 * This describes how value of property can change.
1930 */
1931enum vehicle_prop_change_mode {
1932 /**
1933 * Property of this type will *never* change. This property will not support subscription, but
1934 * will support get
1935 */
1936 VEHICLE_PROP_CHANGE_MODE_STATIC = 0x00,
1937 /**
Keun-young Parkda3cb912016-05-12 11:21:04 -07001938 * Property of this type will be reported when there is a change.
1939 * get call should return the current value.
1940 * Set operation for this property is assumed to be asynchronous. When the property is read
Keun-young Parke086bd72016-05-24 09:41:54 -07001941 * (get) after set, it may still return old value until underlying H/W backing this property
Keun-young Parkda3cb912016-05-12 11:21:04 -07001942 * has actually changed the state. Once state is changed, the property will dispatch changed
1943 * value as event.
Sanket Agarwalfb636682015-08-11 14:34:29 -07001944 */
1945 VEHICLE_PROP_CHANGE_MODE_ON_CHANGE = 0x01,
1946 /**
1947 * Property of this type change continuously and requires fixed rate of sampling to retrieve
1948 * the data.
1949 */
1950 VEHICLE_PROP_CHANGE_MODE_CONTINUOUS = 0x02,
Steve Paikd432fc02016-05-11 16:25:33 -07001951 /**
1952 * Property of this type may be polled to get the current value.
1953 */
1954 VEHICLE_PROP_CHANGE_MODE_POLL = 0x03,
Keun-young Parkda3cb912016-05-12 11:21:04 -07001955 /**
1956 * This is for property where change event should be sent only when the value is
1957 * set from external component. Normal value change will not trigger event.
1958 * For example, clock property can send change event only when it is set, outside android,
1959 * for case like user setting time or time getting update. There is no need to send it
1960 * per every value change.
1961 */
1962 VEHICLE_PROP_CHANGE_MODE_ON_SET = 0x04,
Sanket Agarwalfb636682015-08-11 14:34:29 -07001963};
1964
1965/**
1966 * Property config defines the capabilities of it. User of the API
1967 * should first get the property config to understand the output from get()
1968 * commands and also to ensure that set() or events commands are in sync with
1969 * the expected output.
1970 */
1971enum vehicle_prop_access {
1972 VEHICLE_PROP_ACCESS_READ = 0x01,
1973 VEHICLE_PROP_ACCESS_WRITE = 0x02,
1974 VEHICLE_PROP_ACCESS_READ_WRITE = 0x03
1975};
1976
1977/**
1978 * These permissions define how the OEMs want to distribute their information and security they
1979 * want to apply. On top of these restrictions, android will have additional
1980 * 'app-level' permissions that the apps will need to ask the user before the apps have the
1981 * information.
1982 * This information should be kept in vehicle_prop_config.permission_model.
1983 */
1984enum vehicle_permission_model {
1985 /**
1986 * No special restriction, but each property can still require specific android app-level
1987 * permission.
1988 */
1989 VEHICLE_PERMISSION_NO_RESTRICTION = 0,
1990 /** Signature only. Only APKs signed with OEM keys are allowed. */
1991 VEHICLE_PERMISSION_OEM_ONLY = 0x1,
1992 /** System only. APKs built-in to system can access the property. */
1993 VEHICLE_PERMISSION_SYSTEM_APP_ONLY = 0x2,
1994 /** Equivalent to “system|signature” */
1995 VEHICLE_PERMISSION_OEM_OR_SYSTEM_APP = 0x3
1996};
1997
Keun-young Park418c7e82016-04-06 10:44:20 -07001998
1999/**
2000 * Special values for INT32/FLOAT (including ZONED types)
2001 * These values represent special state, which is outside MIN/MAX range but can happen.
2002 * For example, HVAC temperature may use out of range min / max to represent that
2003 * it is working in full power although target temperature has separate min / max.
2004 * OUT_OF_RANGE_OFF can represent a state where the property is powered off.
2005 * Usually such property will have separate property to control power.
2006 */
2007
2008#define VEHICLE_INT_OUT_OF_RANGE_MAX (INT32_MAX)
2009#define VEHICLE_INT_OUT_OF_RANGE_MIN (INT32_MIN)
2010#define VEHICLE_INT_OUT_OF_RANGE_OFF (INT32_MIN + 1)
2011
2012#define VEHICLE_FLOAT_OUT_OF_RANGE_MAX (INFINITY)
2013#define VEHICLE_FLOAT_OUT_OF_RANGE_MIN (-INFINITY)
Keun-young Parkf1ccec12016-04-22 13:19:53 -07002014#define VEHICLE_FLOAT_OUT_OF_RANGE_OFF (NAN)
Keun-young Park418c7e82016-04-06 10:44:20 -07002015
Sanket Agarwalfb636682015-08-11 14:34:29 -07002016/**
2017 * Car states.
2018 *
2019 * The driving states determine what features of the UI will be accessible.
2020 */
2021enum vehicle_driving_status {
2022 VEHICLE_DRIVING_STATUS_UNRESTRICTED = 0x00,
2023 VEHICLE_DRIVING_STATUS_NO_VIDEO = 0x01,
2024 VEHICLE_DRIVING_STATUS_NO_KEYBOARD_INPUT = 0x02,
2025 VEHICLE_DRIVING_STATUS_NO_VOICE_INPUT = 0x04,
2026 VEHICLE_DRIVING_STATUS_NO_CONFIG = 0x08,
2027 VEHICLE_DRIVING_STATUS_LIMIT_MESSAGE_LEN = 0x10
2028};
2029
2030/**
2031 * Various gears which can be selected by user and chosen in system.
2032 */
2033enum vehicle_gear {
2034 // Gear selections present in both automatic and manual cars.
2035 VEHICLE_GEAR_NEUTRAL = 0x0001,
2036 VEHICLE_GEAR_REVERSE = 0x0002,
2037
2038 // Gear selections (mostly) present only in automatic cars.
Keun-young Park77761e22016-03-08 15:02:44 -08002039 VEHICLE_GEAR_PARK = 0x0004,
Sanket Agarwalfb636682015-08-11 14:34:29 -07002040 VEHICLE_GEAR_DRIVE = 0x0008,
Keun-young Park77761e22016-03-08 15:02:44 -08002041 VEHICLE_GEAR_LOW = 0x0010,
Sanket Agarwalfb636682015-08-11 14:34:29 -07002042
2043 // Other possible gear selections (maybe present in manual or automatic
2044 // cars).
2045 VEHICLE_GEAR_1 = 0x0010,
2046 VEHICLE_GEAR_2 = 0x0020,
2047 VEHICLE_GEAR_3 = 0x0040,
2048 VEHICLE_GEAR_4 = 0x0080,
2049 VEHICLE_GEAR_5 = 0x0100,
2050 VEHICLE_GEAR_6 = 0x0200,
2051 VEHICLE_GEAR_7 = 0x0400,
2052 VEHICLE_GEAR_8 = 0x0800,
2053 VEHICLE_GEAR_9 = 0x1000
2054};
2055
2056
2057/**
2058 * Various zones in the car.
2059 *
2060 * Zones are used for Air Conditioning purposes and divide the car into physical
2061 * area zones.
2062 */
2063enum vehicle_zone {
2064 VEHICLE_ZONE_ROW_1_LEFT = 0x00000001,
2065 VEHICLE_ZONE_ROW_1_CENTER = 0x00000002,
2066 VEHICLE_ZONE_ROW_1_RIGHT = 0x00000004,
2067 VEHICLE_ZONE_ROW_1_ALL = 0x00000008,
2068 VEHICLE_ZONE_ROW_2_LEFT = 0x00000010,
2069 VEHICLE_ZONE_ROW_2_CENTER = 0x00000020,
2070 VEHICLE_ZONE_ROW_2_RIGHT = 0x00000040,
2071 VEHICLE_ZONE_ROW_2_ALL = 0x00000080,
2072 VEHICLE_ZONE_ROW_3_LEFT = 0x00000100,
2073 VEHICLE_ZONE_ROW_3_CENTER = 0x00000200,
2074 VEHICLE_ZONE_ROW_3_RIGHT = 0x00000400,
2075 VEHICLE_ZONE_ROW_3_ALL = 0x00000800,
2076 VEHICLE_ZONE_ROW_4_LEFT = 0x00001000,
2077 VEHICLE_ZONE_ROW_4_CENTER = 0x00002000,
2078 VEHICLE_ZONE_ROW_4_RIGHT = 0x00004000,
2079 VEHICLE_ZONE_ROW_4_ALL = 0x00008000,
2080 VEHICLE_ZONE_ALL = 0x80000000,
2081};
2082
2083/**
2084 * Various Seats in the car.
2085 */
2086enum vehicle_seat {
Keun-young Parka384f832016-02-11 16:50:42 -08002087 VEHICLE_SEAT_DRIVER_LHD = 0x0001,
2088 VEHICLE_SEAT_DRIVER_RHD = 0x0002,
2089 VEHICLE_SEAT_ROW_1_PASSENGER_LEFT = 0x0010,
2090 VEHICLE_SEAT_ROW_1_PASSENGER_CENTER = 0x0020,
2091 VEHICLE_SEAT_ROW_1_PASSENGER_RIGHT = 0x0040,
2092 VEHICLE_SEAT_ROW_2_PASSENGER_LEFT = 0x0100,
2093 VEHICLE_SEAT_ROW_2_PASSENGER_CENTER = 0x0200,
2094 VEHICLE_SEAT_ROW_2_PASSENGER_RIGHT = 0x0400,
2095 VEHICLE_SEAT_ROW_3_PASSENGER_LEFT = 0x1000,
2096 VEHICLE_SEAT_ROW_3_PASSENGER_CENTER = 0x2000,
2097 VEHICLE_SEAT_ROW_3_PASSENGER_RIGHT = 0x4000
Sanket Agarwalfb636682015-08-11 14:34:29 -07002098};
2099
2100/**
2101 * Various windshields/windows in the car.
2102 */
2103enum vehicle_window {
2104 VEHICLE_WINDOW_FRONT_WINDSHIELD = 0x0001,
2105 VEHICLE_WINDOW_REAR_WINDSHIELD = 0x0002,
2106 VEHICLE_WINDOW_ROOF_TOP = 0x0004,
2107 VEHICLE_WINDOW_ROW_1_LEFT = 0x0010,
2108 VEHICLE_WINDOW_ROW_1_RIGHT = 0x0020,
2109 VEHICLE_WINDOW_ROW_2_LEFT = 0x0100,
2110 VEHICLE_WINDOW_ROW_2_RIGHT = 0x0200,
2111 VEHICLE_WINDOW_ROW_3_LEFT = 0x1000,
2112 VEHICLE_WINDOW_ROW_3_RIGHT = 0x2000,
2113};
2114
Keun-young Parkcb354502016-02-08 18:15:55 -08002115enum vehicle_door {
2116 VEHICLE_DOOR_ROW_1_LEFT = 0x00000001,
2117 VEHICLE_DOOR_ROW_1_RIGHT = 0x00000004,
2118 VEHICLE_DOOR_ROW_2_LEFT = 0x00000010,
2119 VEHICLE_DOOR_ROW_2_RIGHT = 0x00000040,
2120 VEHICLE_DOOR_ROW_3_LEFT = 0x00000100,
2121 VEHICLE_DOOR_ROW_3_RIGHT = 0x00000400,
2122 VEHICLE_DOOR_HOOD = 0x10000000,
2123 VEHICLE_DOOR_REAR = 0x20000000,
2124};
2125
2126enum vehicle_mirror {
2127 VEHICLE_MIRROR_DRIVER_LEFT = 0x00000001,
2128 VEHICLE_MIRROR_DRIVER_RIGHT = 0x00000002,
2129 VEHICLE_MIRROR_DRIVER_CENTER = 0x00000004,
2130};
Sanket Agarwalfb636682015-08-11 14:34:29 -07002131enum vehicle_turn_signal {
2132 VEHICLE_SIGNAL_NONE = 0x00,
2133 VEHICLE_SIGNAL_RIGHT = 0x01,
2134 VEHICLE_SIGNAL_LEFT = 0x02,
2135 VEHICLE_SIGNAL_EMERGENCY = 0x04
2136};
2137
2138/*
2139 * Boolean type.
2140 */
2141enum vehicle_boolean {
2142 VEHICLE_FALSE = 0x00,
2143 VEHICLE_TRUE = 0x01
2144};
2145
2146typedef int32_t vehicle_boolean_t;
2147
2148/**
2149 * Vehicle string.
2150 *
2151 * Defines a UTF8 encoded sequence of bytes that should be used for string
2152 * representation throughout.
2153 */
2154typedef struct vehicle_str {
2155 uint8_t* data;
2156 int32_t len;
2157} vehicle_str_t;
2158
2159/**
2160 * Vehicle byte array.
2161 * This is for passing generic raw data.
2162 */
2163typedef vehicle_str_t vehicle_bytes_t;
2164
Sanket Agarwalfb636682015-08-11 14:34:29 -07002165typedef struct vehicle_prop_config {
2166 int32_t prop;
2167
2168 /**
2169 * Defines if the property is read or write. Value should be one of
2170 * enum vehicle_prop_access.
2171 */
2172 int32_t access;
2173
2174 /**
2175 * Defines if the property is continuous or on-change. Value should be one
2176 * of enum vehicle_prop_change_mode.
2177 */
2178 int32_t change_mode;
2179
2180 /**
2181 * Type of data used for this property. This type is fixed per each property.
2182 * Check vehicle_value_type for allowed value.
2183 */
2184 int32_t value_type;
2185
2186 /**
2187 * Define necessary permission model to access the data.
2188 */
2189 int32_t permission_model;
Keun-young Parkab68e372016-03-10 16:28:42 -08002190
Sanket Agarwalfb636682015-08-11 14:34:29 -07002191 /**
2192 * Some of the properties may have associated zones (such as hvac), in these
2193 * cases the config should contain an ORed value for the associated zone.
2194 */
2195 union {
2196 /**
Sanket Agarwalfb636682015-08-11 14:34:29 -07002197 * The value is derived by ORing one or more of enum vehicle_zone members.
2198 */
2199 int32_t vehicle_zone_flags;
2200 /** The value is derived by ORing one or more of enum vehicle_seat members. */
2201 int32_t vehicle_seat_flags;
2202 /** The value is derived by ORing one or more of enum vehicle_window members. */
2203 int32_t vehicle_window_flags;
Keun-young Parkab68e372016-03-10 16:28:42 -08002204 };
Sanket Agarwalfb636682015-08-11 14:34:29 -07002205
Keun-young Parkab68e372016-03-10 16:28:42 -08002206 /**
2207 * Property specific configuration information. Usage of this will be defined per each property.
2208 */
2209 union {
2210 /**
2211 * For generic configuration information
2212 */
2213 int32_t config_flags;
Sanket Agarwalfb636682015-08-11 14:34:29 -07002214 /** The number of presets that are stored by the radio module. Pass 0 if
2215 * there are no presets available. The range of presets is defined to be
2216 * from 1 (see VEHICLE_RADIO_PRESET_MIN_VALUE) to vehicle_radio_num_presets.
2217 */
2218 int32_t vehicle_radio_num_presets;
Keun-young Parkbf877a72015-12-21 14:16:05 -08002219 int32_t config_array[4];
Sanket Agarwalfb636682015-08-11 14:34:29 -07002220 };
2221
2222 /**
2223 * Some properties may require additional information passed over this string. Most properties
2224 * do not need to set this and in that case, config_string.data should be NULL and
2225 * config_string.len should be 0.
2226 */
2227 vehicle_str_t config_string;
2228
2229 /**
2230 * Specify minimum allowed value for the property. This is necessary for property which does
2231 * not have specified enum.
2232 */
2233 union {
2234 float float_min_value;
2235 int32_t int32_min_value;
2236 int64_t int64_min_value;
2237 };
2238
2239 /**
2240 * Specify maximum allowed value for the property. This is necessary for property which does
2241 * not have specified enum.
2242 */
2243 union {
2244 float float_max_value;
2245 int32_t int32_max_value;
2246 int64_t int64_max_value;
2247 };
2248
2249 /**
Keun-young Parkfe599a82016-02-12 14:26:57 -08002250 * Array of min values for zoned properties. Zoned property can specify min / max value in two
2251 * different ways:
2252 * 1. All zones having the same min / max value: *_min/max_value should be set and this
2253 * array should be set to NULL.
2254 * 2. All zones having separate min / max value: *_min/max_values array should be populated
2255 * and its length should be the same as number of active zones specified by *_zone_flags.
Keun-young Parkab68e372016-03-10 16:28:42 -08002256 *
2257 * Should be NULL if each zone does not have separate max values.
Keun-young Parkfe599a82016-02-12 14:26:57 -08002258 */
2259 union {
2260 float* float_min_values;
2261 int32_t* int32_min_values;
2262 int64_t* int64_min_values;
2263 };
2264
2265 /**
2266 * Array of max values for zoned properties. See above for its usage.
Keun-young Parkab68e372016-03-10 16:28:42 -08002267 * Should be NULL if each zone does not have separate max values.
2268 * If not NULL, length of array should match that of min_values.
Keun-young Parkfe599a82016-02-12 14:26:57 -08002269 */
2270 union {
2271 float* float_max_values;
2272 int32_t* int32_max_values;
2273 int64_t* int64_max_values;
2274 };
2275
2276 /**
Sanket Agarwalfb636682015-08-11 14:34:29 -07002277 * Min sample rate in Hz. Should be 0 for sensor type of VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
2278 */
2279 float min_sample_rate;
2280 /**
2281 * Max sample rate in Hz. Should be 0 for sensor type of VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
2282 */
2283 float max_sample_rate;
2284 /**
2285 * Place holder for putting HAL implementation specific data. Usage is wholly up to HAL
2286 * implementation.
2287 */
2288 void* hal_data;
2289} vehicle_prop_config_t;
2290
2291/**
2292 * HVAC property fields.
2293 *
2294 * Defines various HVAC properties which are packed into vehicle_hvac_t (see
2295 * below). We define these properties outside in global scope so that HAL
2296 * implementation and HAL users (JNI) can typecast vehicle_hvac correctly.
2297 */
Sanket Agarwalfb636682015-08-11 14:34:29 -07002298typedef struct vehicle_hvac {
2299 /**
2300 * Define one structure for each possible HVAC property.
2301 * NOTES:
Keun-young Parkab68e372016-03-10 16:28:42 -08002302 * a) Fan speed is a number from (0 - 6) where 6 is the highest speed. (TODO define enum)
2303 * b) Temperature is a floating point Celcius scale.
2304 * c) Direction is defined in enum vehicle_fan_direction.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002305 *
2306 * The HAL should create #entries number of vehicle_hvac_properties and
2307 * assign it to "properties" variable below.
2308 */
2309 union {
Keun-young Parkab68e372016-03-10 16:28:42 -08002310 int32_t fan_speed;
2311 int32_t fan_direction;
2312 vehicle_boolean_t ac_on;
2313 vehicle_boolean_t max_ac_on;
2314 vehicle_boolean_t max_defrost_on;
2315 vehicle_boolean_t recirc_on;
2316 vehicle_boolean_t dual_on;
Steve Paik670e7ab2016-04-29 16:32:02 -07002317 vehicle_boolean_t auto_on;
Keun-young Park418c7e82016-04-06 10:44:20 -07002318 vehicle_boolean_t power_on;
Sanket Agarwalfb636682015-08-11 14:34:29 -07002319
Keun-young Parkab68e372016-03-10 16:28:42 -08002320 float temperature_current;
2321 float temperature_set;
Sanket Agarwalfb636682015-08-11 14:34:29 -07002322
Keun-young Parkab68e372016-03-10 16:28:42 -08002323 vehicle_boolean_t defrost_on;
Sanket Agarwalfb636682015-08-11 14:34:29 -07002324 };
2325} vehicle_hvac_t;
2326
2327/*
2328 * Defines how the values for various properties are represented.
2329 *
2330 * There are two ways to populate and access the fields:
2331 * a) Using the individual fields. Use this mechanism (see
2332 * info_manufacture_date, fuel_capacity fields etc).
2333 * b) Using the union accessors (see uint32_value, float_value etc).
2334 *
2335 * To add a new field make sure that it does not exceed the total union size
2336 * (defined in int_array) and it is one of the vehicle_value_type. Then add the
2337 * field name with its unit to union. If the field type is not yet defined (as
2338 * of this draft, we don't use int64_t) then add that type to vehicle_value_type
2339 * and have an accessor (so for int64_t it will be int64_t int64_value).
2340 */
2341typedef union vehicle_value {
2342 /** Define the max size of this structure. */
2343 int32_t int32_array[4];
2344 float float_array[4];
2345
2346 // Easy accessors for union members (HAL implementation SHOULD NOT USE these
2347 // fields while populating, use the property specific fields below instead).
2348 int32_t int32_value;
2349 int64_t int64_value;
2350 float float_value;
2351 vehicle_str_t str_value;
2352 vehicle_bytes_t bytes_value;
2353 vehicle_boolean_t boolean_value;
Sanket Agarwalfb636682015-08-11 14:34:29 -07002354
2355 // Vehicle Information.
2356 vehicle_str_t info_vin;
2357 vehicle_str_t info_make;
2358 vehicle_str_t info_model;
2359 int32_t info_model_year;
2360
2361 // Represented in milliliters.
2362 float info_fuel_capacity;
2363
2364 float vehicle_speed;
2365 float odometer;
2366
2367 // Engine sensors.
2368
2369 // Represented in milliliters.
2370 //float engine_coolant_level;
2371 // Represented in celcius.
2372 float engine_coolant_temperature;
2373 // Represented in a percentage value.
2374 //float engine_oil_level;
2375 // Represented in celcius.
2376 float engine_oil_temperature;
2377 float engine_rpm;
2378
2379 // Event sensors.
2380 // Value should be one of enum vehicle_gear_selection.
2381 int32_t gear_selection;
2382 // Value should be one of enum vehicle_gear.
2383 int32_t gear_current_gear;
2384 // Value should be one of enum vehicle_boolean.
2385 int32_t parking_brake;
2386 // If cruise_set_speed > 0 then cruise is ON otherwise cruise is OFF.
2387 // Unit: meters / second (m/s).
2388 //int32_t cruise_set_speed;
2389 // Value should be one of enum vehicle_boolean.
2390 int32_t is_fuel_level_low;
2391 // Value should be one of enum vehicle_driving_status.
2392 int32_t driving_status;
2393 int32_t night_mode;
2394 // Value should be one of emum vehicle_turn_signal.
2395 int32_t turn_signals;
2396 // Value should be one of enum vehicle_boolean.
2397 //int32_t engine_on;
2398
2399 // HVAC properties.
2400 vehicle_hvac_t hvac;
2401
2402 float outside_temperature;
Keun-young Parkcb354502016-02-08 18:15:55 -08002403 float cabin_temperature;
2404
Sanket Agarwalfb636682015-08-11 14:34:29 -07002405} vehicle_value_t;
2406
2407/*
2408 * Encapsulates the property name and the associated value. It
2409 * is used across various API calls to set values, get values or to register for
2410 * events.
2411 */
2412typedef struct vehicle_prop_value {
2413 /* property identifier */
2414 int32_t prop;
2415
2416 /* value type of property for quick conversion from union to appropriate
2417 * value. The value must be one of enum vehicle_value_type.
2418 */
2419 int32_t value_type;
2420
2421 /** time is elapsed nanoseconds since boot */
2422 int64_t timestamp;
2423
Keun-young Parkab68e372016-03-10 16:28:42 -08002424 /**
2425 * Zone information for zoned property. For non-zoned property, this should be ignored.
2426 */
2427 union {
2428 int32_t zone;
2429 int32_t seat;
2430 int32_t window;
2431 };
2432
Sanket Agarwalfb636682015-08-11 14:34:29 -07002433 vehicle_value_t value;
2434} vehicle_prop_value_t;
2435
2436/*
2437 * Event callback happens whenever a variable that the API user has subscribed
2438 * to needs to be reported. This may be based purely on threshold and frequency
2439 * (a regular subscription, see subscribe call's arguments) or when the set()
2440 * command is executed and the actual change needs to be reported.
2441 *
2442 * event_data is OWNED by the HAL and should be copied before the callback
2443 * finishes.
2444 */
2445typedef int (*vehicle_event_callback_fn)(const vehicle_prop_value_t *event_data);
2446
2447
2448/**
2449 * Represent the operation where the current error has happened.
2450 */
2451enum vehicle_property_operation {
2452 /** Generic error to this property which is not tied to any operation. */
2453 VEHICLE_OPERATION_GENERIC = 0,
2454 /** Error happened while handling property set. */
2455 VEHICLE_OPERATION_SET = 1,
2456 /** Error happened while handling property get. */
2457 VEHICLE_OPERATION_GET = 2,
2458 /** Error happened while handling property subscription. */
2459 VEHICLE_OPERATION_SUBSCRIBE = 3,
2460};
2461
2462/*
Keun-young Parkab68e372016-03-10 16:28:42 -08002463 * Suggests that an error condition has occurred.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002464 *
Keun-young Parkab68e372016-03-10 16:28:42 -08002465 * @param error_code Error code. error_code should be standard error code with
2466 * negative value like -EINVAL.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002467 * @parm property Note a property where error has happened. If this is generic error, property
2468 * should be VEHICLE_PROPERTY_INVALID.
2469 * @param operation Represent the operation where the error has happened. Should be one of
2470 * vehicle_property_operation.
2471 */
2472typedef int (*vehicle_error_callback_fn)(int32_t error_code, int32_t property, int32_t operation);
2473
2474/************************************************************************************/
2475
2476/*
2477 * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
2478 * and the fields of this data structure must begin with hw_module_t
2479 * followed by module specific information.
2480 */
2481typedef struct vehicle_module {
2482 struct hw_module_t common;
2483} vehicle_module_t;
2484
2485
2486typedef struct vehicle_hw_device {
2487 struct hw_device_t common;
2488
2489 /**
2490 * After calling open on device the user should register callbacks for event and error
2491 * functions.
2492 */
2493 int (*init)(struct vehicle_hw_device* device,
2494 vehicle_event_callback_fn event_fn, vehicle_error_callback_fn err_fn);
2495 /**
2496 * Before calling close the user should destroy the registered callback
2497 * functions.
2498 * In case the unsubscribe() call is not called on all properties before
2499 * release() then release() will unsubscribe the properties itself.
2500 */
2501 int (*release)(struct vehicle_hw_device* device);
2502
2503 /**
2504 * Enumerate all available properties. The list is returned in "list".
2505 * @param num_properties number of properties contained in the retuned array.
2506 * @return array of property configs supported by this car. Note that returned data is const
2507 * and caller cannot modify it. HAL implementation should keep this memory until HAL
2508 * is released to avoid copying this again.
2509 */
2510 vehicle_prop_config_t const *(*list_properties)(struct vehicle_hw_device* device,
2511 int* num_properties);
2512
2513 /**
2514 * Get a vehicle property value immediately. data should be allocated
2515 * properly.
2516 * The caller of the API OWNS the data field.
Keun-young Park08c255e2015-12-09 13:47:30 -08002517 * Caller will set data->prop, data->value_type, and optionally zone value for zoned property.
2518 * But HAL implementation needs to fill all entries properly when returning.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002519 * For pointer type, HAL implementation should allocate necessary memory and caller is
Keun-young Parkab68e372016-03-10 16:28:42 -08002520 * responsible for calling release_memory_from_get, which allows HAL to release allocated
2521 * memory.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002522 * For VEHICLE_PROP_CHANGE_MODE_STATIC type of property, get should return the same value
2523 * always.
2524 * For VEHICLE_PROP_CHANGE_MODE_ON_CHANGE type of property, it should return the latest value.
Keun-young Parkab68e372016-03-10 16:28:42 -08002525 * If there is no data available yet, which can happen during initial stage, this call should
2526 * return immediately with error code of -EAGAIN.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002527 */
2528 int (*get)(struct vehicle_hw_device* device, vehicle_prop_value_t *data);
2529
2530 /**
Keun-young Parkab68e372016-03-10 16:28:42 -08002531 * Release memory allocated to data in previous get call. get call for byte or string involves
2532 * allocating necessary memory from vehicle hal.
2533 * To be safe, memory allocated by vehicle hal should be released by vehicle hal and vehicle
2534 * network service will call this when data from vehicle hal is no longer necessary.
2535 * vehicle hal implementation should only release member of vehicle_prop_value_t like
2536 * data->str_value.data or data->bytes_value.data but not data itself as data itself is
2537 * allocated from vehicle network service. Once memory is freed, corresponding pointer should
2538 * be set to NULL bu vehicle hal.
2539 */
2540 void (*release_memory_from_get)(struct vehicle_hw_device* device, vehicle_prop_value_t *data);
2541
2542 /**
Sanket Agarwalfb636682015-08-11 14:34:29 -07002543 * Set a vehicle property value. data should be allocated properly and not
2544 * NULL.
2545 * The caller of the API OWNS the data field.
2546 * timestamp of data will be ignored for set operation.
Keun-young Park418c7e82016-04-06 10:44:20 -07002547 * Setting some properties require having initial state available. Depending on the vehicle hal,
2548 * such initial data may not be available for short time after init. In such case, set call
2549 * can return -EAGAIN like get call.
Keun-young Parkf7097582016-04-25 18:10:45 -07002550 * For a property with separate power control, set can fail if the property is not powered on.
2551 * In such case, hal should return -ESHUTDOWN error.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002552 */
2553 int (*set)(struct vehicle_hw_device* device, const vehicle_prop_value_t *data);
2554
2555 /**
2556 * Subscribe to events.
2557 * Depending on output of list_properties if the property is:
2558 * a) on-change: sample_rate should be set to 0.
2559 * b) supports frequency: sample_rate should be set from min_sample_rate to
2560 * max_sample_rate.
Keun-young Park418c7e82016-04-06 10:44:20 -07002561 * For on-change type of properties, vehicle network service will make another get call to check
2562 * the initial state. Due to this, vehicle hal implementation does not need to send initial
2563 * state for on-change type of properties.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002564 * @param device
2565 * @param prop
2566 * @param sample_rate
Keun-young Parkbf877a72015-12-21 14:16:05 -08002567 * @param zones All subscribed zones for zoned property. can be ignored for non-zoned property.
2568 * 0 means all zones supported instead of no zone.
Sanket Agarwalfb636682015-08-11 14:34:29 -07002569 */
Keun-young Parkbf877a72015-12-21 14:16:05 -08002570 int (*subscribe)(struct vehicle_hw_device* device, int32_t prop, float sample_rate,
2571 int32_t zones);
Sanket Agarwalfb636682015-08-11 14:34:29 -07002572
2573 /** Cancel subscription on a property. */
2574 int (*unsubscribe)(struct vehicle_hw_device* device, int32_t prop);
Keun-young Park418c7e82016-04-06 10:44:20 -07002575
2576 /**
2577 * Print out debugging state for the vehicle hal. This will be called by
2578 * the vehicle network service and will be included into the service' dump.
2579 *
2580 * The passed-in file descriptor can be used to write debugging text using
2581 * dprintf() or write(). The text should be in ASCII encoding only.
2582 *
2583 * Performance requirements:
2584 *
2585 * This must be a non-blocking call. The HAL should return from this call
2586 * in 1ms, must return from this call in 10ms. This call must avoid
2587 * deadlocks, as it may be called at any point of operation.
2588 * Any synchronization primitives used (such as mutex locks or semaphores)
2589 * should be acquired with a timeout.
2590 */
2591 int (*dump)(struct vehicle_hw_device* device, int fd);
2592
Sanket Agarwalfb636682015-08-11 14:34:29 -07002593} vehicle_hw_device_t;
2594
2595__END_DECLS
2596
2597#endif // ANDROID_VEHICLE_INTERFACE_H