1 #pragma once 2 3 #include "tpm/tpm_device.hpp" 4 5 #include <string_view> 6 7 class TPM2Interface : public TPMInterface 8 { 9 public: TPM2Interface(sdbusplus::async::context & ctx,uint8_t tpmIndex)10 TPM2Interface(sdbusplus::async::context& ctx, uint8_t tpmIndex) : 11 TPMInterface(ctx, tpmIndex) 12 {} 13 isUpdateSupported() const14 bool isUpdateSupported() const final 15 { 16 // Currently, we do not support TPM2 firmware updates 17 return false; 18 } 19 20 sdbusplus::async::task<bool> updateFirmware(const uint8_t* image, 21 size_t image_size) final; 22 23 sdbusplus::async::task<bool> getVersion(std::string& version) final; 24 25 private: 26 sdbusplus::async::task<bool> getProperty(std::string_view property, 27 uint32_t& value); 28 }; 29