fwupdate: pldmtool - add QueryDeviceIdentifiers
QueryDeviceIdentifiers is used to determine if
the firmware update package is applicable for
updating a specific FD by comparing device
identifier records in the package header to those
obtained from the FD.This patch adds support for
QueryDeviceIdentifiers in pldmtool.
Command Usage:
```
pldmtool fw_update QueryDeviceIdentifiers -m <EID>
pldmtool fw_update QueryDeviceIdentifiers -m 0
{
"EID": 0,
"Descriptors": [
{
"Type": "IANA Enterprise ID",
"Value": [
"58270000"
]
},
{
"Type": "UUID",
"Value": [
"273034c83ec4511695f548701e48d764"
]
},
{
"Type": "Vendor Defined",
"Value": [
{
"TESTID1": "30"
},
{
"TESTID2": "40"
}
]
}
]
}
```
Unit Tests:
1. Verify QueryDeviceIdentifiers response with single descriptors
2. Verify QueryDeviceIdentifiers response with multiple descriptors of
same type
3. Compare query device identifiers with raw response from FD
Signed-off-by: Chinmay Shripad Hegde <hosmanechinmay@gmail.com>
Change-Id: I28b7a368138803dd4407edd06667d8be8b801a2c
diff --git a/pldmtool/pldm_cmd_helper.hpp b/pldmtool/pldm_cmd_helper.hpp
index ef33bcb..6f185dd 100644
--- a/pldmtool/pldm_cmd_helper.hpp
+++ b/pldmtool/pldm_cmd_helper.hpp
@@ -99,6 +99,16 @@
int pldmSendRecv(std::vector<uint8_t>& requestMsg,
std::vector<uint8_t>& responseMsg);
+ /**
+ * @brief get MCTP endpoint ID
+ *
+ * @return uint8_t - MCTP endpoint ID
+ */
+ inline uint8_t getMCTPEID()
+ {
+ return mctp_eid;
+ }
+
private:
const std::string pldmType;
const std::string commandName;