Back to Fprime

Svc::Ccsds::SpacePacketDeframer

Svc/Ccsds/SpacePacketDeframer/docs/sdd.md

4.3.04.2 KB
Original Source

Svc::Ccsds::SpacePacketDeframer

The Svc::Ccsds::SpacePacketDeframer is an implementation of the DeframerInterface for the CCSDS Space Packet Protocol.

It receives data containing a Space Packet on its input port and extracts the Space Packet. Please refer to the CCSDS Space Packet Protocol specification (CCSDS 133.0-B-2) for details on the packet format.

The Svc::Ccsds::SpacePacketDeframer is typically used downstream of a component that removes transfer frame headers, such as the Svc::Ccsds::TcDeframer. It validates the Space Packet header and extracts the payload.

CCSDS Header Field Extraction

The Svc::Ccsds::SpacePacketDeframer extracts the following fields from the CCSDS Space Packet Primary Header and populates them in the output FrameContext:

FieldContext FieldDescription
Application Process Identifier (APID)apidExtracted from bits [10:0] of the Packet Identification field. Invalid APID values (per ComCfg::Apid::isValid()) are mapped to INVALID_UNINITIALIZED.
Secondary Header FlaghasSecHdrExtracted from bit [11] of the Packet Identification field
Sequence FlagssequenceFlagsExtracted from bits [15:14] of the Packet Sequence Control field (0b00=Continuation, 0b01=First, 0b10=Last, 0b11=Unsegmented)
Packet Sequence CountsequenceCountExtracted from bits [13:0] of the Packet Sequence Control field

Port Descriptions

KindNamePort TypeDescription
Input (guarded)dataInSvc.ComDataWithContextPort to receive data containing a Space Packet
OutputdataOutSvc.ComDataWithContextPort to output the extracted Space Packet payload
OutputdataReturnOutSvc.ComDataWithContextPort for returning ownership of received buffers
Input (sync)dataReturnInSvc.ComDataWithContextPort receiving back ownership of sent buffers
OutputvalidateApidSeqCountCcsds.ApidSequenceCountPort to request validation of a sequence count for a given APID
OutputerrorNotifyCcsds.ErrorNotifyPort to send notification of deframing errors

Events

NameSeverityDescription
InvalidLengthwarning highDeframing received an invalid packet length
InvalidPacketwarning highDeframing received a malformed packet

Requirements

NameDescriptionValidation
SVC-CCSDS-SPD-001The SpacePacketDeframer shall deframe CCSDS Space Packets according to the CCSDS 133.0-B-2 standard.Unit Test, Inspection
SVC-CCSDS-SPD-002The SpacePacketDeframer shall extract the user data field from valid Space Packets.Unit Test
SVC-CCSDS-SPD-003The SpacePacketDeframer shall validate the packet length of a Space Packet Primary Header.Unit Test
SVC-CCSDS-SPD-010The SpacePacketDeframer shall validate the Packet Version Number field and reject packets whose Packet Version Number does not match the CCSDS Space Packet Protocol, emitting InvalidPacket and returning the buffer.Unit Test
SVC-CCSDS-SPD-009The SpacePacketDeframer shall emit an InvalidLength event if the packet length token in the header is cannot fit in the received data, and drop the received packet.Unit Test
SVC-CCSDS-SPD-004The SpacePacketDeframer shall receive incoming data containing Space Packets via the dataIn port.Unit Test
SVC-CCSDS-SPD-005The SpacePacketDeframer shall output the extracted Space Packet user data via the dataOut port.Unit Test
SVC-CCSDS-SPD-006The SpacePacketDeframer shall manage buffer ownership using the dataReturnIn and dataReturnOut ports.Unit Test, Inspection
SVC-CCSDS-SPD-007The SpacePacketDeframer shall delegate sequence count validation to another component through the validateApidSeqCount port.Unit Test
SVC-CCSDS-SPD-008The SpacePacketDeframer shall perform sequence count validation for APIDs registered via validateApidSeqCount.Unit Test
SVC-CCSDS-SPD-009The SpacePacketDeframer shall emit notifications on its errorNotify port when deframing errors occur.Unit Test