blob: 5de416f32f4cf6bf954d9d614bc3f767aee31360 [file] [log] [blame]
Pavel Maltseva2f426a2016-10-04 10:17:05 -07001/*
2 * Copyright (C) 2016 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
Pavel Maltsev2579fb72017-02-02 12:39:36 -080017package android.hardware.automotive.vehicle@2.0;
Pavel Maltseva2f426a2016-10-04 10:17:05 -070018
19import IVehicleCallback;
20
21interface IVehicle {
22 /**
23 * Returns a list of all property configurations supported by this vehicle
24 * HAL.
25 */
26 getAllPropConfigs() generates (vec<VehiclePropConfig> propConfigs);
27
28 /*
29 * Returns a list of property configurations for given properties.
Pavel Maltsevdb179c52016-10-27 15:43:06 -070030 *
31 * If requested VehicleProperty wasn't found it must return
32 * StatusCode::INVALID_ARG, otherwise a list of vehicle property
33 * configurations with StatusCode::OK
Pavel Maltseva2f426a2016-10-04 10:17:05 -070034 */
Pavel Maltsev8e624b32017-02-01 16:30:25 -080035 getPropConfigs(vec<int32_t> props)
Pavel Maltsevdb179c52016-10-27 15:43:06 -070036 generates (StatusCode status, vec<VehiclePropConfig> propConfigs);
Pavel Maltseva2f426a2016-10-04 10:17:05 -070037
38 /**
39 * Get a vehicle property value.
40 *
41 * For VehiclePropertyChangeMode::STATIC properties, this method must always
42 * return the same value always.
43 * For VehiclePropertyChangeMode::ON_CHANGE properties, it must return the
44 * latest available value.
45 *
Pavel Maltsevdb179c52016-10-27 15:43:06 -070046 * Some properties like AUDIO_VOLUME requires to pass additional data in
47 * GET request in VehiclePropValue object.
48 *
Pavel Maltseva2f426a2016-10-04 10:17:05 -070049 * If there is no data available yet, which can happen during initial stage,
50 * this call must return immediately with an error code of
51 * StatusCode::TRY_AGAIN.
52 */
Pavel Maltsevdb179c52016-10-27 15:43:06 -070053 get(VehiclePropValue requestedPropValue)
Pavel Maltseva2f426a2016-10-04 10:17:05 -070054 generates (StatusCode status, VehiclePropValue propValue);
55
56 /**
57 * Set a vehicle property value.
58 *
59 * Timestamp of data must be ignored for set operation.
60 *
61 * Setting some properties require having initial state available. If initial
62 * data is not available yet this call must return StatusCode::TRY_AGAIN.
63 * For a property with separate power control this call must return
64 * StatusCode::NOT_AVAILABLE error if property is not powered on.
65 */
66 set(VehiclePropValue propValue) generates (StatusCode status);
67
68 /**
69 * Subscribes to property events.
70 *
71 * Clients must be able to subscribe to multiple properties at a time
72 * depending on data provided in options argument.
73 *
Pavel Maltseve2603e32016-10-25 16:03:23 -070074 * @param listener This client must be called on appropriate event.
Pavel Maltseva2f426a2016-10-04 10:17:05 -070075 * @param options List of options to subscribe. SubscribeOption contains
Pavel Maltseve2603e32016-10-25 16:03:23 -070076 * information such as property Id, area Id, sample rate, etc.
Pavel Maltseva2f426a2016-10-04 10:17:05 -070077 */
Pavel Maltseve2603e32016-10-25 16:03:23 -070078 subscribe(IVehicleCallback callback, vec<SubscribeOptions> options)
Pavel Maltseva2f426a2016-10-04 10:17:05 -070079 generates (StatusCode status);
80
81 /**
82 * Unsubscribes from property events.
83 *
84 * If this client wasn't subscribed to the given property, this method
Pavel Maltsevdb179c52016-10-27 15:43:06 -070085 * must return StatusCode::INVALID_ARG.
Pavel Maltseva2f426a2016-10-04 10:17:05 -070086 */
Pavel Maltsev8e624b32017-02-01 16:30:25 -080087 unsubscribe(IVehicleCallback callback, int32_t propId)
Pavel Maltseve2603e32016-10-25 16:03:23 -070088 generates (StatusCode status);
Pavel Maltseva2f426a2016-10-04 10:17:05 -070089
90 /**
91 * Print out debugging state for the vehicle hal.
92 *
93 * The text must be in ASCII encoding only.
94 *
95 * Performance requirements:
96 *
97 * The HAL must return from this call in less than 10ms. This call must avoid
98 * deadlocks, as it may be called at any point of operation. Any synchronization
99 * primitives used (such as mutex locks or semaphores) must be acquired
100 * with a timeout.
101 *
Pavel Maltseva2f426a2016-10-04 10:17:05 -0700102 */
103 debugDump() generates (string s);
104};