F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
|
FileDownlink
is an active F´ component that manages spacecraft file downlink. Both operators and components on the spacecraft can add files to the file queue, which FileDownlink
will downlink from. Operators can enqueue files using the SendFile
and SendPartial
commands, and components can enqueue files using the SendFile
port. The FileComplete
port broadcasts when a file downlink initiated by a port completes, allowing components to detect when a previous enqueued file downlink has completed. To prevent a continuous stream of file downlink traffic from saturating the communication link, a cooldown can be configured to add a delay between the completion of a file downlink and starting on the next file in the queue.
Note: file downlink is limited to processing files with a maximum file size of 4GiB. Larger files will result in a bad size error.
Requirement | Description | Rationale | Verification Method |
---|---|---|---|
FD-001 | FileDownlink shall queue up a list of files to downlink | The requirement provides the ability to simultaneously queue up multiple files for downlink from different sources | Test |
FD-002 | FileDownlink shall read a file from non-volatile storage, partition the file into packets, and send out the packets. | This requirement provides the capability to downlink files from the spacecraft. | Test |
FD-003 | FileDownlink shall wait for a cooldown after completing a file downlink before starting another file downlink | Allows a saturated link to process a backlog that may have built up during a file downlink | Test |
The design of FileDownlink
assumes the following:
SendFile
command and port.Name | Type | Role |
---|---|---|
timeCaller | Fw::Time | TimeGet |
cmdIn | `Fw::Cmd` | Cmd |
cmdRegOut | `Fw::CmdReg` | CmdReg |
cmdResponseOut | `Fw::CmdResponse` | CmdResponse |
tlmOut | `Fw::Tlm` | Telemetry |
eventOut | `Fw::LogEvent` | LogEvent |
Name | Type | Kind | Purpose |
---|---|---|---|
sendFile | Svc::SendFileRequest | guarded_input | Enqueues file for downlink |
fileComplete | Svc::SendFileComplete | output | Emits notifications when a file downlink initiated by a port completes |
Run | Svc::Sched | async_input | Periodic clock input used to trigger internal state machine |
bufferGet | `Fw::BufferGet` | output (caller) | Requests buffers for sending file packets. |
bufferSendOut | `Fw::BufferSend` | output | Sends buffers containing file packets. |
FileDownlink
has the following constants, initialized at component instantiation time:
Run
port, used for timing timeouts and cooldown.FileDownlink
maintains a mode equal to one of the following values:
FileDownlink
is idle.FileDownlink
is performing a file downlink.FileDownlink
is canceling a file downlink.FileDownlink
is waiting for a buffer to be returned before sending another packet.FileDownlink
is waiting in a cooldown period before downlinking the next file.The initial value is IDLE.
FileDownlink
recognizes the commands described in the following sections.
SendFile is an asynchronous command that adds a file to the file downlink queue. It has two arguments:
SendPartial also includes the following fields:
When the downlink completes or fails, a CmdResponse packet will be sent indicating success or failure.
Cancel is a synchronous command. If mode = DOWNLINK, it sets mode to CANCEL. Otherwise it does nothing.
Document | Link |
---|---|
Design | Link |
Code | Link |
Unit Test | Link |
TODO