libpldm: util: Convert version field to string
Convert version field to string, see DSP0240 5.5
Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: Ife36c0e0ae916173fa73309b490cd380a43b3db6
diff --git a/libpldm/utils.h b/libpldm/utils.h
index 7a347d4..2c2d365 100644
--- a/libpldm/utils.h
+++ b/libpldm/utils.h
@@ -5,6 +5,7 @@
extern "C" {
#endif
+#include "pldm_types.h"
#include <stddef.h>
#include <stdint.h>
@@ -16,8 +17,17 @@
*/
uint32_t crc32(const void *data, size_t size);
+/** @brief Convert ver32_t to string
+ * @param[in] version - Pointer to ver32_t
+ * @param[out] buffer - Pointer to the buffer
+ * @param[in] buffer_size - Size of the buffer
+ * @return The number of characters(excluding the null byte) or negative if
+ * error is encountered
+ */
+int ver2str(const ver32_t *version, char *buffer, size_t buffer_size);
+
#ifdef __cplusplus
}
#endif
-#endif
\ No newline at end of file
+#endif