move blob command enum to blob_interface header
Move the blob command enum to the blob_interface header that can be
safely included by other code.
Change-Id: If7c613cac9bdd460fc9a6cb3b59e4fc0dd3a861d
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/tools_blob_unittest.cpp b/test/tools_blob_unittest.cpp
index e9f2c96..3afb61b 100644
--- a/test/tools_blob_unittest.cpp
+++ b/test/tools_blob_unittest.cpp
@@ -44,7 +44,8 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobGetCount};
+ 0xcf, 0xc2, 0x00,
+ static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobGetCount)};
/* return 1 blob count. */
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00,
@@ -66,8 +67,10 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobEnumerate,
- 0x00, 0x00, 0x01, 0x00,
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobEnumerate),
+ 0x00, 0x00,
+ 0x01, 0x00,
0x00, 0x00};
/* return value. */
@@ -92,8 +95,10 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobEnumerate,
- 0x00, 0x00, 0x01, 0x00,
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobEnumerate),
+ 0x00, 0x00,
+ 0x01, 0x00,
0x00, 0x00};
/* return value. */
@@ -115,7 +120,8 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request1 = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobGetCount};
+ 0xcf, 0xc2, 0x00,
+ static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobGetCount)};
/* return 1 blob count. */
std::vector<std::uint8_t> resp1 = {0xcf, 0xc2, 0x00, 0x00, 0x00,
@@ -127,8 +133,10 @@
EXPECT_CALL(*ipmiMock, sendPacket(Eq(request1))).WillOnce(Return(resp1));
std::vector<std::uint8_t> request2 = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobEnumerate,
- 0x00, 0x00, 0x00, 0x00,
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobEnumerate),
+ 0x00, 0x00,
+ 0x00, 0x00,
0x00, 0x00};
/* return value. */
@@ -157,9 +165,12 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobStat,
- 0x00, 0x00, 'a', 'b',
- 'c', 'd', 0x00};
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobStat),
+ 0x00, 0x00,
+ 'a', 'b',
+ 'c', 'd',
+ 0x00};
/* return blob_state: 0xffff, size: 0x00, metadata 0x3445 */
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00, 0xff, 0xff,
@@ -189,9 +200,12 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobStat,
- 0x00, 0x00, 'a', 'b',
- 'c', 'd', 0x00};
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobStat),
+ 0x00, 0x00,
+ 'a', 'b',
+ 'c', 'd',
+ 0x00};
/* return blob_state: 0xffff, size: 0x00, metadata 0x3445 */
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00, 0xff,
@@ -222,8 +236,10 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobSessionStat,
- 0x00, 0x00, 0x01, 0x00};
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobSessionStat),
+ 0x00, 0x00,
+ 0x01, 0x00};
/* return blob_state: 0xffff, size: 0x00, metadata 0x3445 */
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00, 0xff,
@@ -254,9 +270,12 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobOpen,
- 0x00, 0x00, 0x02, 0x04,
- 'a', 'b', 'c', 'd',
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobOpen),
+ 0x00, 0x00,
+ 0x02, 0x04,
+ 'a', 'b',
+ 'c', 'd',
0x00};
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00, 0xfe, 0xed};
@@ -284,8 +303,10 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobClose,
- 0x00, 0x00, 0x01, 0x00};
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobClose),
+ 0x00, 0x00,
+ 0x01, 0x00};
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00};
std::vector<std::uint8_t> reqCrc = {0x01, 0x00};
EXPECT_CALL(crcMock, generateCrc(Eq(reqCrc))).WillOnce(Return(0x00));
@@ -304,8 +325,10 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobCommit,
- 0x00, 0x00, 0x01, 0x00,
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobCommit),
+ 0x00, 0x00,
+ 0x01, 0x00,
0x00};
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00};
@@ -326,10 +349,14 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobWrite,
- 0x00, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 'a', 'b', 'c', 'd'};
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobWrite),
+ 0x00, 0x00,
+ 0x01, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 'a', 'b',
+ 'c', 'd'};
std::vector<std::uint8_t> bytes = {'a', 'b', 'c', 'd'};
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00};
@@ -351,10 +378,14 @@
BlobHandler blob(std::move(ipmi));
std::vector<std::uint8_t> request = {
- 0xcf, 0xc2, 0x00, BlobHandler::BlobOEMCommands::bmcBlobRead,
- 0x00, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00};
+ 0xcf, 0xc2,
+ 0x00, static_cast<std::uint8_t>(BlobOEMCommands::bmcBlobRead),
+ 0x00, 0x00,
+ 0x01, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x04, 0x00,
+ 0x00, 0x00};
std::vector<std::uint8_t> expectedBytes = {'a', 'b', 'c', 'd'};
std::vector<std::uint8_t> resp = {0xcf, 0xc2, 0x00, 0x00, 0x00,