user_channel: Optimize ipmi complete code

Encapsulate the custom status return code into an ipmi method and
then use it in cpp.

Change-Id: I72ce8bb4d262c98cb41635c985e229e1f9b593a3
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/user_channel/channel_layer.hpp b/user_channel/channel_layer.hpp
index 37d2b90..a23e947 100644
--- a/user_channel/channel_layer.hpp
+++ b/user_channel/channel_layer.hpp
@@ -27,8 +27,19 @@
 static constexpr uint8_t maxIpmiChannels = 16;
 static constexpr uint8_t currentChNum = 0xE;
 static constexpr uint8_t invalidChannel = 0xff;
-static constexpr const uint8_t ccActionNotSupportedForChannel = 0x82;
-static constexpr const uint8_t ccAccessModeNotSupportedForChannel = 0x83;
+
+constexpr Cc ccActionNotSupportedForChannel = 0x82;
+constexpr Cc ccAccessModeNotSupportedForChannel = 0x83;
+
+static inline auto responseActionNotSupportedForChannel()
+{
+    return response(ccActionNotSupportedForChannel);
+}
+
+static inline auto responseAccessModeNotSupportedForChannel()
+{
+    return response(ccAccessModeNotSupportedForChannel);
+}
 
 /**
  * @array of privilege levels