Move bmc mode enum to a header file
Tested:
Response in BM Mode:
ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 14 01
Response in Non-BM Mode:
ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x10
79 2b 00 14 00
Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
Change-Id: I3e0ca730ccaed74c3195eb3a4002719077251745
diff --git a/bmc_mode_enum.hpp b/bmc_mode_enum.hpp
new file mode 100644
index 0000000..be965dc
--- /dev/null
+++ b/bmc_mode_enum.hpp
@@ -0,0 +1,28 @@
+// Copyright 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace google
+{
+namespace ipmi
+{
+
+enum class BmcMode : uint8_t
+{
+ NON_BM_MODE = 0,
+ BM_MODE,
+ BM_CLEANING_MODE
+};
+
+} // namespace ipmi
+} // namespace google
diff --git a/handler.cpp b/handler.cpp
index 161f10d..564eab8 100644
--- a/handler.cpp
+++ b/handler.cpp
@@ -13,6 +13,7 @@
// limitations under the License.
#include "handler.hpp"
+#include "bmc_mode_enum.hpp"
#include "errors.hpp"
#include "handler_impl.hpp"
#include "util.hpp"
@@ -66,13 +67,6 @@
using InternalFailure =
sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
-enum class BmcMode : uint8_t
-{
- NON_BM_MODE = 0,
- BM_MODE,
- BM_CLEANING_MODE
-};
-
uint8_t isBmcInBareMetalMode()
{
#if BARE_METAL