blob: c4a756ab04896b869952e904fa57de6840bf89ed [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
19interface IVehicleCallback {
20
Andreas Huber40d3a9b2017-03-28 16:19:16 -070021 /**
Pavel Maltseva2f426a2016-10-04 10:17:05 -070022 * Event callback happens whenever a variable that the API user has
23 * subscribed to needs to be reported. This may be based purely on
24 * threshold and frequency (a regular subscription, see subscribe call's
25 * arguments) or when the IVehicle#set method was called and the actual
26 * change needs to be reported.
27 *
28 * These callbacks are chunked.
29 *
30 * @param values that has been updated.
31 */
Pavel Maltseve2603e32016-10-25 16:03:23 -070032 oneway onPropertyEvent(vec<VehiclePropValue> propValues);
Pavel Maltseva2f426a2016-10-04 10:17:05 -070033
Andreas Huber40d3a9b2017-03-28 16:19:16 -070034 /**
Pavel Maltsev30c84c32016-11-14 16:23:36 -080035 * This method gets called if the client was subscribed to a property using
Steve Paik28b9f8b2018-03-29 23:18:13 -070036 * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called.
Pavel Maltseva2f426a2016-10-04 10:17:05 -070037 *
38 * These events must be delivered to subscriber immediately without any
39 * batching.
40 *
41 * @param value Value that was set by a client.
42 */
Pavel Maltseve2603e32016-10-25 16:03:23 -070043 oneway onPropertySet(VehiclePropValue propValue);
Pavel Maltseva2f426a2016-10-04 10:17:05 -070044
Andreas Huber40d3a9b2017-03-28 16:19:16 -070045 /**
Pavel Maltsevdb179c52016-10-27 15:43:06 -070046 * Set property value is usually asynchronous operation. Thus even if
47 * client received StatusCode::OK from the IVehicle::set(...) this
48 * doesn't guarantee that the value was successfully propagated to the
49 * vehicle network. If such rare event occurs this method must be called.
Pavel Maltseva2f426a2016-10-04 10:17:05 -070050 *
51 * @param errorCode - any value from StatusCode enum.
Pavel Maltsevdb179c52016-10-27 15:43:06 -070052 * @param property - a property where error has happened.
53 * @param areaId - bitmask that specifies in which areas the problem has
54 * occurred, must be 0 for global properties
Pavel Maltseva2f426a2016-10-04 10:17:05 -070055 */
Pavel Maltsevdb179c52016-10-27 15:43:06 -070056 oneway onPropertySetError(StatusCode errorCode,
Pavel Maltsev8e624b32017-02-01 16:30:25 -080057 int32_t propId,
Pavel Maltsevdb179c52016-10-27 15:43:06 -070058 int32_t areaId);
Pavel Maltseva2f426a2016-10-04 10:17:05 -070059};