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:
- Allocates a new
outBuffer(of typeFw::Buffer) to hold the F´ frame, of sizesize(dataPacket) + size(FprimeHeader) + size(FprimeTrailer) - Serializes the F´ start word (
0xDEADBEEF) and length token (size(dataPacket)) intooutBuffer - Serializes the F´ packet data into
outBuffer - Computes and serializes a CRC32 checksum into
outBuffer - Emits the
outBufferon thedataOutoutput port. Ownership ofoutBufferis handed to the receiver - Transfer ownership of input
dataPacketto thedataReturnOutport. This usually should be connected to the same component that sent the original packet todataIn.
Port Descriptions
| Kind | Name | Port Type | Usage |
|---|---|---|---|
guarded input |
dataIn |
Svc.ComDataWithContext |
Port to receive data to frame, in a Fw::Buffer with optional context |
output |
dataOut |
Svc.ComDataWithContext |
Port to output framed data, with optional context, for follow-up framing |
sync input |
dataReturnIn |
Svc.ComDataWithContext |
Port to receive back ownership of buffer sent out of dataOut |
output |
dataReturnOut |
Svc.ComDataWithContext |
Port to return ownership of buffer received on dataIn |
sync input |
comStatusIn |
Fw.SuccessCondition |
Port receiving the general status from the downstream component |
output |
comStatusOut |
Fw.SuccessCondition |
Port receiving indicating the status of framer for receiving more data |
Requirements
| Name | Description | Validation |
|---|---|---|
| SVC-FPRIME_FRAMER-001 | Svc::FprimeFramer shall accept data buffers (packets) stored in Fw::Buffer through its dataIn input port |
Unit Test |
| SVC-FPRIME_FRAMER-002 | Svc::FprimeFramer shall emit one F Prime frame on its framedOut output port for each packet received on dataIn input port |
Unit Test |
| SVC-FPRIME_FRAMER-003 | Svc::FprimeFramer shall emit F Prime frames that conforms to the F´ frame specification |
Unit Test |
| SVC-FPRIME_FRAMER-004 | Svc::FprimeFramer shall pass through all Fw.SuccessCondition received on comStatusIn to comStatusOut |
Unit Test |