diff --git a/example.cpp b/example.cpp
index bfd28ad..9bec1b9 100644
--- a/example.cpp
+++ b/example.cpp
@@ -22,10 +22,11 @@
 #include <memory>
 
 /* Example PostCode handler which simply prints them */
-static void printPostcode(uint64_t postcode)
+static void printPostcode(postcode_t postcode)
 {
     /* Print output to verify the example program is receiving values. */
-    std::printf("recv: 0x%" PRIx64 "\n", postcode);
+    std::printf("recv: 0x%" PRIx64 "\n",
+                std::get<primary_post_code_t>(postcode));
 }
 
 /*
diff --git a/lpcsnoop/snoop.hpp b/lpcsnoop/snoop.hpp
index 2c89127..68d51b4 100644
--- a/lpcsnoop/snoop.hpp
+++ b/lpcsnoop/snoop.hpp
@@ -13,6 +13,9 @@
 using ServerObject = typename sdbusplus::server::object::object<T...>;
 using PostInterface = sdbusplus::xyz::openbmc_project::State::Boot::server::Raw;
 using PostObject = ServerObject<PostInterface>;
+using primary_post_code_t = uint64_t;
+using secondary_post_code_t = std::vector<uint8_t>;
+using postcode_t = std::tuple<primary_post_code_t, secondary_post_code_t>;
 
 class PostReporter : public PostObject
 {
diff --git a/lpcsnoop/snoop_listen.hpp b/lpcsnoop/snoop_listen.hpp
index 1ff189d..475028f 100644
--- a/lpcsnoop/snoop_listen.hpp
+++ b/lpcsnoop/snoop_listen.hpp
@@ -36,7 +36,7 @@
 class SnoopListen
 {
     using message_handler_t = std::function<void(sdbusplus::message::message&)>;
-    using postcode_handler_t = std::function<void(uint64_t)>;
+    using postcode_handler_t = std::function<void(postcode_t)>;
 
   public:
     SnoopListen(sdbusplus::bus::bus& busIn, sd_bus_message_handler_t handler) :
@@ -74,7 +74,7 @@
                                       sdbusplus::message::message& m)
     {
         std::string messageBusName;
-        std::map<std::string, std::variant<uint64_t>> messageData;
+        std::map<std::string, std::variant<postcode_t>> messageData;
         constexpr char propertyKey[] = "Value";
 
         m.read(messageBusName, messageData);
@@ -82,7 +82,7 @@
         if (messageBusName == SNOOP_BUSNAME &&
             messageData.find(propertyKey) != messageData.end())
         {
-            handler(get<uint64_t>(messageData[propertyKey]));
+            handler(get<postcode_t>(messageData[propertyKey]));
         }
     }
 };
diff --git a/main.cpp b/main.cpp
index db0532d..d25fd6f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -64,8 +64,8 @@
         // HACK: Always send property changed signal even for the same code
         // since we are single threaded, external users will never see the
         // first value.
-        reporter->value(~code, true);
-        reporter->value(code);
+        reporter->value(std::make_tuple(~code, secondary_post_code_t{}), true);
+        reporter->value(std::make_tuple(code, secondary_post_code_t{}));
 
         // read depends on old data being cleared since it doens't always read
         // the full code size
diff --git a/test/post_reporter_test.cpp b/test/post_reporter_test.cpp
index 0dbbcfe..5213593 100644
--- a/test/post_reporter_test.cpp
+++ b/test/post_reporter_test.cpp
@@ -55,29 +55,51 @@
 TEST_F(PostReporterTest, ValueReadsDefaultToZero)
 {
     PostReporter testReporter(bus, SNOOP_OBJECTPATH, true);
-    EXPECT_EQ(0, testReporter.value());
+    EXPECT_EQ(0, std::get<primary_post_code_t>(testReporter.value()));
 }
 
 TEST_F(PostReporterTest, SetValueToPositiveValueWorks)
 {
     PostReporter testReporter(bus, SNOOP_OBJECTPATH, true);
-    testReporter.value(65537);
-    EXPECT_EQ(65537, testReporter.value());
+    secondary_post_code_t secondaryCode = {123, 124, 125};
+    testReporter.value(std::make_tuple(65537, secondaryCode));
+    EXPECT_EQ(65537, std::get<primary_post_code_t>(testReporter.value()));
+    EXPECT_EQ(secondaryCode,
+              std::get<secondary_post_code_t>(testReporter.value()));
 }
 
 TEST_F(PostReporterTest, SetValueMultipleTimesWorks)
 {
     PostReporter testReporter(bus, SNOOP_OBJECTPATH, true);
-    testReporter.value(123);
-    EXPECT_EQ(123, testReporter.value());
-    testReporter.value(456);
-    EXPECT_EQ(456, testReporter.value());
-    testReporter.value(0);
-    EXPECT_EQ(0, testReporter.value());
-    testReporter.value(456);
-    EXPECT_EQ(456, testReporter.value());
-    testReporter.value(456);
-    EXPECT_EQ(456, testReporter.value());
+    secondary_post_code_t secondaryCode = {10, 40, 0, 245, 56};
+    testReporter.value(std::make_tuple(123, secondaryCode));
+    EXPECT_EQ(123, std::get<primary_post_code_t>(testReporter.value()));
+    EXPECT_EQ(secondaryCode,
+              std::get<secondary_post_code_t>(testReporter.value()));
+
+    secondaryCode = {0, 0, 0, 0, 0};
+    testReporter.value(std::make_tuple(45, secondaryCode));
+    EXPECT_EQ(45, std::get<primary_post_code_t>(testReporter.value()));
+    EXPECT_EQ(secondaryCode,
+              std::get<secondary_post_code_t>(testReporter.value()));
+
+    secondaryCode = {23, 200, 0, 45, 2};
+    testReporter.value(std::make_tuple(0, secondaryCode));
+    EXPECT_EQ(0, std::get<primary_post_code_t>(testReporter.value()));
+    EXPECT_EQ(secondaryCode,
+              std::get<secondary_post_code_t>(testReporter.value()));
+
+    secondaryCode = {10, 40, 0, 35, 78};
+    testReporter.value(std::make_tuple(46, secondaryCode));
+    EXPECT_EQ(46, std::get<primary_post_code_t>(testReporter.value()));
+    EXPECT_EQ(secondaryCode,
+              std::get<secondary_post_code_t>(testReporter.value()));
+
+    secondaryCode = {10, 40, 0, 35, 78};
+    testReporter.value(std::make_tuple(46, secondaryCode));
+    EXPECT_EQ(46, std::get<primary_post_code_t>(testReporter.value()));
+    EXPECT_EQ(secondaryCode,
+              std::get<secondary_post_code_t>(testReporter.value()));
 }
 
 } // namespace
