ncsi: log interface types using to_string
Add a to_string() method for Interfaces, to handle printing via lg2.
Since we're printing the interface object, don't specify _INDEX on the
metadata, this may not always be an index.
Also, interface indices are typically referred to as decimal. Use
decimal instead of a lg2::hex conversion.
Change-Id: I90b5fbac52adde3bbc3f2699087373ed96361083
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
diff --git a/src/ncsi_util.hpp b/src/ncsi_util.hpp
index da45a38..a04e249 100644
--- a/src/ncsi_util.hpp
+++ b/src/ncsi_util.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <span>
+#include <string>
namespace phosphor
{
@@ -17,6 +18,8 @@
int ifindex;
};
+std::string to_string(Interface& interface);
+
/* @brief This function will ask underlying NCSI driver
* to send an OEM command (command type 0x50) with
* the specified payload as the OEM data.