blob: 1e9034f76319de9f47d5582d755e9d942c2cf299 [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
17package android.hardware.vehicle@2.0;
18
19interface IVehicleCallback {
20
21 /*
22 * 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 */
32 onPropertyEvent(vec<VehiclePropValue> propValues);
33
34 /*
35 * This method gets called if the client was susbscribed to a property using
36 * SubscribeFlags::SET_CALL flag and IVehicle#set(...) method was called.
37 *
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 */
43 onPropertySet(VehiclePropValue propValue);
44
45 /*
46 * Called by HAL server when error condition has occurred.
47 *
48 * @param errorCode - any value from StatusCode enum.
49 * @parm property - a property where error has happened. If this is
50 * a generic error, this value should be VehicleProperty::INVALID.
51 * @param operation Represent the operation where the error has happened.
52 */
53 onError(StatusCode errorCode,
54 VehicleProperty propId,
55 VehiclePropertyOperation operation);
56};