Pldmtool change to fetch pdrs based on TerminusID
This commit adds a new option "-n" to getPDR in the pldmtool using
which we can retrieve the PDRs based on the terminus ID.
Tested:
./pldmtool platform getpdr -h
get platform descriptor records
Usage: ./pldmtool platform GetPDR [OPTIONS]
Options:
-h,--help Print this help message and exit
-m,--mctp_eid UINT MCTP endpoint ID
-v,--verbose
[Option Group: Required Option]
Retrieve individual PDR, all PDRs, PDRs of a requested type or retrieve all PDRs of the requested terminusID
[Exactly 1 of the following options is required]
Options:
-d,--data UINT retrieve individual PDRs from a PDR Repository
eg: The recordHandle value for the PDR to be retrieved and 0 means get first PDR in the repository.
-t,--type TEXT retrieve all PDRs of the requested type
supported types:
[terminusLocator, stateSensor, numericEffecter, stateEffecter, EntityAssociation, fruRecord, ... ]
-i,--terminusID UINT retrieve all PDRs of the requested terminusID
supported IDs:
[1, 2, 208...]
-a,--all retrieve all PDRs from a PDR repository
Example 1:
./pldmtool platform getpdr -i 0
[]
Example 2:
./pldmtool platform getpdr -i 2
Copied the output here:
https://gist.github.com/Pavithrab7/4218104bc7e58951ff91fe5b49e562b0
Change-Id: I8b78818abbbbb3678e180d2bd1f38017454fd0d3
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
diff --git a/pldmtool/pldm_cmd_helper.hpp b/pldmtool/pldm_cmd_helper.hpp
index 6f185dd..1f21ea2 100644
--- a/pldmtool/pldm_cmd_helper.hpp
+++ b/pldmtool/pldm_cmd_helper.hpp
@@ -109,6 +109,26 @@
return mctp_eid;
}
+ /**
+ * @brief get PLDM type
+ *
+ * @return pldm type
+ */
+ inline std::string getPLDMType()
+ {
+ return pldmType;
+ }
+
+ /**
+ * @brief get command name
+ *
+ * @return the command name
+ */
+ inline std::string getCommandName()
+ {
+ return commandName;
+ }
+
private:
const std::string pldmType;
const std::string commandName;