Back to Fprime

Svc::FprimeFramer

Svc/FprimeFramer/docs/sdd.md

4.2.23.9 KB
Original Source

Svc::FprimeFramer

The Svc::FprimeFramer is an implementation of the FramerInterface for the F Prime protocol.

It receives data (an F´ packet) on input and produces an F´ frame on its output port as a result. Please refer to the F Prime frame specification for details on the frame format.

It is designed to receive packets from a Svc::ComQueue and passes frames to a Communications Adapter, such as a Radio manager component or Svc::ComStub, for transmission on the wire.

Usage Examples

The Svc::FprimeFramer component is used in the uplink stack of many reference F´ application such as the tutorials source code.

Internals

The Svc::FprimeFramer receives data packets of type Svc.ComDataWithContext. This type contains both a Fw::Buffer containing the packet data, and a context: FrameContext that contains contextual information about the data packet (such as an APID). In the default configuration (using Svc::ComQueue), the context is used to determine whether a packet is coming from the ComQueue's Fw::Buffer queue (as opposed to ComPacket queue). If it is, the original data packet Fw::Buffer is returned back to its original sender.

On receiving a data packet, the Svc::FprimeFramer performs the following actions:

  1. Allocates a new outBuffer (of type Fw::Buffer) to hold the F´ frame, of size size(dataPacket) + size(FprimeHeader) + size(FprimeTrailer)
  2. Serializes the F´ start word (0xDEADBEEF) and length token (size(dataPacket)) into outBuffer
  3. Serializes the F´ packet data into outBuffer
  4. Computes and serializes a CRC32 checksum into outBuffer
  5. Emits the outBuffer on the dataOut output port. Ownership of outBuffer is handed to the receiver
  6. Transfer ownership of input dataPacket to the dataReturnOut port. This usually should be connected to the same component that sent the original packet to dataIn.

Port Descriptions

KindNamePort TypeUsage
guarded inputdataInSvc.ComDataWithContextPort to receive data to frame, in a Fw::Buffer with optional context
outputdataOutSvc.ComDataWithContextPort to output framed data, with optional context, for follow-up framing
sync inputdataReturnInSvc.ComDataWithContextPort to receive back ownership of buffer sent out of dataOut
outputdataReturnOutSvc.ComDataWithContextPort to return ownership of buffer received on dataIn
sync inputcomStatusInFw.SuccessConditionPort receiving the general status from the downstream component
outputcomStatusOutFw.SuccessConditionPort receiving indicating the status of framer for receiving more data

Requirements

NameDescriptionValidation
SVC-FPRIME_FRAMER-001Svc::FprimeFramer shall accept data buffers (packets) stored in Fw::Buffer through its dataIn input portUnit Test
SVC-FPRIME_FRAMER-002Svc::FprimeFramer shall emit one F Prime frame on its framedOut output port for each packet received on dataIn input portUnit Test
SVC-FPRIME_FRAMER-003Svc::FprimeFramer shall emit F Prime frames that conforms to the F´ frame specificationUnit Test
SVC-FPRIME_FRAMER-004Svc::FprimeFramer shall pass through all Fw.SuccessCondition received on comStatusIn to comStatusOutUnit Test