groupextcommands: revise 9 bytes postcode object
Store first 8 bytes in primary code, and store the last byte in
secondary code array.
Test results:
```
root@bmc:~# busctl call xyz.openbmc_project.State.Boot.PostCode0 /xyz/openbmc_project/State/Boot/PostCode0 xyz.openbmc_project.State.Boot.PostCode GetPostCodes q 1 -j
{
"type" : "a(tay)",
"data" : [
[
[
72623859790382856,
[
9
]
],
[
1230066625199609624,
[
25
]
],
[
2387509390608836392,
[
41
]
],
[
2387509390608836392,
[
48
]
]
]
]
}
```
Change-Id: Id58c457f2107b447daed90bd3cd3b2a268e1b28f
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
diff --git a/src/groupextcommands.cpp b/src/groupextcommands.cpp
index b4e6a7d..8fa9f08 100644
--- a/src/groupextcommands.cpp
+++ b/src/groupextcommands.cpp
@@ -44,7 +44,10 @@
try
{
auto primaryPostCode = reinterpret_cast<const uint64_t*>(data.data());
- auto postCode = postcode_t(bigEndianToHost(*primaryPostCode), data);
+ auto secondaryPostCode =
+ std::vector<uint8_t>(data.begin() + 8, data.end());
+ auto postCode =
+ postcode_t(bigEndianToHost(*primaryPostCode), secondaryPostCode);
auto conn = getSdBus();
auto hostbootRawObj =
std::string(bootRawObjPrefix) + std::to_string(*hostId);