F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
|
Go to the documentation of this file.
25 const char *
const name,
26 const U16 downlinkPacketSize
29 downlinkPacketSize(downlinkPacketSize),
58 FileDownlink_SendFile_cmdHandler(
68 if (this->
mode.get() == Mode::CANCEL) {
75 this->
mode.set(Mode::IDLE);
80 this->
mode.set(Mode::DOWNLINK);
82 status = this->
file.open(
100 this->
file.osFile.close();
102 if (this->
mode.get() == Mode::CANCEL) {
105 this->
file.sourceName,
112 this->
file.sourceName,
118 this->
mode.set(Mode::IDLE);
130 if (this->
mode.get() == Mode::DOWNLINK)
131 this->
mode.set(Mode::CANCEL);
140 sendDataPacket(
const U32 byteOffset)
143 const U32 fileSize = this->
file.size;
144 FW_ASSERT(byteOffset < fileSize, byteOffset);
145 const U16 maxDataSize =
static_cast<U16
>(this->downlinkPacketSize);
146 const U16 dataSize =
static_cast<U16
>((byteOffset + maxDataSize > fileSize) ?
147 fileSize - byteOffset : maxDataSize);
151 this->
file.read(buffer, byteOffset, dataSize);
178 byteOffset < this->
file.size;
179 byteOffset += this->downlinkPacketSize
181 if (this->
mode.get() == Mode::CANCEL)
184 this->sendDataPacket(byteOffset);
211 endPacket.
header = header;
214 this->
file.getChecksum(checksum);
229 this->file.sourceName.toChar(),
230 this->file.destName.toChar()
240 const U32 bufferSize = filePacket.
bufferSize();
241 Fw::Buffer buffer = this->bufferGetCaller_out(0, bufferSize);
PacketsSent packetsSent
Packets sent.
U32 getsize(void)
get member size
PRIVATE const U32 const Fw::CmdStringArg const Fw::CmdStringArg & destFileName
< The name of the destination file on the ground
SerializeStatus
forward declaration for string
void log_ACTIVITY_HI_FileDownlink_FileSent(Fw::LogStringArg &sourceFileName, Fw::LogStringArg &destFileName)
Os::File::Status sendDataPackets(void)
const char * toChar(void) const
SerializeStatus toBuffer(Buffer &buffer) const
The type of a cancel packet.
uint8_t U8
8-bit unsigned integer
The type of a start packet.
U32 sequenceIndex
The current sequence index.
The type of a data packet.
void fromDataPacket(const DataPacket &dataPacket)
The type of an end packet.
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
void sendCancelPacket(void)
Header header
The packet header.
U64 getdata(void)
get member data
void init(void)
Object initializer.
U32 bufferSize(void) const
@ COMMAND_EXECUTION_ERROR
PRIVATE const U32 cmdSeq
The command sequence number.
#define FwOpcodeType
Type representation for a command opcode.
void fromStartPacket(const StartPacket &startPacket)
void setChecksum(const CFDP::Checksum &checksum)
Set the checksum.
PRIVATE NATIVE_INT_TYPE FwOpcodeType opCode
void bufferSendOut_out(NATIVE_INT_TYPE portNum, Fw::Buffer &fwBuffer)
void pingIn_handler(const NATIVE_INT_TYPE portNum, U32 key)
void FileDownlink_Cancel_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq)
Warnings warnings
Warnings.
Class representing a CFDP checksum.
void log_ACTIVITY_HI_FileDownlink_DownlinkCanceled(Fw::LogStringArg &sourceFileName, Fw::LogStringArg &destFileName)
void pingOut_out(NATIVE_INT_TYPE portNum, U32 key)
void fromEndPacket(const EndPacket &endPacket)
FilesSent filesSent
Files sent.
Declares ISF basic types.
@ OP_OK
Operation was successful.
FileDownlink(const char *const compName, const U16 downlinkPacketSize)
void sendFilePacket(const Fw::FilePacket &filePacket)
void sendStartPacket(void)
int NATIVE_INT_TYPE
native integer type declaration
void initialize(const U32 fileSize, const char *const sourcePath, const char *const destinationPath)
Initialize a StartPacket with sequence number 0.
Auto-generated base for FileDownlink component.
PRIVATE const U32 const Fw::CmdStringArg & sourceFileName
The name of the on-board file to send.
void fromCancelPacket(const CancelPacket &cancelPacket)