Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 250139c8 authored by Pavel Maltsev's avatar Pavel Maltsev
Browse files

Merge Vehicle HAL 2.1 iface to 2.0

Vehicle HAL is property based and all properties are considered
optional. It is quite a bit of pain to create new versions of VHAL only
to extend properties.

Bug: 64303350

Test: build and flash, verefied system works stable.
Change-Id: I8adb858f53a5d9d31f7444bf97ae09baf2fffafa
parent a2c5f936
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -6,6 +6,4 @@ subdirs = [
    "vehicle/2.0",
    "vehicle/2.0/default",
    "vehicle/2.0/default/impl/vhal_v2_0/proto",
    "vehicle/2.1",
    "vehicle/2.1/default",
]
+608 −0

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ cc_library_static {
    vendor: true,
    defaults: ["vhal_v2_0_defaults"],
    srcs: [
        "common/src/Obd2SensorStore.cpp",
        "common/src/SubscriptionManager.cpp",
        "common/src/VehicleHalManager.cpp",
        "common/src/VehicleObjectPool.cpp",
+15 −16
Original line number Diff line number Diff line
@@ -14,18 +14,18 @@
 * limitations under the License.
 */

#ifndef android_hardware_automotive_vehicle_V2_1_Obd2SensorStore_H_
#define android_hardware_automotive_vehicle_V2_1_Obd2SensorStore_H_
#ifndef android_hardware_automotive_vehicle_V2_0_Obd2SensorStore_H_
#define android_hardware_automotive_vehicle_V2_0_Obd2SensorStore_H_

#include <vector>

#include <android/hardware/automotive/vehicle/2.1/types.h>
#include <android/hardware/automotive/vehicle/2.0/types.h>

namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_1 {
namespace V2_0 {

// This class wraps all the logic required to create an OBD2 frame.
// It allows storing sensor values, setting appropriate bitmasks as needed,
@@ -34,18 +34,17 @@ namespace V2_1 {
class Obd2SensorStore {
   public:
    // Creates a sensor storage with a given number of vendor-specific sensors.
    Obd2SensorStore(size_t numVendorIntegerSensors,
                    size_t numVendorFloatSensors);
    Obd2SensorStore(size_t numVendorIntegerSensors, size_t numVendorFloatSensors);

    // Stores an integer-valued sensor.
    V2_0::StatusCode setIntegerSensor(DiagnosticIntegerSensorIndex index, int32_t value);
    StatusCode setIntegerSensor(DiagnosticIntegerSensorIndex index, int32_t value);
    // Stores an integer-valued sensor.
    V2_0::StatusCode setIntegerSensor(size_t index, int32_t value);
    StatusCode setIntegerSensor(size_t index, int32_t value);

    // Stores a float-valued sensor.
    V2_0::StatusCode setFloatSensor(DiagnosticFloatSensorIndex index, float value);
    StatusCode setFloatSensor(DiagnosticFloatSensorIndex index, float value);
    // Stores a float-valued sensor.
    V2_0::StatusCode setFloatSensor(size_t index, float value);
    StatusCode setFloatSensor(size_t index, float value);

    // Returns a vector that contains all integer sensors stored.
    const std::vector<int32_t>& getIntegerSensors() const;
@@ -55,7 +54,7 @@ public:
    const std::vector<uint8_t>& getSensorsBitmask() const;

    // Given a stringValue, fill in a VehiclePropValue
    void fillPropValue(const std::string& dtc, V2_0::VehiclePropValue *propValue) const;
    void fillPropValue(const std::string& dtc, VehiclePropValue* propValue) const;

   private:
    class BitmaskInVector {
@@ -76,7 +75,7 @@ private:
    BitmaskInVector mSensorsBitmask;
};

}  // namespace V2_1
}  // namespace V2_0
}  // namespace vehicle
}  // namespace automotive
}  // namespace hardware
+21 −33

File changed and moved.

Preview size limit exceeded, changes collapsed.

Loading