Chao Yan | f2c109c | 2018-05-11 12:16:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | package com.android.car.vehiclehal.test; |
| 17 | |
| 18 | import android.hardware.automotive.vehicle.V2_0.VehicleArea; |
| 19 | import android.hardware.automotive.vehicle.V2_0.VehiclePropertyGroup; |
| 20 | import android.hardware.automotive.vehicle.V2_0.VehiclePropertyType; |
| 21 | import android.os.RemoteException; |
| 22 | |
| 23 | interface VhalEventGenerator { |
| 24 | |
| 25 | /** |
| 26 | * The following property controls VHAL to start/stop linear fake data generation process. |
| 27 | * It must match kGenerateFakeDataControllingProperty that is defined in default VHAL |
| 28 | * implementation: |
| 29 | * |
| 30 | * hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h |
| 31 | */ |
| 32 | int GENERATE_FAKE_DATA_CONTROLLING_PROPERTY = 0x0666 |
| 33 | | VehiclePropertyGroup.VENDOR |
| 34 | | VehicleArea.GLOBAL |
| 35 | | VehiclePropertyType.MIXED; |
| 36 | |
| 37 | // Command bits sent via GENERATE_FAKE_DATA_CONTROLLING_PROPERTY to control fake data generation |
| 38 | int CMD_START_LINEAR = 0; // Start linear fake data generation |
| 39 | int CMD_STOP_LINEAR = 1; // Stop linear fake data generation |
| 40 | int CMD_START_JSON = 2; // Start JSON-based fake data generation |
| 41 | int CMD_STOP_JSON = 3; // Stop JSON-based fake data generation |
| 42 | |
| 43 | /** |
| 44 | * Asynchronous call to tell VHAL to start fake event generation. VHAL will start generating |
| 45 | * data after this call |
| 46 | * |
| 47 | * @throws RemoteException |
| 48 | */ |
| 49 | void start() throws RemoteException; |
| 50 | |
| 51 | /** |
| 52 | * Synchronous call to tell VHAL to stop fake event generation. VHAL should always stopped |
| 53 | * generating data after this call. |
| 54 | * |
| 55 | * @throws RemoteException |
| 56 | */ |
| 57 | void stop() throws RemoteException; |
| 58 | } |