Fix "ID String Type/Length Code" byte for get sdr command

Root cause :
Currently, the byte of "Type/Length Code" for dbus-sdr
get sdr record command is incorrect when the length of
sensor name is longer than 16 bytes. The suffix of the
sensor name would be replace with blank and resize the
sensor name with FULL_RECORD_ID_STR_MAX_LENGTH. Due to
this reason the "Type/Length Code" would record incorrect
data 0x10 (i.e. 16 bytes length sensor ID string).

Solution :
Resizing the sensor name when it is still longer than 16
bytes after replacing the suffix with blank.

Example :
Sensor Name = cpu0_pvccd_hv_Output_Current

The result of getting SDR record without this change.
0a 00 09 00 51 01 3b 20 00 09 07 1d 00 68 03 01
04 22 04 22 12 12 80 05 00 00 b8 00 b0 00 00 d2
00 00 00 00 00 00 00 79 00 00 85 00 00 00 00 00
00 d0 63 70 75 30 5f 70 76 63 63 64 5f 68 76 00
00 00

The result of getting SDR record with this change.
0a 00 09 00 51 01 3b 20 00 09 07 1d 00 68 03 01
04 22 04 22 12 12 80 05 00 00 b8 00 b0 00 00 d2
00 00 00 00 00 00 00 79 00 00 85 00 00 00 00 00
00 cd 63 70 75 30 5f 70 76 63 63 64 5f 68 76 00
00 00

Tested:
Check the type/length byte is correct through ipmi cmd.

Google-Bug-Id: 315753500
Google-Bug-Id: 318615639
Change-Id: I0a89ab967ee58166037c71c85750783a15a19ad2
Signed-off-by: Duke Du <Duke.Du@quantatw.com>
(cherry picked from commit 83d772ae2ce548b2c289811d940c03dfa5cbcf5a)
2 files changed
tree: 1a76edc592df36bb307168a6e8f04a0c449afe58
  1. conf/
  2. dynamic-layers/
  3. recipes-bsp/
  4. recipes-connectivity/
  5. recipes-core/
  6. recipes-devtools/
  7. recipes-extended/
  8. recipes-google/
  9. recipes-kernel/
  10. recipes-phosphor/
  11. LICENSE
  12. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.