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 17syntax = "proto2"; 18option optimize_for = LITE_RUNTIME; 19 20package emulator; 21 22// CMD messages are from workstation --> VHAL 23// RESP messages are from VHAL --> workstation 24enum MsgType { 25 GET_CONFIG_CMD = 0; 26 GET_CONFIG_RESP = 1; 27 GET_CONFIG_ALL_CMD = 2; 28 GET_CONFIG_ALL_RESP = 3; 29 GET_PROPERTY_CMD = 4; 30 GET_PROPERTY_RESP = 5; 31 GET_PROPERTY_ALL_CMD = 6; 32 GET_PROPERTY_ALL_RESP = 7; 33 SET_PROPERTY_CMD = 8; 34 SET_PROPERTY_RESP = 9; 35 SET_PROPERTY_ASYNC = 10; 36} 37enum Status { 38 RESULT_OK = 0; 39 ERROR_UNKNOWN = 1; 40 ERROR_UNIMPLEMENTED_CMD = 2; 41 ERROR_INVALID_PROPERTY = 3; 42 ERROR_INVALID_AREA_ID = 4; 43 ERROR_PROPERTY_UNINITIALIZED = 5; 44 ERROR_WRITE_ONLY_PROPERTY = 6; 45 ERROR_MEMORY_ALLOC_FAILED = 7; 46 ERROR_INVALID_OPERATION = 8; 47} 48 49message VehicleAreaConfig { 50 required int32 area_id = 1; 51 optional sint32 min_int32_value = 2; 52 optional sint32 max_int32_value = 3; 53 optional sint64 min_int64_value = 4; 54 optional sint64 max_int64_value = 5; 55 optional float min_float_value = 6; 56 optional float max_float_value = 7; 57} 58 59message VehiclePropConfig { 60 required int32 prop = 1; 61 optional int32 access = 2; 62 optional int32 change_mode = 3; 63 optional int32 value_type = 4; 64 optional int32 supported_areas = 5; 65 repeated VehicleAreaConfig area_configs = 6; 66 optional int32 config_flags = 7; 67 repeated int32 config_array = 8; 68 optional string config_string = 9; 69 optional float min_sample_rate = 10; 70 optional float max_sample_rate = 11; 71}; 72 73message VehiclePropValue { 74 // common data 75 required int32 prop = 1; 76 optional int32 value_type = 2; 77 optional int64 timestamp = 3; // required for valid data from HAL, skipped for set 78 79 // values 80 optional int32 area_id = 4; 81 repeated sint32 int32_values = 5; // this also covers boolean value. 82 repeated sint64 int64_values = 6; 83 repeated float float_values = 7; 84 optional string string_value = 8; 85 optional bytes bytes_value = 9; 86}; 87 88// This structure is used to notify what values to get from the Vehicle HAL 89message VehiclePropGet { 90 required int32 prop = 1; 91 optional int32 area_id = 2; 92}; 93 94message EmulatorMessage { 95 required MsgType msg_type = 1; 96 optional Status status = 2; // Only for RESP messages 97 repeated VehiclePropGet prop = 3; // Provided for getConfig, getProperty commands 98 repeated VehiclePropConfig config = 4; 99 repeated VehiclePropValue value = 5; 100}; 101