1 /* 2 * Copyright (c) 2022, 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 17 #ifndef CPP_VHAL_CLIENT_INCLUDE_AIDLHALPROPVALUE_H_ 18 #define CPP_VHAL_CLIENT_INCLUDE_AIDLHALPROPVALUE_H_ 19 20 #include "IHalPropValue.h" 21 22 #include <aidl/android/hardware/automotive/vehicle/VehiclePropValue.h> 23 24 namespace android { 25 namespace frameworks { 26 namespace automotive { 27 namespace vhal { 28 29 class AidlHalPropValue : public IHalPropValue { 30 public: 31 using VehiclePropValue = ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; 32 33 explicit AidlHalPropValue(int32_t propId); 34 explicit AidlHalPropValue(VehiclePropValue&& value); 35 AidlHalPropValue(int32_t propId, int32_t areaId); 36 37 int32_t getPropId() const override; 38 39 int32_t getAreaId() const override; 40 41 int64_t getTimestamp() const override; 42 43 void setInt32Values(const std::vector<int32_t>& values) override; 44 45 std::vector<int32_t> getInt32Values() const override; 46 47 void setInt64Values(const std::vector<int64_t>& values) override; 48 49 std::vector<int64_t> getInt64Values() const override; 50 51 void setFloatValues(const std::vector<float>& values) override; 52 53 std::vector<float> getFloatValues() const override; 54 55 void setByteValues(const std::vector<uint8_t>& values) override; 56 57 std::vector<uint8_t> getByteValues() const override; 58 59 void setStringValue(const std::string& value) override; 60 61 std::string getStringValue() const override; 62 63 const void* toVehiclePropValue() const override; 64 65 private: 66 VehiclePropValue mPropValue; 67 }; 68 69 } // namespace vhal 70 } // namespace automotive 71 } // namespace frameworks 72 } // namespace android 73 74 #endif // CPP_VHAL_CLIENT_INCLUDE_AIDLHALPROPVALUE_H_ 75