diff --git a/common/recipes-core/fw-util/files/tpm.cpp b/common/recipes-core/fw-util/files/tpm.cpp index 966eacc05834..4bf289287da5 100644 --- a/common/recipes-core/fw-util/files/tpm.cpp +++ b/common/recipes-core/fw-util/files/tpm.cpp @@ -1,4 +1,4 @@ -#include "fw-util.h" +#include "tpm.h" #include #include #include @@ -82,23 +82,16 @@ get_tpm_ver(char *ver) { return 0; } -class TpmComponent : public Component { - public: - TpmComponent(string fru, string comp) - : Component(fru, comp) {} - int print_version() { - char ver[MAX_LINE_LENGTH] = {0}; - - if (get_tpm_ver(ver) == FW_STATUS_SUCCESS) { - printf("TPM Version: %s", ver); - } else if (get_tpm_ver(ver) == FW_STATUS_NOT_SUPPORTED) { - printf("TPM Version: TPM Not Supported\n"); - } else { - printf("TPM Version: NA\n"); - } - - return 0; - } -}; +int TpmComponent::print_version() +{ + char ver[MAX_LINE_LENGTH] = {0}; -TpmComponent tpm("bmc", "tpm"); + if (get_tpm_ver(ver) == FW_STATUS_SUCCESS) { + printf("TPM Version: %s", ver); + } else if (get_tpm_ver(ver) == FW_STATUS_NOT_SUPPORTED) { + printf("TPM Version: TPM Not Supported\n"); + } else { + printf("TPM Version: NA\n"); + } + return 0; +} diff --git a/common/recipes-core/fw-util/files/tpm.h b/common/recipes-core/fw-util/files/tpm.h new file mode 100644 index 000000000000..00652076affc --- /dev/null +++ b/common/recipes-core/fw-util/files/tpm.h @@ -0,0 +1,13 @@ +#ifndef _TPM_H_ +#define _TPM_H_ +#include +#include "fw-util.h" + +class TpmComponent : public Component { + public: + TpmComponent(std::string fru, std::string comp) + : Component(fru, comp) {} + int print_version(); +}; + +#endif diff --git a/common/recipes-core/fw-util/fw-util_0.2.bb b/common/recipes-core/fw-util/fw-util_0.2.bb index e2a2db0eb646..89cfa37c5779 100644 --- a/common/recipes-core/fw-util/fw-util_0.2.bb +++ b/common/recipes-core/fw-util/fw-util_0.2.bb @@ -21,6 +21,7 @@ SRC_URI =+ "file://Makefile \ file://nic.cpp \ file://fscd.cpp \ file://tpm.cpp \ + file://tpm.h \ file://bic_fw.cpp \ file://bic_fw.h \ file://bic_me.cpp \