Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +48 −37 Original line number Diff line number Diff line Loading @@ -370,11 +370,11 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {100.0f}}}, // units in meters {.config = {.prop = toInt(VehicleProperty::TIRE_PRESSURE), {.config = { .prop = toInt(VehicleProperty::TIRE_PRESSURE), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 2.0f, .areaConfigs = {VehicleAreaConfig{ .areaId = WHEEL_FRONT_LEFT, .minFloatValue = 100.0f, Loading @@ -394,7 +394,10 @@ const ConfigDeclaration kVehicleProperties[]{ .areaId = WHEEL_REAR_RIGHT, .minFloatValue = 100.0f, .maxFloatValue = 300.0f, }}}, }}, .minSampleRate = 1.0f, .maxSampleRate = 2.0f, }, .initialValue = {.floatValues = {200.0f}}}, // units in kPa {.config = Loading Loading @@ -595,11 +598,14 @@ const ConfigDeclaration kVehicleProperties[]{ .configArray = {(int)VehicleUnit::FAHRENHEIT, (int)VehicleUnit::CELSIUS}}, .initialValue = {.int32Values = {(int)VehicleUnit::FAHRENHEIT}}}, {.config = {.prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS), {.config = { .prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, .configArray = {(int)VehicleUnit::KILOMETER, (int)VehicleUnit::MILE}, .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}}, }, .initialValue = {.int32Values = {(int)VehicleUnit::MILE}}}, {.config = Loading Loading @@ -692,13 +698,18 @@ const ConfigDeclaration kVehicleProperties[]{ }, }, {.config = {.prop = kMixedTypePropertyForTest, { .config = {.prop = kMixedTypePropertyForTest, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0}}, .initialValue = {.stringValue = "MIXED property", .initialValue = { .int32Values = {1 /* indicate TRUE boolean value */, 2, 3}, .floatValues = {4.5f}}}, .floatValues = {4.5f}, .stringValue = "MIXED property", }, }, {.config = {.prop = toInt(VehicleProperty::DOOR_LOCK), .access = VehiclePropertyAccess::READ_WRITE, Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -286,8 +286,8 @@ void EmulatedVehicleHal::onCreate() { // Create a separate instance for each individual zone VehiclePropValue prop = { .prop = cfg.prop, .areaId = curArea, .prop = cfg.prop, }; if (it.initialAreaValues.size() > 0) { Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -101,9 +101,11 @@ std::vector<VehiclePropValue> JsonFakeValueGenerator::parseFakeValueJson(std::is rawEvent.toStyledString().c_str()); continue; } VehiclePropValue event = {.prop = rawEvent["prop"].asInt(), VehiclePropValue event = { .timestamp = rawEvent["timestamp"].asInt64(), .areaId = rawEvent["areaId"].asInt(), .timestamp = rawEvent["timestamp"].asInt64()}; .prop = rawEvent["prop"].asInt(), }; Json::Value rawEventValue = rawEvent["value"]; auto& value = event.value; Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -120,7 +120,10 @@ void VehicleEmulator::doGetProperty(VehicleEmulator::EmulatorMessage const& rxMs } { VehiclePropValue request = { .prop = propId, .areaId = areaId }; VehiclePropValue request = { .areaId = areaId, .prop = propId, }; StatusCode halStatus; auto val = mHal->get(request, &halStatus); if (val != nullptr) { Loading Loading @@ -150,10 +153,10 @@ void VehicleEmulator::doSetProperty(VehicleEmulator::EmulatorMessage const& rxMs VehicleEmulator::EmulatorMessage& respMsg) { emulator::VehiclePropValue protoVal = rxMsg.value(0); VehiclePropValue val = { .prop = protoVal.prop(), .timestamp = elapsedRealtimeNano(), .areaId = protoVal.area_id(), .prop = protoVal.prop(), .status = (VehiclePropertyStatus)protoVal.status(), .timestamp = elapsedRealtimeNano(), }; respMsg.set_msg_type(emulator::SET_PROPERTY_RESP); Loading Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +48 −37 Original line number Diff line number Diff line Loading @@ -370,11 +370,11 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {100.0f}}}, // units in meters {.config = {.prop = toInt(VehicleProperty::TIRE_PRESSURE), {.config = { .prop = toInt(VehicleProperty::TIRE_PRESSURE), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, .maxSampleRate = 2.0f, .areaConfigs = {VehicleAreaConfig{ .areaId = WHEEL_FRONT_LEFT, .minFloatValue = 100.0f, Loading @@ -394,7 +394,10 @@ const ConfigDeclaration kVehicleProperties[]{ .areaId = WHEEL_REAR_RIGHT, .minFloatValue = 100.0f, .maxFloatValue = 300.0f, }}}, }}, .minSampleRate = 1.0f, .maxSampleRate = 2.0f, }, .initialValue = {.floatValues = {200.0f}}}, // units in kPa {.config = Loading Loading @@ -595,11 +598,14 @@ const ConfigDeclaration kVehicleProperties[]{ .configArray = {(int)VehicleUnit::FAHRENHEIT, (int)VehicleUnit::CELSIUS}}, .initialValue = {.int32Values = {(int)VehicleUnit::FAHRENHEIT}}}, {.config = {.prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS), {.config = { .prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, .configArray = {(int)VehicleUnit::KILOMETER, (int)VehicleUnit::MILE}, .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}}, }, .initialValue = {.int32Values = {(int)VehicleUnit::MILE}}}, {.config = Loading Loading @@ -692,13 +698,18 @@ const ConfigDeclaration kVehicleProperties[]{ }, }, {.config = {.prop = kMixedTypePropertyForTest, { .config = {.prop = kMixedTypePropertyForTest, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0}}, .initialValue = {.stringValue = "MIXED property", .initialValue = { .int32Values = {1 /* indicate TRUE boolean value */, 2, 3}, .floatValues = {4.5f}}}, .floatValues = {4.5f}, .stringValue = "MIXED property", }, }, {.config = {.prop = toInt(VehicleProperty::DOOR_LOCK), .access = VehiclePropertyAccess::READ_WRITE, Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -286,8 +286,8 @@ void EmulatedVehicleHal::onCreate() { // Create a separate instance for each individual zone VehiclePropValue prop = { .prop = cfg.prop, .areaId = curArea, .prop = cfg.prop, }; if (it.initialAreaValues.size() > 0) { Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -101,9 +101,11 @@ std::vector<VehiclePropValue> JsonFakeValueGenerator::parseFakeValueJson(std::is rawEvent.toStyledString().c_str()); continue; } VehiclePropValue event = {.prop = rawEvent["prop"].asInt(), VehiclePropValue event = { .timestamp = rawEvent["timestamp"].asInt64(), .areaId = rawEvent["areaId"].asInt(), .timestamp = rawEvent["timestamp"].asInt64()}; .prop = rawEvent["prop"].asInt(), }; Json::Value rawEventValue = rawEvent["value"]; auto& value = event.value; Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/VehicleEmulator.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -120,7 +120,10 @@ void VehicleEmulator::doGetProperty(VehicleEmulator::EmulatorMessage const& rxMs } { VehiclePropValue request = { .prop = propId, .areaId = areaId }; VehiclePropValue request = { .areaId = areaId, .prop = propId, }; StatusCode halStatus; auto val = mHal->get(request, &halStatus); if (val != nullptr) { Loading Loading @@ -150,10 +153,10 @@ void VehicleEmulator::doSetProperty(VehicleEmulator::EmulatorMessage const& rxMs VehicleEmulator::EmulatorMessage& respMsg) { emulator::VehiclePropValue protoVal = rxMsg.value(0); VehiclePropValue val = { .prop = protoVal.prop(), .timestamp = elapsedRealtimeNano(), .areaId = protoVal.area_id(), .prop = protoVal.prop(), .status = (VehiclePropertyStatus)protoVal.status(), .timestamp = elapsedRealtimeNano(), }; respMsg.set_msg_type(emulator::SET_PROPERTY_RESP); Loading