update oemcommands.hpp to use new API
All the command handler numbers and netfn numbers were done
using the old API. This updates all the enums to be ipmi::Cmd
or ipmi::NetFn types. This improves readability by eliminating
unneeded static_casts and brings the legacy code to the present.
One minor fix, otherwise the code is the same. The call to
registerFilter was passing a netfn instead of a priority. It compiled
but it was incorrect. This updates it to use the correct parameter.
Tested: builds and produces the same binary output (other than the
aforementioned registerFilter fix)
Change-Id: I7e83123245b3f340088f8ec75a31b7611d0ecda0
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/src/bmccontrolservices.cpp b/src/bmccontrolservices.cpp
index 159df91..5073149 100644
--- a/src/bmccontrolservices.cpp
+++ b/src/bmccontrolservices.cpp
@@ -201,16 +201,12 @@
void register_netfn_bmc_control_functions()
{
- ipmi::registerHandler(
- ipmi::prioOpenBmcBase, netfnIntcOEMGeneral,
- static_cast<ipmi::Cmd>(
- IPMINetfnIntelOEMGeneralCmd::cmdControlBmcServices),
- ipmi::Privilege::Admin, setBmcControlServices);
+ registerHandler(prioOpenBmcBase, intel::netFnGeneral,
+ intel::general::cmdControlBmcServices, Privilege::Admin,
+ setBmcControlServices);
- ipmi::registerHandler(
- ipmi::prioOpenBmcBase, netfnIntcOEMGeneral,
- static_cast<ipmi::Cmd>(
- IPMINetfnIntelOEMGeneralCmd::cmdGetBmcServiceStatus),
- ipmi::Privilege::User, getBmcControlServices);
+ registerHandler(prioOpenBmcBase, intel::netFnGeneral,
+ intel::general::cmdGetBmcServiceStatus, Privilege::User,
+ getBmcControlServices);
}
} // namespace ipmi