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