buffer: Implement "updateBmcFlags"

This function will be used to update the "bmcFlags" member of the buffer
header.

Also reinforced the updateReadPtr unit tests to check that the header
buffer was actually updated by checking the result after.

Tested: Unit tested

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: Iff7a1eea6824b84347e1a6aaed872ed6caa55788
diff --git a/include/buffer.hpp b/include/buffer.hpp
index d676165..54d197e 100644
--- a/include/buffer.hpp
+++ b/include/buffer.hpp
@@ -21,6 +21,13 @@
 // EntryPair.second = Error entry in vector of bytes
 using EntryPair = std::pair<struct QueueEntryHeader, std::vector<uint8_t>>;
 
+enum class BmcFlags : uint32_t
+{
+    ueSwitch = 1,
+    overflow = 1 << 1,
+    ready = 1 << 2,
+};
+
 struct CircularBufferHeader
 {
     little_uint32_t bmcInterfaceVersion;        // Offset 0x0
@@ -110,6 +117,12 @@
     virtual void updateReadPtr(const uint32_t newReadPtr) = 0;
 
     /**
+     * Write to the bufferHeader and update the BMC flags
+     * @param[in] newBmcFlags - new flag to update to
+     */
+    virtual void updateBmcFlags(const uint32_t newBmcFlags) = 0;
+
+    /**
      * Wrapper for the dataInterface->read, performs wraparound read
      *
      * @param[in] relativeOffset - offset relative the "Error Log
@@ -162,6 +175,7 @@
     void readBufferHeader() override;
     struct CircularBufferHeader getCachedBufferHeader() const override;
     void updateReadPtr(const uint32_t newReadPtr) override;
+    void updateBmcFlags(const uint32_t newBmcFlag) override;
     std::vector<uint8_t> wraparoundRead(const uint32_t relativeOffset,
                                         const uint32_t length) override;
     struct QueueEntryHeader readEntryHeader(size_t relativeOffset) override;