pldm_fru: Add example config JSON for PLDM FRU

Change-Id: Icb2cbe096b54eba5bdfa3411b6ac7cc0d84129b9
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/libpldmresponder/examples/fru/Board_General.json b/libpldmresponder/examples/fru/Board_General.json
new file mode 100644
index 0000000..fc58c3c
--- /dev/null
+++ b/libpldmresponder/examples/fru/Board_General.json
@@ -0,0 +1,37 @@
+# This JSON has the information needed to create General FRU record for FRU of
+# type Board. The FRU fields are based on the PLDM specification DSP0257.
+{
+   "record_details":
+   {
+        # FRU Record Type - General FRU Record
+        "fru_record_type" : 1,
+        # Encoding Type for FRU fields - ASCII
+        "fru_encoding_type": 1,
+        "dbus_interface_name": "xyz.openbmc_project.Inventory.Item.Board"
+   },
+   "fru_fields":[
+      {
+         # FRU Field Type 3 - Part Number
+         "fru_field_type" : 3,
+         # D-Bus property to read and populate the FRU field
+         "dbus":
+            {
+               "interface" : "xyz.openbmc_project.Inventory.Decorator.Asset",
+               "property_name" : "PartNumber",
+               "property_type" : "string"
+            }
+      },
+      {
+         # FRU Field Type 4 - Serial Number
+         "fru_field_type" : 4,
+         # D-Bus property to read and populate the FRU field
+         "dbus":
+            {
+               "interface" : "xyz.openbmc_project.Inventory.Decorator.Asset",
+               "property_name" : "SerialNumber",
+               "property_type" : "string"
+            }
+      }
+    ]
+}
+
diff --git a/libpldmresponder/examples/fru/Board_VINI.json b/libpldmresponder/examples/fru/Board_VINI.json
new file mode 100644
index 0000000..fd58717
--- /dev/null
+++ b/libpldmresponder/examples/fru/Board_VINI.json
@@ -0,0 +1,38 @@
+# This JSON has the information needed to create OEM FRU record VINI for FRU of
+# type Board.
+{
+   "record_details":
+   {
+        # FRU Record Type - OEM FRU Record
+        "fru_record_type" : 254,
+        # Encoding Type for FRU fields - ASCII
+        "fru_encoding_type": 1,
+        "dbus_interface_name": "xyz.openbmc_project.Inventory.Item.Board"
+   },
+   "fru_fields":[
+      {
+         # FRU Field Type 2 - Keyword RT
+         "fru_field_type" : 2,
+         # D-Bus property to read and populate the FRU field
+         "dbus":
+            {
+               "interface" : "com.ibm.ipzvpd.VINI",
+               "property_name" : "RT",
+               "property_type" : "string"
+            }
+      },
+      {
+         # FRU Field Type 3 - Keyword B3
+         "fru_field_type" : 3,
+         # D-Bus property to read and populate the FRU field
+         "dbus":
+            {
+               "interface" : "com.ibm.ipzvpd.VINI",
+               "property_name" : "B3",
+               "property_type" : "bytearray"
+            }
+      }
+
+    ]
+}
+
diff --git a/libpldmresponder/examples/fru/Cpu_General.json b/libpldmresponder/examples/fru/Cpu_General.json
new file mode 100644
index 0000000..8021001
--- /dev/null
+++ b/libpldmresponder/examples/fru/Cpu_General.json
@@ -0,0 +1,36 @@
+# This JSON has the information needed to create General FRU record for FRU of
+# type Cpu. The FRU fields are based on the PLDM specification DSP0257.
+{
+   "record_details":
+   {
+        # FRU Record Type - General FRU Record
+        "fru_record_type" : 1,
+        # Encoding Type for FRU fields - ASCII
+        "fru_encoding_type": 1,
+        "dbus_interface_name": "xyz.openbmc_project.Inventory.Item.Cpu"
+   },
+   "fru_fields":[
+      {
+         # FRU Field Type 3 - Part Number
+         "fru_field_type" : 3,
+         # D-Bus property to read and populate the FRU field
+         "dbus":
+            {
+               "interface" : "xyz.openbmc_project.Inventory.Decorator.Asset",
+               "property_name" : "PartNumber",
+               "property_type" : "string"
+            }
+      },
+      {
+         # FRU Field Type 4 - Serial Number
+         "fru_field_type" : 4,
+         # D-Bus property to read and populate the FRU field
+         "dbus":
+            {
+               "interface" : "xyz.openbmc_project.Inventory.Decorator.Asset",
+               "property_name" : "SerialNumber",
+               "property_type" : "string"
+            }
+      }
+    ]
+}
diff --git a/libpldmresponder/examples/fru/FRU_Master.json b/libpldmresponder/examples/fru/FRU_Master.json
new file mode 100644
index 0000000..3156022
--- /dev/null
+++ b/libpldmresponder/examples/fru/FRU_Master.json
@@ -0,0 +1,19 @@
+# This is the master config file for generating PLDM FRU records from the D-Bus
+# inventory objects. "service" is the name of D-Bus service hosting the
+# inventory D-Bus objects, "root_path" is the root path for all the inventory
+# D-Bus objects and "interfaces" section specifies the type of FRU's for which,
+# FRU records will be created in the FRU table. In this example, PLDM FRU
+# records will be created for all FRU's of type Board and CPU. For each FRU
+# type, corresponding config JSON's are needed for each record. In the example
+# directory, Board_General.json is the config to generate the General FRU record
+# for FRU of type Board and Board_VINI.json is the config to generate the OEM
+# record (VINI is a record in IBM IPZ VPD format) for FRU of type Board. For all
+# instances of the same FRU, the same config JSON will apply.
+{
+    "service":"xyz.openbmc_project.Inventory.Manager",
+    "root_path":"/xyz/openbmc_project/inventory/system/",
+    "interfaces":[
+        "xyz.openbmc_project.Inventory.Item.Board",
+        "xyz.openbmc_project.Inventory.Item.Cpu"
+    ]
+}