pldmtool: Fix confusing attribute name
- The intent behind this commit is to fix the confused attribute
name. when we run `pldmtool bios getBIOSTable -t
1(PLDM_BIOS_ATTR_TABLE)`, we can only get the default value and
index.
- Early naming will make the caller mistakenly think that this is
the currect value. In fact, we need to run `pldmtool bios
getBIOSTable -t 2(PLDM_BIOS_ATTR_VAL_TABLE)` to get the currect
value.
Tested:
- pldmtool bios getBIOSTable -t 1
Before:
{
"AttributeHandle": 19,
"AttributeNameHandle": "28(pvm_system_power_off_policy)",
"AttributeType": "BIOSEnumeration",
"NumberOfPossibleValues": 3,
"PossibleValueStringHandle[0]": "12(Power Off)",
"PossibleValueStringHandle[1]": "14(Stay On)",
"PossibleValueStringHandle[2]": "2(Automatic)",
"NumberOfDefaultValues": 1,
"DefaultValueStringHandleIndex[0]": 2,
"StringHandle": "2(Automatic)"
}
After:
{
"AttributeHandle": 19,
"AttributeNameHandle": "28(pvm_system_power_off_policy)",
"AttributeType": "BIOSEnumeration",
"NumberOfPossibleValues": 3,
"PossibleValueStringHandle[0]": "12(Power Off)",
"PossibleValueStringHandle[1]": "14(Stay On)",
"PossibleValueStringHandle[2]": "2(Automatic)",
"NumberOfDefaultValues": 1,
"DefaultValueStringHandleIndex[0]": 2,
"DefaultValueStringHandle": "2(Automatic)"
}
- pldmtool bios getBIOSTable -t 2
{
"AttributeHandle": 19,
"AttributeType": "BIOSEnumeration",
"NumberOfCurrentValues": 1,
"CurrentValueStringHandleIndex[0]": "Automatic"
}
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ib493d80431dad039f264c65cbdcb8bab80ca85f0
diff --git a/pldmtool/pldm_bios_cmd.cpp b/pldmtool/pldm_bios_cmd.cpp
index 72bc715..68fc2d8 100644
--- a/pldmtool/pldm_bios_cmd.cpp
+++ b/pldmtool/pldm_bios_cmd.cpp
@@ -564,8 +564,9 @@
{
attrdata["DefaultValueStringHandleIndex[" +
std::to_string(i) + "]"] = (int)defIndices[i];
- attrdata["StringHandle"] = displayStringHandle(
- pvHandls[defIndices[i]], stringTable);
+ attrdata["DefaultValueStringHandle"] =
+ displayStringHandle(pvHandls[defIndices[i]],
+ stringTable);
}
break;
}