F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
|
FileDownlink
is an active ISF component. It manages downlink of files from the spacecraft.
Requirement | Description | Rationale | Verification Method |
---|---|---|---|
FD-001 | Upon command, 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 |
The design of FileDownlink
assumes the following:
Fw::FilePacket
.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 |
---|---|---|---|
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:
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.The initial value is IDLE.
FileDownlink
recognizes the commands described in the following sections.
SendFile is an asynchronous command. It has two arguments:
When File Downlink
receives this command, it carries out the following steps:
If mode = CANCEL, then
a. Issue a DownlinkCanceled event.
b. set mode = IDLE and return.
While r > 0 and mode = DOWNLINK do:
a. Let n be the smaller of downlinkPacketSize and r.
b. Invoke bufferGetCaller to request a buffer B whose size is the size of a DATA packet with a data payload of n bytes.
c. Read the next *n* bytes out of the file with descriptor *d*.
If there is any problem reading the file, then issue a FileReadError warning, close the file, and abort the command execution.
d. Fill *B* with (i) the data read the previous step and (ii) the appropriate
metadata. Send B out on bufferSendOut.
e. Reduce *r* by *n*.
If mode = CANCEL, then
a. Invoke bufferGetCaller to request a buffer whose size is the size of a CANCEL packet. Fill the packet and send it out on bufferSendOut.
b. Issue a *DownlinkCanceled* event.
Cancel is a synchronous command. If mode = DOWNLINK, it sets mode to CANCEL. Otherwise it does nothing.
Dictionaries: HTML MD
Document | Link |
---|---|
Design | Link |
Code | Link |
Unit Test | Link |
TODO