Back to Fprime

Fw::Dp Framework Support for Data Products

Fw/Dp/docs/sdd.md

4.2.25.2 KB
Original Source

Fw::Dp Framework Support for Data Products

1. Introduction

This build module defines FPP ports and C++ classes that support the collection and storage of data products. For more information on data products and records, see the data products documentation.

2. Configuration

The following types and constants are configurable via the file config/DpCfg.fpp:

NameKindDescription
Fw::DpCfg::ProcTypeTypeThe enumeration type that defines the bit mask for selecting a type of processing. The processing is applied to a container before writing it to disk.
Fw::DpCfg::CONTAINER_USER_DATA_SIZEConstantThe size of the user-configurable data in the container packet header.

3. FPP Types

This build module defines the following FPP types:

  1. DpState: An enumeration describing the state of a data product.

4. FPP Ports

This build module defines the following FPP ports:

  1. DpGet: A port for synchronously getting a buffer to back a data product container.

  2. DpRequest: A port for sending a request for a buffer to back a data product container.

  3. DpResponse: A port for receiving a response to a buffer request.

  4. DpSend: A port for sending a buffer holding data products.

For more information, see the file Dp.fpp in the parent directory.

5. C++ Classes

This module defines a C++ class DpContainer. DpContainer is the base class for a data product container. When you specify a container C in an FPP component model, the auto-generated C++ for the component defines a container class for C. The container class is derived from DpContainer. It provides all the generic operations defined in DpContainer plus the operations that are specific to C, for example serializing the specific types of data that C can store.

<a name="serial-format"></a>

5.1. Serialized Container Format

In serialized form, each data product container consists of the following elements: a header, a header hash, data, and a data hash.

5.1.1. Header

The data product header has the following format.

Field NameData TypeSerialized SizeDescription
PacketDescriptorFwPacketDescriptorTypesizeof(FwPacketDescriptorType)The F Prime packet descriptor FW_PACKET_DP
IdFwDpIdTypesizeof(FwDpIdType)The container ID. This is a system-global ID (component-local ID + component base ID)
PriorityFwDpPriorityTypesizeof(FwDpPriorityType)The container priority
TimeTagFw::TimeFw::Time::SERIALIZED_SIZEThe time tag associated with the container
ProcTypesFw::DpCfg::ProcType::SerialTypesizeof(Fw::DpCfg::ProcType::SerialType)The processing types, represented as a bit mask
UserDataHeader::UserDataDpCfg::CONTAINER_USER_DATA_SIZEUser-configurable data
DpStateDpStateDpState::SERIALIZED_SIZEThe data product state
DataSizeFwSizeTypesizeof(FwSizeStoreType)The size of the data payload in bytes

Header::UserData is an array of U8 of size Fw::DpCfg::CONTAINER_USER_DATA_SIZE.

5.1.2. Header Hash

The header hash has the following format.

Field NameSerialized SizeDescription
Header HashHASH_DIGEST_LENGTHThe hash value guarding the header.

5.1.3. Data

The data is a sequence of records. The serialized format of each record R depends on whether R is a single-value record or an array record.

Single-value records: A single-value record is specified in FPP in the form product record name : type. The record has name name and represents one item of data of type type. The type may be any FPP type, including a struct or array type. Single-value records with type = T have the following format:

Field NameData TypeSerialized SizeDescription
IdFwDpIdTypesizeof(FwDpIdType)The record ID
DataTSize of the serialized dataThe serialized data

Array records: An array record is specified in FPP in the form product record name : type array. The record has name name and represents an array of items of type type. The type may be any FPP type, including a struct or array type. Array records with type = T have the following format:

Field NameData TypeSerialized SizeDescription
IdFwDpIdTypesizeof(FwDpIdType)The record ID
SizeFwSizeTypesizeof(FwSizeStoreType)The number n of elements in the record
DataArray of n TSum of the serialized sizes of the elements in the arrayn elements, each of type T

5.1.4. Data Hash

The data hash has the following format.

Field NameSerialized SizeDescription
Data HashHASH_DIGEST_LENGTHThe hash value guarding the data.

5.2. Further Information

For more information on the DpContainer class, see the file DpContainer.hpp in the parent directory.