Update emulator protobuf to include status

Add status
Remove supported_areas

Bug: 72348165
Test: Use python emulator to get/set values
Change-Id: Iad84305a49b260ff02b28685f581a82ca7ff8195
This commit is contained in:
Steve Paik
2018-01-24 18:47:29 -08:00
parent 1ae977d6e8
commit 5160ba3455
2 changed files with 10 additions and 1 deletions

View File

@@ -138,6 +138,7 @@ void VehicleEmulator::doSetProperty(VehicleEmulator::EmulatorMessage& rxMsg,
VehiclePropValue val = {
.prop = protoVal.prop(),
.areaId = protoVal.area_id(),
.status = (VehiclePropertyStatus)protoVal.status(),
.timestamp = elapsedRealtimeNano(),
};
@@ -288,6 +289,7 @@ void VehicleEmulator::populateProtoVehiclePropValue(emulator::VehiclePropValue*
protoVal->set_prop(val->prop);
protoVal->set_value_type(toInt(getPropType(val->prop)));
protoVal->set_timestamp(val->timestamp);
protoVal->set_status((emulator::VehiclePropStatus)(val->status));
protoVal->set_area_id(val->areaId);
// Copy value data if it is set.

View File

@@ -46,6 +46,12 @@ enum Status {
ERROR_INVALID_OPERATION = 8;
}
enum VehiclePropStatus {
AVAILABLE = 0;
UNAVAILABLE = 1;
ERROR = 2;
}
message VehicleAreaConfig {
required int32 area_id = 1;
optional sint32 min_int32_value = 2;
@@ -61,7 +67,7 @@ message VehiclePropConfig {
optional int32 access = 2;
optional int32 change_mode = 3;
optional int32 value_type = 4;
optional int32 supported_areas = 5;
optional int32 supported_areas = 5; // Deprecated - DO NOT USE
repeated VehicleAreaConfig area_configs = 6;
optional int32 config_flags = 7;
repeated int32 config_array = 8;
@@ -75,6 +81,7 @@ message VehiclePropValue {
required int32 prop = 1;
optional int32 value_type = 2;
optional int64 timestamp = 3; // required for valid data from HAL, skipped for set
optional VehiclePropStatus status = 10; // required for valid data from HAL, skipped for set
// values
optional int32 area_id = 4;