Change primary postcode interface to byte array

Change primary code to std::vector<uint8_t> to meet the changes in
phosphor-dbus-interface.

[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/74633

Change-Id: Ib5822973a1dbc6aa8c52f4e81b56091dc33b5f08
Signed-off-by: Cosmo Chou <cosmo.chou@quantatw.com>
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
diff --git a/ipmisnoop/ipmisnoop.hpp b/ipmisnoop/ipmisnoop.hpp
index d8319ac..3f52275 100644
--- a/ipmisnoop/ipmisnoop.hpp
+++ b/ipmisnoop/ipmisnoop.hpp
@@ -19,7 +19,6 @@
 const std::string ipmiSnoopObject = "/xyz/openbmc_project/state/boot/raw";
 
 const int hostParseIdx = 3;
-const int maxPostcode = 255;
 const int maxPosition = 4;
 
 extern bool sevenSegmentLedEnabled;
@@ -54,7 +53,7 @@
             sdbusplus::bus::match::rules::propertiesChanged(objPath, rawIface),
 
             [this, &bus](sdbusplus::message_t& msg) {
-                using primarycode_t = uint64_t;
+                using primarycode_t = std::vector<uint8_t>;
                 using secondarycode_t = std::vector<uint8_t>;
                 using postcode_t = std::tuple<primarycode_t, secondarycode_t>;
 
@@ -95,18 +94,15 @@
                     std::cerr << "Value property is not found " << std::endl;
                     return;
                 }
-                uint64_t postcode =
+                auto postcode =
                     std::get<0>(std::get<postcode_t>(valPropMap->second));
 
-                if (postcode <= maxPostcode)
+                if (postcode.size() == 1)
                 {
                     if (position == hostNum)
                     {
-                        uint8_t postcode_8bit =
-                            static_cast<uint8_t>(postcode & 0x0000FF);
-
                         // write postcode into seven segment display
-                        if (postCodeDisplay(postcode_8bit) < 0)
+                        if (postCodeDisplay(postcode[0]) < 0)
                         {
                             fprintf(stderr, "Error in display the postcode\n");
                         }