summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--user_channel/channel_layer.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/user_channel/channel_layer.hpp b/user_channel/channel_layer.hpp
index 5c82fba..b86d6bf 100644
--- a/user_channel/channel_layer.hpp
+++ b/user_channel/channel_layer.hpp
@@ -16,6 +16,8 @@
#pragma once
#include <ipmid/api.h>
+#include <ipmid/api.hpp>
+#include <ipmid/message.hpp>
#include <string>
namespace ipmi
@@ -261,6 +263,24 @@ ipmi_ret_t getChannelAccessData(const uint8_t chNum,
/** @brief provides function to convert current channel number (0xE)
*
* @param[in] chNum - channel number as requested in commands.
+ * @param[in] ipmi::context - ipmi context ptr, which has more details
+ *
+ * @return same channel number or proper channel number for current channel
+ * number (0xE).
+ */
+inline uint8_t convertCurrentChannelNum(const uint8_t chNum,
+ ipmi::Context::ptr ctx)
+{
+ if (chNum == currentChNum)
+ {
+ return ctx->channel;
+ }
+ return chNum;
+}
+
+/** @brief provides function to convert current channel number (0xE)
+ *
+ * @param[in] chNum - channel number as requested in commands.
*
* @return same channel number or proper channel number for current channel
* number (0xE).
OpenPOWER on IntegriCloud