Home | History | Annotate | Download | only in vehiclenetwork
      1 /*
      2  * Copyright (C) 2015 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 
     17 package com.android.car.vehiclenetwork;
     18 
     19 import com.android.car.vehiclenetwork.IVehicleNetworkHalMock;
     20 import com.android.car.vehiclenetwork.IVehicleNetworkListener;
     21 import com.android.car.vehiclenetwork.VehiclePropConfigsParcelable;
     22 import com.android.car.vehiclenetwork.VehiclePropValueParcelable;
     23 import com.android.car.vehiclenetwork.VehiclePropValuesParcelable;
     24 
     25 /**
     26   * Binder API to access vehicle network service.
     27   * @hide
     28   */
     29 interface IVehicleNetwork {
     30     VehiclePropConfigsParcelable listProperties(int property)                            = 0;
     31     /** For error case, exception will be thrown. */
     32     void setProperty(in VehiclePropValueParcelable value)                                = 1;
     33     VehiclePropValueParcelable getProperty(in VehiclePropValueParcelable value)          = 2;
     34     /** For error case, exception will be thrown. */
     35     void subscribe(in IVehicleNetworkListener listener, int property, float sampleRate,
     36                                                                              int zones)  = 3;
     37     void unsubscribe(in IVehicleNetworkListener listener, int property)                  = 4;
     38     /** For testing only. inject events. */
     39     void injectEvent(in VehiclePropValueParcelable value)                                = 5;
     40     /** For testing only. Start in mocking mode. */
     41     void startMocking(in IVehicleNetworkHalMock mock)                                    = 6;
     42     /** Finish mocking mode. */
     43     void stopMocking(in IVehicleNetworkHalMock mock)                                     = 7;
     44     void injectHalError(int errorCode, int property, int operation)                      = 8;
     45     void startErrorListening(in IVehicleNetworkListener listener)                        = 9;
     46     void stopErrorListening(in IVehicleNetworkListener listener)                         = 10;
     47     void startHalRestartMonitoring(in IVehicleNetworkListener listener)                  = 11;
     48     void stopHalRestartMonitoring(in IVehicleNetworkListener listener)                   = 12;
     49 
     50     //TODO add specialized set for byte array for efficiency
     51 }
     52