Clone this repo:
  1. 16eeccc dsp: base: Allow PLDM File Transfer use MultipartReceive decode API by John Chung · 13 days ago main
  2. 21a639d dsp: base: Add encode resp for MultipartReceive command by John Chung · 14 days ago
  3. 76c9b19 dsp: file: Add decode req & encode resp for DfOpen & DfClose command by John Chung · 3 weeks ago
  4. ea5f737 dsp: platform: Add sensor enable responder by Matt Johnston · 6 weeks ago
  5. c127a01 tools: Make pd-tool build optional by Matt Johnston · 6 weeks ago

libpldm

This is a library which deals with the encoding and decoding of PLDM messages. It should be possible to use this library by projects other than OpenBMC, and hence certain constraints apply to it:

  • keeping it light weight
  • implementation in C
  • minimal dynamic memory allocations
  • endian-safe
  • no OpenBMC specific dependencies

Source files are named according to the PLDM Type, for eg base.[h/c], fru.[h/c], etc.

Given a PLDM command "foo", the library will provide the following API: For the Requester function:

encode_foo_req() - encode a foo request
decode_foo_resp() - decode a response to foo

For the Responder function:

decode_foo_req() - decode a foo request
encode_foo_resp() - encode a response to foo

The library also provides API to pack and unpack PLDM headers.

To Build

libpldm is configured and built using meson. Python's pip or pipx can be used to install a recent version on your machine:

pipx install meson

Once meson is installed:

meson setup build && meson compile -C build

To run unit tests

meson test -C build

Working with libpldm

Components of the library ABI[^1] (loosely, functions) are separated into three categories:

[^1]: "library API + compiler ABI = library ABI"

  1. Stable
  2. Testing
  3. Deprecated

Applications depending on libpldm should aim to only use functions from the stable category. However, this may not always be possible. What to do when required functions fall into the deprecated or testing categories is discussed in CONTRIBUTING.