Add custom field to Fru area

Added Extra custom Field to Fru areas from Fru spec for
manufacturing information.

Also added a check for last byte C1 in each Fru areas as
well as zero byte.

Tested: Build Facebook TiogaPass board and load on the
target hardware. Ensure that Fru information are updated.

Change-Id: I4b0ec359fa5dac3003f49449c31f12a984a8561d
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index 03cfed6..f879afd 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -263,15 +263,16 @@
                boost::container::flat_map<std::string, std::string> &result)
 {
     static const std::vector<const char *> CHASSIS_FRU_AREAS = {
-        "PART_NUMBER", "SERIAL_NUMBER", "CHASSIS_INFO_AM1", "CHASSIS_INFO_AM2"};
+        "PART_NUMBER", "SERIAL_NUMBER", "INFO_AM1", "INFO_AM2"};
 
     static const std::vector<const char *> BOARD_FRU_AREAS = {
-        "MANUFACTURER", "PRODUCT_NAME", "SERIAL_NUMBER", "PART_NUMBER",
-        "VERSION_ID"};
+        "MANUFACTURER",   "PRODUCT_NAME", "SERIAL_NUMBER", "PART_NUMBER",
+        "FRU_VERSION_ID", "INFO_AM1",     "INFO_AM2"};
 
     static const std::vector<const char *> PRODUCT_FRU_AREAS = {
-        "MANUFACTURER",    "PRODUCT_NAME",          "PART_NUMBER",
-        "PRODUCT_VERSION", "PRODUCT_SERIAL_NUMBER", "ASSET_TAG"};
+        "MANUFACTURER",   "PRODUCT_NAME",  "PART_NUMBER",
+        "VERSION",        "SERIAL_NUMBER", "ASSET_TAG",
+        "FRU_VERSION_ID", "INFO_AM1",      "INFO_AM2"};
 
     size_t sum = 0;
 
@@ -357,6 +358,21 @@
                 size_t length = *fruBytesIter & 0x3f;
                 fruBytesIter += 1;
 
+                /* Checking for length if field present */
+                if (length == 0)
+                {
+                    result[std::string(area) + "_" + field] =
+                        std::string("Null");
+                    continue;
+                }
+
+                /* Checking for last byte C1 to indicate that no more
+                 * field to be read */
+                if (length == 1)
+                {
+                    break;
+                }
+
                 if (fruBytesIter >= fruBytes.end())
                 {
                     return false;