Pavel Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 1 | /* |
| 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 Maltsev | 2579fb7 | 2017-02-02 12:39:36 -0800 | [diff] [blame] | 17 | package android.hardware.automotive.vehicle@2.0; |
Pavel Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 18 | |
| 19 | interface IVehicleCallback { |
| 20 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 21 | /** |
Pavel Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 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 | */ |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 32 | oneway onPropertyEvent(vec<VehiclePropValue> propValues); |
Pavel Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 33 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 34 | /** |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 35 | * This method gets called if the client was subscribed to a property using |
Steve Paik | 28b9f8b | 2018-03-29 23:18:13 -0700 | [diff] [blame] | 36 | * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called. |
Pavel Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 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 | */ |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 43 | oneway onPropertySet(VehiclePropValue propValue); |
Pavel Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 44 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 45 | /** |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 46 | * 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 Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 50 | * |
| 51 | * @param errorCode - any value from StatusCode enum. |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 52 | * @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 Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 55 | */ |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 56 | oneway onPropertySetError(StatusCode errorCode, |
Pavel Maltsev | 8e624b3 | 2017-02-01 16:30:25 -0800 | [diff] [blame] | 57 | int32_t propId, |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 58 | int32_t areaId); |
Pavel Maltsev | a2f426a | 2016-10-04 10:17:05 -0700 | [diff] [blame] | 59 | }; |