1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerinterface IVehicleCallback { 20*4d7e907cSAndroid Build Coastguard Worker 21*4d7e907cSAndroid Build Coastguard Worker /** 22*4d7e907cSAndroid Build Coastguard Worker * Event callback happens whenever a variable that the API user has 23*4d7e907cSAndroid Build Coastguard Worker * subscribed to needs to be reported. This may be based purely on 24*4d7e907cSAndroid Build Coastguard Worker * threshold and frequency (a regular subscription, see subscribe call's 25*4d7e907cSAndroid Build Coastguard Worker * arguments) or when the IVehicle#set method was called and the actual 26*4d7e907cSAndroid Build Coastguard Worker * change needs to be reported. 27*4d7e907cSAndroid Build Coastguard Worker * 28*4d7e907cSAndroid Build Coastguard Worker * These callbacks are chunked. 29*4d7e907cSAndroid Build Coastguard Worker * 30*4d7e907cSAndroid Build Coastguard Worker * @param values that has been updated. 31*4d7e907cSAndroid Build Coastguard Worker */ 32*4d7e907cSAndroid Build Coastguard Worker oneway onPropertyEvent(vec<VehiclePropValue> propValues); 33*4d7e907cSAndroid Build Coastguard Worker 34*4d7e907cSAndroid Build Coastguard Worker /** 35*4d7e907cSAndroid Build Coastguard Worker * This method gets called if the client was subscribed to a property using 36*4d7e907cSAndroid Build Coastguard Worker * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called. 37*4d7e907cSAndroid Build Coastguard Worker * 38*4d7e907cSAndroid Build Coastguard Worker * These events must be delivered to subscriber immediately without any 39*4d7e907cSAndroid Build Coastguard Worker * batching. 40*4d7e907cSAndroid Build Coastguard Worker * 41*4d7e907cSAndroid Build Coastguard Worker * @param value Value that was set by a client. 42*4d7e907cSAndroid Build Coastguard Worker */ 43*4d7e907cSAndroid Build Coastguard Worker oneway onPropertySet(VehiclePropValue propValue); 44*4d7e907cSAndroid Build Coastguard Worker 45*4d7e907cSAndroid Build Coastguard Worker /** 46*4d7e907cSAndroid Build Coastguard Worker * Set property value is usually asynchronous operation. Thus even if 47*4d7e907cSAndroid Build Coastguard Worker * client received StatusCode::OK from the IVehicle::set(...) this 48*4d7e907cSAndroid Build Coastguard Worker * doesn't guarantee that the value was successfully propagated to the 49*4d7e907cSAndroid Build Coastguard Worker * vehicle network. If such rare event occurs this method must be called. 50*4d7e907cSAndroid Build Coastguard Worker * 51*4d7e907cSAndroid Build Coastguard Worker * @param errorCode - any value from StatusCode enum. 52*4d7e907cSAndroid Build Coastguard Worker * @param property - a property where error has happened. 53*4d7e907cSAndroid Build Coastguard Worker * @param areaId - bitmask that specifies in which areas the problem has 54*4d7e907cSAndroid Build Coastguard Worker * occurred, must be 0 for global properties 55*4d7e907cSAndroid Build Coastguard Worker */ 56*4d7e907cSAndroid Build Coastguard Worker oneway onPropertySetError(StatusCode errorCode, 57*4d7e907cSAndroid Build Coastguard Worker int32_t propId, 58*4d7e907cSAndroid Build Coastguard Worker int32_t areaId); 59*4d7e907cSAndroid Build Coastguard Worker}; 60