F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileDownlink.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileDownlink.hpp
3 // \author bocchino, mstarch
4 // \brief hpp file for FileDownlink component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 // ======================================================================
11 
12 #include <Fw/Com/ComPacket.hpp>
13 #include <Fw/FPrimeBasicTypes.hpp>
14 #include <Fw/Types/Assert.hpp>
15 #include <Fw/Types/StringUtils.hpp>
16 #include <Os/QueueString.hpp>
18 #include <limits>
19 
20 namespace Svc {
21 
22 // ----------------------------------------------------------------------
23 // Construction, initialization, and destruction
24 // ----------------------------------------------------------------------
25 
26 FileDownlink ::FileDownlink(const char* const name)
28  m_configured(false),
29  m_filesSent(this),
30  m_packetsSent(this),
31  m_warnings(this),
32  m_sequenceIndex(0),
33  m_curTimer(0),
34  m_bufferSize(0),
35  m_byteOffset(0),
36  m_endOffset(0),
37  m_lastCompletedType(Fw::FilePacket::T_NONE),
38  m_lastBufferId(0),
39  m_curEntry(),
40  m_cntxId(0) {}
41 
42 void FileDownlink ::configure(U32 cooldown, U32 cycleTime, U32 fileQueueDepth) {
43  this->m_cooldown = cooldown;
44  this->m_cycleTime = cycleTime;
45  this->m_configured = true;
46 
47  Os::Queue::Status stat =
48  m_fileQueue.create(this->getInstance(), Os::QueueString("fileDownlinkQueue"),
49  static_cast<FwSizeType>(fileQueueDepth), static_cast<FwSizeType>(sizeof(struct FileEntry)));
50  FW_ASSERT(stat == Os::Queue::OP_OK, static_cast<FwAssertArgType>(stat));
51 }
52 
53 void FileDownlink ::configure(const char* directory) {
54  this->m_file.configureSandbox(directory);
55 }
56 
58  this->m_fileQueue.teardown();
60 }
61 
63  FW_ASSERT(this->m_configured == true);
64 }
65 
67 
68 // ----------------------------------------------------------------------
69 // Handler implementations for user-defined typed input ports
70 // ----------------------------------------------------------------------
71 
72 void FileDownlink ::Run_handler(const FwIndexType portNum, U32 context) {
73  switch (this->m_mode.get()) {
74  case Mode::IDLE: {
75  FwSizeType real_size = 0;
76  FwQueuePriorityType prio = 0;
77  Os::Queue::Status stat = m_fileQueue.receive(reinterpret_cast<U8*>(&this->m_curEntry),
78  static_cast<FwSizeType>(sizeof(this->m_curEntry)),
79  Os::Queue::BlockingType::NONBLOCKING, real_size, prio);
80 
81  if (stat != Os::Queue::Status::OP_OK || sizeof(this->m_curEntry) != real_size) {
82  return;
83  }
84 
85  sendFile(this->m_curEntry.srcFilename, this->m_curEntry.destFilename, this->m_curEntry.offset,
86  this->m_curEntry.length);
87  break;
88  }
89  case Mode::COOLDOWN: {
90  if (this->m_curTimer >= this->m_cooldown) {
91  this->m_curTimer = 0;
92  this->m_mode.set(Mode::IDLE);
93  } else {
94  this->m_curTimer += m_cycleTime;
95  }
96  break;
97  }
98  case Mode::WAIT: {
99  this->m_curTimer += m_cycleTime;
100  break;
101  }
102  default:
103  break;
104  }
105 }
106 
107 Svc::SendFileResponse FileDownlink ::SendFile_handler(
108  const FwIndexType portNum,
109  const Fw::StringBase& sourceFilename, // lgtm[cpp/large-parameter] dictated by command architecture
110  const Fw::StringBase& destFilename, // lgtm[cpp/large-parameter] dictated by command architecture
111  U32 offset,
112  U32 length) {
113  struct FileEntry entry;
114  entry.offset = offset;
115  entry.length = length;
116  entry.source = FileDownlink::PORT;
117  entry.opCode = 0;
118  entry.cmdSeq = 0;
119  entry.context = m_cntxId++;
120 
121  // Guard against filename overflow
122  if (sourceFilename.length() >= entry.srcFilename.getCapacity()) {
124  return SendFileResponse(SendFileStatus::STATUS_ERROR, std::numeric_limits<U32>::max());
125  } else if (destFilename.length() >= entry.destFilename.getCapacity()) {
127  return SendFileResponse(SendFileStatus::STATUS_ERROR, std::numeric_limits<U32>::max());
128  } else {
129  entry.srcFilename = sourceFilename;
130  entry.destFilename = destFilename;
131 
132  Os::Queue::Status status =
133  m_fileQueue.send(reinterpret_cast<U8*>(&entry), static_cast<FwSizeType>(sizeof(entry)), 0,
134  Os::Queue::BlockingType::NONBLOCKING);
135 
136  if (status != Os::Queue::Status::OP_OK) {
137  return SendFileResponse(SendFileStatus::STATUS_ERROR, std::numeric_limits<U32>::max());
138  }
139  return SendFileResponse(SendFileStatus::STATUS_OK, entry.context);
140  }
141 }
142 
143 void FileDownlink ::pingIn_handler(const FwIndexType portNum, U32 key) {
144  this->pingOut_out(0, key);
145 }
146 
147 void FileDownlink ::bufferReturn_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) {
148  // If this is a stale buffer (old, timed-out, or both), then ignore its return.
149  // File downlink actions only respond to the return of the most-recently-sent buffer.
150  if (this->m_lastBufferId != fwBuffer.getContext() + 1 || this->m_mode.get() == Mode::IDLE) {
151  return;
152  }
153  // Non-ignored buffers cannot be returned in "DOWNLINK" and "IDLE" state. Only in "WAIT", "CANCEL" state.
154  FW_ASSERT(this->m_mode.get() == Mode::WAIT || this->m_mode.get() == Mode::CANCEL,
155  static_cast<FwAssertArgType>(this->m_mode.get()));
156  // If the last packet has been sent (and is returning now) then finish the file
157  if (this->m_lastCompletedType == Fw::FilePacket::T_END || this->m_lastCompletedType == Fw::FilePacket::T_CANCEL) {
158  finishHelper(this->m_lastCompletedType == Fw::FilePacket::T_CANCEL);
159  return;
160  }
161  // If waiting and a buffer is in-bound, then switch to downlink mode
162  else if (this->m_mode.get() == Mode::WAIT) {
163  this->m_mode.set(Mode::DOWNLINK);
164  }
165 
166  this->downlinkPacket();
167 }
168 
169 // ----------------------------------------------------------------------
170 // Command handler implementations
171 // ----------------------------------------------------------------------
172 
173 void FileDownlink ::SendFile_cmdHandler(const FwOpcodeType opCode,
174  const U32 cmdSeq,
175  const Fw::CmdStringArg& sourceFilename,
176  const Fw::CmdStringArg& destFilename) {
177  struct FileEntry entry;
178  entry.offset = 0;
179  entry.length = 0;
180  entry.source = FileDownlink::COMMAND;
181  entry.opCode = opCode;
182  entry.cmdSeq = cmdSeq;
183  entry.context = std::numeric_limits<U32>::max();
184 
185  // Guard against filename overflow
186  if (sourceFilename.length() >= entry.srcFilename.getCapacity()) {
188  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
189  } else if (destFilename.length() >= entry.destFilename.getCapacity()) {
191  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
192  } else {
193  entry.srcFilename = sourceFilename;
194  entry.destFilename = destFilename;
195 
196  Os::Queue::Status status =
197  m_fileQueue.send(reinterpret_cast<U8*>(&entry), static_cast<FwSizeType>(sizeof(entry)), 0,
198  Os::Queue::BlockingType::NONBLOCKING);
199 
200  if (status != Os::Queue::Status::OP_OK) {
201  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR);
202  }
203  }
204 }
205 
206 void FileDownlink ::SendPartial_cmdHandler(FwOpcodeType opCode,
207  U32 cmdSeq,
208  const Fw::CmdStringArg& sourceFilename,
209  const Fw::CmdStringArg& destFilename,
210  U32 startOffset,
211  U32 length) {
212  struct FileEntry entry;
213  entry.offset = startOffset;
214  entry.length = length;
215  entry.source = FileDownlink::COMMAND;
216  entry.opCode = opCode;
217  entry.cmdSeq = cmdSeq;
218  entry.context = std::numeric_limits<U32>::max();
219 
220  // Guard against filename overflow
221  if (sourceFilename.length() >= entry.srcFilename.getCapacity()) {
223  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
224  } else if (destFilename.length() >= entry.destFilename.getCapacity()) {
226  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::VALIDATION_ERROR);
227  } else {
228  entry.srcFilename = sourceFilename;
229  entry.destFilename = destFilename;
230 
231  Os::Queue::Status status =
232  m_fileQueue.send(reinterpret_cast<U8*>(&entry), static_cast<FwSizeType>(sizeof(entry)), 0,
233  Os::Queue::BlockingType::NONBLOCKING);
234 
235  if (status != Os::Queue::Status::OP_OK) {
236  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR);
237  }
238  }
239 }
240 
241 void FileDownlink ::Cancel_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq) {
242  // Must be able to cancel in both downlink and waiting states
243  if (this->m_mode.get() == Mode::DOWNLINK || this->m_mode.get() == Mode::WAIT) {
244  this->m_mode.set(Mode::CANCEL);
245  }
246  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
247 }
248 
249 // ----------------------------------------------------------------------
250 // Private helper methods
251 // ----------------------------------------------------------------------
252 
253 Fw::CmdResponse FileDownlink ::statusToCmdResp(SendFileStatus status) {
254  switch (status.e) {
256  return Fw::CmdResponse::OK;
262  return Fw::CmdResponse::BUSY;
263  default:
264  // Trigger assertion if given unknown status
265  FW_ASSERT(false);
266  }
267 
268  // It's impossible to reach this, but added to suppress gcc missing return warning
270 }
271 
272 void FileDownlink ::sendResponse(SendFileStatus resp) {
273  FW_ASSERT(this->m_curEntry.source == FileDownlink::COMMAND || this->m_curEntry.source == FileDownlink::PORT,
274  static_cast<FwAssertArgType>(this->m_curEntry.source));
275  if (this->m_curEntry.source == FileDownlink::COMMAND) {
276  this->cmdResponse_out(this->m_curEntry.opCode, this->m_curEntry.cmdSeq, statusToCmdResp(resp));
277  } else {
278  for (FwIndexType i = 0; i < this->getNum_FileComplete_OutputPorts(); i++) {
280  this->FileComplete_out(i, Svc::SendFileResponse(resp, this->m_curEntry.context));
281  }
282  }
283  }
284 }
285 
286 void FileDownlink ::sendFile(const Fw::FileNameString& sourceFilename,
287  const Fw::FileNameString& destFilename,
288  U32 startOffset,
289  U32 length) {
290  // Open file for downlink
291  Os::File::Status status = this->m_file.open(sourceFilename, destFilename);
292 
293  // Reject command if error when opening file
294  if (status != Os::File::OP_OK) {
295  this->m_mode.set(Mode::IDLE);
296  if (status == Os::File::OUTSIDE_SANDBOX) {
297  this->m_warnings.sourceOutOfSandbox();
298  } else {
299  this->m_warnings.fileOpenError();
300  }
302  return;
303  }
304  const U32 fileSize = this->m_file.getSize();
305 
306  if (fileSize == 0) {
307  this->m_mode.set(Mode::IDLE);
308  this->m_warnings.zeroSize();
311  return;
312 
313  } else if (startOffset >= fileSize) {
314  this->enterCooldown();
315  this->log_WARNING_HI_DownlinkPartialFail(this->m_file.getSourceName(), this->m_file.getDestName(), startOffset,
316  fileSize);
319  return;
320  } else if (startOffset + length > fileSize) {
321  // If the amount to downlink is greater than the file size, emit a Warning and then allow
322  // the file to be downlinked anyway
323  this->log_WARNING_LO_DownlinkPartialWarning(startOffset, length, fileSize, this->m_file.getSourceName(),
324  this->m_file.getDestName());
325  length = fileSize - startOffset;
326  }
327 
328  // Send file and switch to WAIT mode
329  this->getBuffer(this->m_buffer, FILE_PACKET);
330  this->sendStartPacket();
331  this->m_mode.set(Mode::WAIT);
332  this->m_sequenceIndex = 1;
333  this->m_curTimer = 0;
334  this->m_byteOffset = startOffset;
335  this->m_lastCompletedType = Fw::FilePacket::T_START;
336 
337  // zero length means read until end of file
338  if (length > 0) {
339  this->log_ACTIVITY_HI_SendStarted(length, this->m_file.getSourceName(), this->m_file.getDestName());
340  this->m_endOffset = startOffset + length;
341  } else {
342  this->log_ACTIVITY_HI_SendStarted(fileSize - startOffset, this->m_file.getSourceName(),
343  this->m_file.getDestName());
344  this->m_endOffset = fileSize;
345  }
346 }
347 
348 Os::File::Status FileDownlink ::sendDataPacket(U32& byteOffset) {
349  FW_ASSERT(byteOffset < this->m_endOffset);
350  const U32 maxDataSize =
352  const U32 dataSize =
353  (byteOffset + maxDataSize > this->m_endOffset) ? (this->m_endOffset - byteOffset) : maxDataSize;
354  U8 buffer[maxDataSize];
355  // This will be last data packet sent
356  if (dataSize + byteOffset == this->m_endOffset) {
357  this->m_lastCompletedType = Fw::FilePacket::T_DATA;
358  }
359 
360  const Os::File::Status status = this->m_file.read(buffer, byteOffset, dataSize);
361  if (status != Os::File::OP_OK) {
362  this->m_warnings.fileRead(status);
363  return status;
364  }
365 
366  Fw::FilePacket::DataPacket dataPacket;
367  dataPacket.initialize(this->m_sequenceIndex, byteOffset, static_cast<U16>(dataSize), buffer);
368  ++this->m_sequenceIndex;
369  Fw::FilePacket filePacket;
370  filePacket.fromDataPacket(dataPacket);
371  this->sendFilePacket(filePacket);
372 
373  byteOffset += dataSize;
374 
375  return Os::File::OP_OK;
376 }
377 
378 void FileDownlink ::sendCancelPacket() {
379  Fw::Buffer buffer;
380  Fw::FilePacket::CancelPacket cancelPacket;
381  cancelPacket.initialize(this->m_sequenceIndex);
382 
383  Fw::FilePacket filePacket;
384  filePacket.fromCancelPacket(cancelPacket);
385  this->getBuffer(buffer, CANCEL_PACKET);
386  FW_ASSERT(buffer.getSize() >= filePacket.bufferSize() + sizeof(FwPacketDescriptorType),
387  static_cast<FwAssertArgType>(buffer.getSize()),
388  static_cast<FwAssertArgType>(filePacket.bufferSize() + sizeof(FwPacketDescriptorType)));
389 
390  // Serialize the packet descriptor FW_PACKET_FILE to the buffer
391  Fw::SerializeStatus status =
392  buffer.getSerializer().serializeFrom(static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_FILE));
393  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
394  Fw::Buffer offsetBuffer(buffer.getData() + sizeof(FwPacketDescriptorType),
395  buffer.getSize() - static_cast<Fw::Buffer::SizeType>(sizeof(FwPacketDescriptorType)));
396  // Serialize the filePacket content into the buffer
397  status = filePacket.toBuffer(offsetBuffer);
398  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
399  this->bufferSendOut_out(0, buffer);
400  this->m_packetsSent.packetSent();
401 }
402 
403 void FileDownlink ::sendEndPacket() {
404  CFDP::Checksum checksum;
405  this->m_file.getChecksum(checksum);
406 
407  Fw::FilePacket::EndPacket endPacket;
408  endPacket.initialize(this->m_sequenceIndex, checksum);
409 
410  Fw::FilePacket filePacket;
411  filePacket.fromEndPacket(endPacket);
412  this->sendFilePacket(filePacket);
413 }
414 
415 void FileDownlink ::sendStartPacket() {
416  Fw::FilePacket::StartPacket startPacket;
417  startPacket.initialize(this->m_file.getSize(), this->m_file.getSourceName().toChar(),
418  this->m_file.getDestName().toChar());
419  Fw::FilePacket filePacket;
420  filePacket.fromStartPacket(startPacket);
421  this->sendFilePacket(filePacket);
422 }
423 
424 void FileDownlink ::sendFilePacket(const Fw::FilePacket& filePacket) {
425  const U32 bufferSize = filePacket.bufferSize() + static_cast<U32>(sizeof(FwPacketDescriptorType));
426  FW_ASSERT(this->m_buffer.getData() != nullptr);
427  FW_ASSERT(this->m_buffer.getSize() >= bufferSize, static_cast<FwAssertArgType>(bufferSize),
428  static_cast<FwAssertArgType>(this->m_buffer.getSize()));
429  // Serialize packet descriptor FW_PACKET_FILE to the buffer
430  Fw::SerializeStatus status = this->m_buffer.getSerializer().serializeFrom(
431  static_cast<FwPacketDescriptorType>(Fw::ComPacketType::FW_PACKET_FILE));
432  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
433  // Serialize the filePacket content into the buffer, offset by the size of the packet descriptor
434  Fw::Buffer offsetBuffer(
435  this->m_buffer.getData() + sizeof(FwPacketDescriptorType),
436  this->m_buffer.getSize() - static_cast<Fw::Buffer::SizeType>(sizeof(FwPacketDescriptorType)));
437  status = filePacket.toBuffer(offsetBuffer);
438  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
439  // set the buffer size to the packet size
440  this->m_buffer.setSize(bufferSize);
441  this->bufferSendOut_out(0, this->m_buffer);
442  // restore buffer size to max
444  this->m_packetsSent.packetSent();
445 }
446 
447 void FileDownlink ::enterCooldown() {
448  this->m_file.getOsFile().close();
449  this->m_mode.set(Mode::COOLDOWN);
450  this->m_lastCompletedType = Fw::FilePacket::T_NONE;
451  this->m_curTimer = 0;
452 }
453 
454 void FileDownlink ::downlinkPacket() {
455  FW_ASSERT(this->m_lastCompletedType != Fw::FilePacket::T_NONE,
456  static_cast<FwAssertArgType>(this->m_lastCompletedType));
457  FW_ASSERT(this->m_mode.get() == Mode::CANCEL || this->m_mode.get() == Mode::DOWNLINK,
458  static_cast<FwAssertArgType>(this->m_mode.get()));
459  // If canceled mode and currently downlinking data then send a cancel packet
460  if (this->m_mode.get() == Mode::CANCEL && this->m_lastCompletedType == Fw::FilePacket::T_START) {
461  this->sendCancelPacket();
462  this->m_lastCompletedType = Fw::FilePacket::T_CANCEL;
463  }
464  // If in downlink mode and currently downlinking data then continue with the next packer
465  else if (this->m_mode.get() == Mode::DOWNLINK && this->m_lastCompletedType == Fw::FilePacket::T_START) {
466  // Send the next packet, or fail doing so
467  const Os::File::Status status = this->sendDataPacket(this->m_byteOffset);
468  if (status != Os::File::OP_OK) {
469  this->log_WARNING_HI_SendDataFail(this->m_file.getSourceName(), this->m_byteOffset);
470  this->enterCooldown();
473  // Don't go to wait state
474  return;
475  }
476  }
477  // If in downlink mode or cancel and finished downlinking data then send the last packet
478  else if (this->m_lastCompletedType == Fw::FilePacket::T_DATA) {
479  this->sendEndPacket();
480  this->m_lastCompletedType = Fw::FilePacket::T_END;
481  }
482  this->m_mode.set(Mode::WAIT);
483  this->m_curTimer = 0;
484 }
485 
486 void FileDownlink ::finishHelper(bool cancel) {
487  // Complete command and switch to IDLE
488  if (not cancel) {
489  this->m_filesSent.fileSent();
490  this->log_ACTIVITY_HI_FileSent(this->m_file.getSourceName(), this->m_file.getDestName());
491  } else {
492  this->log_ACTIVITY_HI_DownlinkCanceled(this->m_file.getSourceName(), this->m_file.getDestName());
493  }
494  this->enterCooldown();
495  sendResponse(SendFileStatus::STATUS_OK);
496 }
497 
498 void FileDownlink ::getBuffer(Fw::Buffer& buffer, PacketType type) {
499  // Check type is correct
500  FW_ASSERT(type < COUNT_PACKET_TYPE && type >= 0, static_cast<FwAssertArgType>(type));
501  // Wrap the buffer around our indexed memory.
502  buffer.setData(this->m_memoryStore[type]);
504  // Set a known ID to look for later
505  buffer.setContext(m_lastBufferId);
506  m_lastBufferId++;
507 }
508 } // end namespace Svc
Serialization/Deserialization operation was successful.
void setData(U8 *data)
Definition: Buffer.cpp:68
Status create(FwEnumStoreType id, const Fw::ConstStringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage through delegate
Definition: Queue.cpp:22
U16 FwPacketDescriptorType
The width of packet descriptors when they are serialized by the framework.
void fromCancelPacket(const CancelPacket &cancelPacket)
Definition: FilePacket.cpp:68
FwIdType FwOpcodeType
The type of a command opcode.
Path falls outside the configured sandbox directory.
Definition: File.hpp:54
Operation succeeded.
Definition: Os.hpp:27
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void fromDataPacket(const DataPacket &dataPacket)
Definition: FilePacket.cpp:58
PlatformSizeType FwSizeType
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
void setContext(U32 context)
Definition: Buffer.cpp:82
void setSize(FwSizeType size)
Definition: Buffer.cpp:75
The type of a cancel packet.
Definition: FilePacket.hpp:273
Status
status returned from the queue send function
Definition: Queue.hpp:30
void fromEndPacket(const EndPacket &endPacket)
Definition: FilePacket.cpp:63
The type of a data packet.
Definition: FilePacket.hpp:171
U32 getContext() const
Definition: Buffer.cpp:64
FwEnumStoreType getInstance() const
U8 * getData() const
Definition: Buffer.cpp:56
void fromStartPacket(const StartPacket &startPacket)
Definition: FilePacket.cpp:53
Enum representing a command response.
SerializeStatus toBuffer(Buffer &buffer) const
Definition: FilePacket.cpp:91
SerializeStatus
forward declaration for string
Class representing a 32-bit checksum as mandated by the CCSDS File Delivery Protocol.
Definition: Checksum.hpp:53
U32 bufferSize() const
Definition: FilePacket.cpp:73
void deinit() override
Allows de-initialization on teardown.
The type of a start packet.
Definition: FilePacket.hpp:121
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void teardown() override
teardown the queue
Definition: Queue.cpp:49
Command successfully executed.
void initialize(const U32 fileSize, const char *const sourcePath, const char *const destinationPath)
Initialize a StartPacket with sequence number 0.
Definition: StartPacket.cpp:18
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
FwSizeType getSize() const
Definition: Buffer.cpp:60
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Command had execution error.
Operation was successful.
Definition: File.hpp:42
PlatformIndexType FwIndexType
FwSizeType SizeType
The size type for a buffer - for backwards compatibility.
Definition: Buffer.hpp:61
Send file response struct.
Command failed validation.
RateGroupDivider component implementation.
virtual SizeType length() const
Get the length of the string.
message sent/received okay
Definition: Queue.hpp:31
A file packet.
Definition: FilePacket.hpp:33
static const U32 FILEDOWNLINK_INTERNAL_BUFFER_SIZE
void initialize(const U32 sequenceIndex, const U32 byteOffset, const U16 dataSize, const U8 *const data)
Initialize a data packet.
Definition: DataPacket.cpp:18
static const bool FILEDOWNLINK_COMMAND_FAILURES_DISABLED
Implementation of malloc based allocator.
void initialize(const U32 sequenceIndex, const CFDP::Checksum &checksum)
Initialize an end packet.
Definition: EndPacket.cpp:20
void initialize(const U32 sequenceIndex)
Initialize a cancel packet.
ExternalSerializeBufferWithMemberCopy getSerializer()
Definition: Buffer.cpp:95
#define FW_ASSERT(...)
Definition: Assert.hpp:14
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
The type of an end packet.
Definition: FilePacket.hpp:230