Define method and properties for phosphor-post-code-manager
1. Method: std::vector<uint64_t> PostCode::getPostCodes(uint16_t index)
2. Properties: CurrentBootCycleIndex/MaxBootCycleNum
Tested:
Every cycle post codes is saved in "/var/lib/phosphor-post-code-manager"
"1" file is saved all post codes for cycle 1
"2" file is saved all post codes for cycle 2
"CurrentBootCycleIndex" file is saved the current boot cycle number.
root@wolfpass:/var/lib/phosphor-post-code-manager# ls
1 2 CurrentBootCycleIndex
Implementation is at:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-post-code-manager/+/18503
Change-Id: Iaca6042192771fe347cabcccd3d074fd9eb2926e
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
diff --git a/xyz/openbmc_project/State/Boot/PostCode.interface.yaml b/xyz/openbmc_project/State/Boot/PostCode.interface.yaml
new file mode 100644
index 0000000..d4825a7
--- /dev/null
+++ b/xyz/openbmc_project/State/Boot/PostCode.interface.yaml
@@ -0,0 +1,33 @@
+description: >
+ Monitor Post code coming and buffer all of them based on boot cycle
+ into file system.
+
+properties:
+ - name: CurrentBootCycleIndex
+ type: uint16
+ description: >
+ It is used to indicate current boot cycle index.
+ Index is start from 1 and continue to MaxBootCycleNum
+ - name: MaxBootCycleNum
+ type: uint16
+ description: >
+ The max cached boot cycles for post code.
+ It is used to indicate end user what's the max boot number,
+ and make sure get command parameter less than it.
+methods:
+ - name: GetPostCodes
+ description: >
+ Method to get the cached post codes of the indicated boot cycle.
+ parameters:
+ - name: Index
+ type: uint16
+ description: >
+ Index indicates which boot cycle of post codes is requested.
+ returns:
+ - name: Codes
+ type: array[uint64]
+ description: >
+ An array of post codes of one boot cycle.
+ errors:
+ - xyz.openbmc_project.Common.Error.InternalFailure
+ - xyz.openbmc_project.Common.Error.InvalidArgument