pldmtool: Implement GetBIOSTable for attr/attrValue Table
Implement GetBIOSTable for the attribute table and attribute
value table.
Implement an iterator for bios table, it may be used in
libpldmresponder, at least in unit tests. So it's placed
in the utils namespace.
Tested:
Tested on fp5280g2, with json files:
https://gist.github.com/wangzqbj/b24558331cb35d14fca3b555ef03e458
$ pldmtool bios GetBIOSTable -t 0
...
...
PLDM StringTable:
BIOSStringHandle : BIOSString
0 : CodeUpdatePolicy
1 : Concurrent
2 : Disruptive
3 : Led
4 : Model
5 : OUTLET
6 : Off
7 : On
8 : str_example3
$ pldmtool bios GetBIOSTable -t 1
...
...
PLDM AttributeTable:
AttributeHandle: 0, AttributeNameHandle: 0(CodeUpdatePolicy)
AttributeType: BIOSEnumerationReadOnly
NumberOfPossibleValues: 2
PossibleValueStringHandle[0] = 1(Concurrent)
PossibleValueStringHandle[1] = 2(Disruptive)
NumberOfDefaultValues: 1
DefaultValueStringHandleIndex[0] = 0, StringHandle = 1(Concurrent)
AttributeHandle: 1, AttributeNameHandle: 3(Led)
AttributeType: BIOSEnumeration
NumberOfPossibleValues: 2
PossibleValueStringHandle[0] = 6(Off)
PossibleValueStringHandle[1] = 7(On)
NumberOfDefaultValues: 1
DefaultValueStringHandleIndex[0] = 0, StringHandle = 6(Off)
AttributeHandle: 2, AttributeNameHandle: 5(OUTLET)
AttributeType: BIOSInteger
LowerBound: 0
UpperBound: 68002
ScalarIncrement: 1
DefaultValue:0
AttributeHandle: 3, AttributeNameHandle: 4(Model)
AttributeType: BIOSString
StringType: 0x01
MinimumStringLength: 1
MaximumStringLength: 100
DefaultStringLength: 8
DefaultString: FP5280G2
AttributeHandle: 4, AttributeNameHandle: 8(str_example3)
AttributeType: BIOSStringReadOnly
StringType: 0x00
MinimumStringLength: 1
MaximumStringLength: 100
DefaultStringLength: 2
DefaultString: ef
$ pldmtool bios GetBIOSTable -t 2
...
...
PLDM AttributeValueTable:
AttributeHandle: 0
AttributeType: BIOSEnumerationReadOnly
NumberOfCurrentValues: 1
CurrentValueStringHandleIndex[0] = 0, StringHandle = 1(Concurrent)
AttributeHandle: 1
AttributeType: BIOSEnumeration
NumberOfCurrentValues: 1
CurrentValueStringHandleIndex[0] = 0, StringHandle = 6(Off)
AttributeHandle: 2
AttributeType: BIOSInteger
CurrentValue: 0
AttributeHandle: 3
AttributeType: BIOSString
CurrentStringLength: 12
CurrentString: powersupply0
AttributeHandle: 4
AttributeType: BIOSStringReadOnly
CurrentStringLength: 2
CurrentString: ef
Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: Iaf79af8267fc0afc5c53704537dd7b6dfc36a6a7
diff --git a/tool/pldm_cmd_helper.hpp b/tool/pldm_cmd_helper.hpp
index 2c736ec..8060751 100644
--- a/tool/pldm_cmd_helper.hpp
+++ b/tool/pldm_cmd_helper.hpp
@@ -66,7 +66,10 @@
virtual void parseResponseMsg(struct pldm_msg* responsePtr,
size_t payloadLength) = 0;
- void exec();
+ virtual void exec();
+
+ int pldmSendRecv(std::vector<uint8_t>& requestMsg,
+ std::vector<uint8_t>& responseMsg);
private:
const std::string pldmType;