Skip to content

Fmp payload header

fmp_payload_header

Module that encodes and decodes a FMP_PAYLOAD_HEADER with a payload.

The FMP_PAYLOAD_HEADER is processed by the FmpPayloadHeaderLib in the FmpDevicePkg.

FmpPayloadHeaderClass

An object representing a FMP_PAYLOAD_HEADER.

typedef struct { UINT32 Signature; UINT32 HeaderSize; UINT32 FwVersion; UINT32 LowestSupportedVersion; } FMP_PAYLOAD_HEADER;

define FMP_PAYLOAD_HEADER_SIGNATURE SIGNATURE_32 ('M', 'S', 'S', '1')

__init__

__init__() -> FmpPayloadHeaderClass

Inits an empty object.

Encode

Encode() -> bytes

Serializes the Header + payload.

Returns:

Type Description
bytes

string representing packed data as bytes (i.e. b'\x01\x00\x03')

Decode

Decode(Buffer: bytes) -> bytes

Loads data into the Object by parsing a buffer.

Parameters:

Name Type Description Default
Buffer obj

Buffer containing the data

required

Returns:

Type Description
str

string of binary representing the payload

Raises:

Type Description
ValueError

Invalid Buffer

ValueError

Invalid Signature

ValueError

Invalid Header size

DumpInfo

DumpInfo() -> None

Prints payload header information.