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 timeout, U32 cooldown, U32 cycleTime, U32 fileQueueDepth) {
43  this->m_timeout = timeout;
44  this->m_cooldown = cooldown;
45  this->m_cycleTime = cycleTime;
46  this->m_configured = true;
47 
48  Os::Queue::Status stat =
49  m_fileQueue.create(Os::QueueString("fileDownlinkQueue"), static_cast<FwSizeType>(fileQueueDepth),
50  static_cast<FwSizeType>(sizeof(struct FileEntry)));
51  FW_ASSERT(stat == Os::Queue::OP_OK, static_cast<FwAssertArgType>(stat));
52 }
53 
55  FW_ASSERT(this->m_configured == true);
56 }
57 
59 
60 // ----------------------------------------------------------------------
61 // Handler implementations for user-defined typed input ports
62 // ----------------------------------------------------------------------
63 
64 void FileDownlink ::Run_handler(const FwIndexType portNum, U32 context) {
65  switch (this->m_mode.get()) {
66  case Mode::IDLE: {
67  FwSizeType real_size = 0;
68  FwQueuePriorityType prio = 0;
69  Os::Queue::Status stat = m_fileQueue.receive(reinterpret_cast<U8*>(&this->m_curEntry),
70  static_cast<FwSizeType>(sizeof(this->m_curEntry)),
71  Os::Queue::BlockingType::NONBLOCKING, real_size, prio);
72 
73  if (stat != Os::Queue::Status::OP_OK || sizeof(this->m_curEntry) != real_size) {
74  return;
75  }
76 
77  sendFile(this->m_curEntry.srcFilename, this->m_curEntry.destFilename, this->m_curEntry.offset,
78  this->m_curEntry.length);
79  break;
80  }
81  case Mode::COOLDOWN: {
82  if (this->m_curTimer >= this->m_cooldown) {
83  this->m_curTimer = 0;
84  this->m_mode.set(Mode::IDLE);
85  } else {
86  this->m_curTimer += m_cycleTime;
87  }
88  break;
89  }
90  case Mode::WAIT: {
91  // If current timeout is too-high and we are waiting for a packet, issue a timeout
92  if (this->m_curTimer >= this->m_timeout) {
93  this->m_curTimer = 0;
94  this->log_WARNING_HI_DownlinkTimeout(this->m_file.getSourceName(), this->m_file.getDestName());
95  this->enterCooldown();
98  } else { // Otherwise update the current counter
99  this->m_curTimer += m_cycleTime;
100  }
101  break;
102  }
103  default:
104  break;
105  }
106 }
107 
108 Svc::SendFileResponse FileDownlink ::SendFile_handler(
109  const FwIndexType portNum,
110  const Fw::StringBase& sourceFilename, // lgtm[cpp/large-parameter] dictated by command architecture
111  const Fw::StringBase& destFilename, // lgtm[cpp/large-parameter] dictated by command architecture
112  U32 offset,
113  U32 length) {
114  struct FileEntry entry;
115  entry.srcFilename[0] = 0;
116  entry.destFilename[0] = 0;
117  entry.offset = offset;
118  entry.length = length;
119  entry.source = FileDownlink::PORT;
120  entry.opCode = 0;
121  entry.cmdSeq = 0;
122  entry.context = m_cntxId++;
123 
124  FW_ASSERT(sourceFilename.length() < sizeof(entry.srcFilename));
125  FW_ASSERT(destFilename.length() < sizeof(entry.destFilename));
126  (void)Fw::StringUtils::string_copy(entry.srcFilename, sourceFilename.toChar(),
127  static_cast<FwSizeType>(sizeof(entry.srcFilename)));
128  (void)Fw::StringUtils::string_copy(entry.destFilename, destFilename.toChar(),
129  static_cast<FwSizeType>(sizeof(entry.destFilename)));
130 
131  Os::Queue::Status status = m_fileQueue.send(reinterpret_cast<U8*>(&entry), static_cast<FwSizeType>(sizeof(entry)),
132  0, Os::Queue::BlockingType::NONBLOCKING);
133 
134  if (status != Os::Queue::Status::OP_OK) {
135  return SendFileResponse(SendFileStatus::STATUS_ERROR, std::numeric_limits<U32>::max());
136  }
137  return SendFileResponse(SendFileStatus::STATUS_OK, entry.context);
138 }
139 
140 void FileDownlink ::pingIn_handler(const FwIndexType portNum, U32 key) {
141  this->pingOut_out(0, key);
142 }
143 
144 void FileDownlink ::bufferReturn_handler(const FwIndexType portNum, Fw::Buffer& fwBuffer) {
145  // If this is a stale buffer (old, timed-out, or both), then ignore its return.
146  // File downlink actions only respond to the return of the most-recently-sent buffer.
147  if (this->m_lastBufferId != fwBuffer.getContext() + 1 || this->m_mode.get() == Mode::IDLE) {
148  return;
149  }
150  // Non-ignored buffers cannot be returned in "DOWNLINK" and "IDLE" state. Only in "WAIT", "CANCEL" state.
151  FW_ASSERT(this->m_mode.get() == Mode::WAIT || this->m_mode.get() == Mode::CANCEL,
152  static_cast<FwAssertArgType>(this->m_mode.get()));
153  // If the last packet has been sent (and is returning now) then finish the file
154  if (this->m_lastCompletedType == Fw::FilePacket::T_END || this->m_lastCompletedType == Fw::FilePacket::T_CANCEL) {
155  finishHelper(this->m_lastCompletedType == Fw::FilePacket::T_CANCEL);
156  return;
157  }
158  // If waiting and a buffer is in-bound, then switch to downlink mode
159  else if (this->m_mode.get() == Mode::WAIT) {
160  this->m_mode.set(Mode::DOWNLINK);
161  }
162 
163  this->downlinkPacket();
164 }
165 
166 // ----------------------------------------------------------------------
167 // Command handler implementations
168 // ----------------------------------------------------------------------
169 
170 void FileDownlink ::SendFile_cmdHandler(const FwOpcodeType opCode,
171  const U32 cmdSeq,
172  const Fw::CmdStringArg& sourceFilename,
173  const Fw::CmdStringArg& destFilename) {
174  struct FileEntry entry;
175  entry.srcFilename[0] = 0;
176  entry.destFilename[0] = 0;
177  entry.offset = 0;
178  entry.length = 0;
179  entry.source = FileDownlink::COMMAND;
180  entry.opCode = opCode;
181  entry.cmdSeq = cmdSeq;
182  entry.context = std::numeric_limits<U32>::max();
183 
184  FW_ASSERT(sourceFilename.length() < sizeof(entry.srcFilename));
185  FW_ASSERT(destFilename.length() < sizeof(entry.destFilename));
186  (void)Fw::StringUtils::string_copy(entry.srcFilename, sourceFilename.toChar(),
187  static_cast<FwSizeType>(sizeof(entry.srcFilename)));
188  (void)Fw::StringUtils::string_copy(entry.destFilename, destFilename.toChar(),
189  static_cast<FwSizeType>(sizeof(entry.destFilename)));
190 
191  Os::Queue::Status status = m_fileQueue.send(reinterpret_cast<U8*>(&entry), static_cast<FwSizeType>(sizeof(entry)),
192  0, Os::Queue::BlockingType::NONBLOCKING);
193 
194  if (status != Os::Queue::Status::OP_OK) {
195  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR);
196  }
197 }
198 
199 void FileDownlink ::SendPartial_cmdHandler(FwOpcodeType opCode,
200  U32 cmdSeq,
201  const Fw::CmdStringArg& sourceFilename,
202  const Fw::CmdStringArg& destFilename,
203  U32 startOffset,
204  U32 length) {
205  struct FileEntry entry;
206  entry.srcFilename[0] = 0;
207  entry.destFilename[0] = 0;
208  entry.offset = startOffset;
209  entry.length = length;
210  entry.source = FileDownlink::COMMAND;
211  entry.opCode = opCode;
212  entry.cmdSeq = cmdSeq;
213  entry.context = std::numeric_limits<U32>::max();
214 
215  FW_ASSERT(sourceFilename.length() < sizeof(entry.srcFilename));
216  FW_ASSERT(destFilename.length() < sizeof(entry.destFilename));
217  (void)Fw::StringUtils::string_copy(entry.srcFilename, sourceFilename.toChar(),
218  static_cast<FwSizeType>(sizeof(entry.srcFilename)));
219  (void)Fw::StringUtils::string_copy(entry.destFilename, destFilename.toChar(),
220  static_cast<FwSizeType>(sizeof(entry.destFilename)));
221 
222  Os::Queue::Status status = m_fileQueue.send(reinterpret_cast<U8*>(&entry), static_cast<FwSizeType>(sizeof(entry)),
223  0, Os::Queue::BlockingType::NONBLOCKING);
224 
225  if (status != Os::Queue::Status::OP_OK) {
226  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::EXECUTION_ERROR);
227  }
228 }
229 
230 void FileDownlink ::Cancel_cmdHandler(const FwOpcodeType opCode, const U32 cmdSeq) {
231  // Must be able to cancel in both downlink and waiting states
232  if (this->m_mode.get() == Mode::DOWNLINK || this->m_mode.get() == Mode::WAIT) {
233  this->m_mode.set(Mode::CANCEL);
234  }
235  this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
236 }
237 
238 // ----------------------------------------------------------------------
239 // Private helper methods
240 // ----------------------------------------------------------------------
241 
242 Fw::CmdResponse FileDownlink ::statusToCmdResp(SendFileStatus status) {
243  switch (status.e) {
245  return Fw::CmdResponse::OK;
251  return Fw::CmdResponse::BUSY;
252  default:
253  // Trigger assertion if given unknown status
254  FW_ASSERT(false);
255  }
256 
257  // It's impossible to reach this, but added to suppress gcc missing return warning
259 }
260 
261 void FileDownlink ::sendResponse(SendFileStatus resp) {
262  if (this->m_curEntry.source == FileDownlink::COMMAND) {
263  this->cmdResponse_out(this->m_curEntry.opCode, this->m_curEntry.cmdSeq, statusToCmdResp(resp));
264  } else {
265  for (FwIndexType i = 0; i < this->getNum_FileComplete_OutputPorts(); i++) {
267  this->FileComplete_out(i, Svc::SendFileResponse(resp, this->m_curEntry.context));
268  }
269  }
270  }
271 }
272 
273 void FileDownlink ::sendFile(const char* sourceFilename, const char* destFilename, U32 startOffset, U32 length) {
274  // Open file for downlink
275  Os::File::Status status = this->m_file.open(sourceFilename, destFilename);
276 
277  // Reject command if error when opening file
278  if (status != Os::File::OP_OK) {
279  this->m_mode.set(Mode::IDLE);
280  this->m_warnings.fileOpenError();
282  return;
283  }
284 
285  if (startOffset >= this->m_file.getSize()) {
286  this->enterCooldown();
287  this->log_WARNING_HI_DownlinkPartialFail(this->m_file.getSourceName(), this->m_file.getDestName(), startOffset,
288  this->m_file.getSize());
291  return;
292  } else if (startOffset + length > this->m_file.getSize()) {
293  // If the amount to downlink is greater than the file size, emit a Warning and then allow
294  // the file to be downlinked anyway
295  this->log_WARNING_LO_DownlinkPartialWarning(startOffset, length, this->m_file.getSize(),
296  this->m_file.getSourceName(), this->m_file.getDestName());
297  length = this->m_file.getSize() - startOffset;
298  }
299 
300  // Send file and switch to WAIT mode
301  this->getBuffer(this->m_buffer, FILE_PACKET);
302  this->sendStartPacket();
303  this->m_mode.set(Mode::WAIT);
304  this->m_sequenceIndex = 1;
305  this->m_curTimer = 0;
306  this->m_byteOffset = startOffset;
307  this->m_lastCompletedType = Fw::FilePacket::T_START;
308 
309  // zero length means read until end of file
310  if (length > 0) {
311  this->log_ACTIVITY_HI_SendStarted(length, this->m_file.getSourceName(), this->m_file.getDestName());
312  this->m_endOffset = startOffset + length;
313  } else {
314  this->log_ACTIVITY_HI_SendStarted(this->m_file.getSize() - startOffset, this->m_file.getSourceName(),
315  this->m_file.getDestName());
316  this->m_endOffset = this->m_file.getSize();
317  }
318 }
319 
320 Os::File::Status FileDownlink ::sendDataPacket(U32& byteOffset) {
321  FW_ASSERT(byteOffset < this->m_endOffset);
322  const U32 maxDataSize =
324  const U32 dataSize =
325  (byteOffset + maxDataSize > this->m_endOffset) ? (this->m_endOffset - byteOffset) : maxDataSize;
326  U8 buffer[maxDataSize];
327  // This will be last data packet sent
328  if (dataSize + byteOffset == this->m_endOffset) {
329  this->m_lastCompletedType = Fw::FilePacket::T_DATA;
330  }
331 
332  const Os::File::Status status = this->m_file.read(buffer, byteOffset, dataSize);
333  if (status != Os::File::OP_OK) {
334  this->m_warnings.fileRead(status);
335  return status;
336  }
337 
338  Fw::FilePacket::DataPacket dataPacket;
339  dataPacket.initialize(this->m_sequenceIndex, byteOffset, static_cast<U16>(dataSize), buffer);
340  ++this->m_sequenceIndex;
341  Fw::FilePacket filePacket;
342  filePacket.fromDataPacket(dataPacket);
343  this->sendFilePacket(filePacket);
344 
345  byteOffset += dataSize;
346 
347  return Os::File::OP_OK;
348 }
349 
350 void FileDownlink ::sendCancelPacket() {
351  Fw::Buffer buffer;
352  Fw::FilePacket::CancelPacket cancelPacket;
353  cancelPacket.initialize(this->m_sequenceIndex);
354 
355  Fw::FilePacket filePacket;
356  filePacket.fromCancelPacket(cancelPacket);
357  this->getBuffer(buffer, CANCEL_PACKET);
358  FW_ASSERT(buffer.getSize() >= filePacket.bufferSize() + sizeof(FwPacketDescriptorType),
359  static_cast<FwAssertArgType>(buffer.getSize()),
360  static_cast<FwAssertArgType>(filePacket.bufferSize() + sizeof(FwPacketDescriptorType)));
361 
362  // Serialize the packet descriptor FW_PACKET_FILE to the buffer
364  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
365  Fw::Buffer offsetBuffer(buffer.getData() + sizeof(FwPacketDescriptorType),
366  buffer.getSize() - static_cast<Fw::Buffer::SizeType>(sizeof(FwPacketDescriptorType)));
367  // Serialize the filePacket content into the buffer
368  status = filePacket.toBuffer(offsetBuffer);
369  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
370  this->bufferSendOut_out(0, buffer);
371  this->m_packetsSent.packetSent();
372 }
373 
374 void FileDownlink ::sendEndPacket() {
375  CFDP::Checksum checksum;
376  this->m_file.getChecksum(checksum);
377 
378  Fw::FilePacket::EndPacket endPacket;
379  endPacket.initialize(this->m_sequenceIndex, checksum);
380 
381  Fw::FilePacket filePacket;
382  filePacket.fromEndPacket(endPacket);
383  this->sendFilePacket(filePacket);
384 }
385 
386 void FileDownlink ::sendStartPacket() {
387  Fw::FilePacket::StartPacket startPacket;
388  startPacket.initialize(this->m_file.getSize(), this->m_file.getSourceName().toChar(),
389  this->m_file.getDestName().toChar());
390  Fw::FilePacket filePacket;
391  filePacket.fromStartPacket(startPacket);
392  this->sendFilePacket(filePacket);
393 }
394 
395 void FileDownlink ::sendFilePacket(const Fw::FilePacket& filePacket) {
396  const U32 bufferSize = filePacket.bufferSize() + static_cast<U32>(sizeof(FwPacketDescriptorType));
397  FW_ASSERT(this->m_buffer.getData() != nullptr);
398  FW_ASSERT(this->m_buffer.getSize() >= bufferSize, static_cast<FwAssertArgType>(bufferSize),
399  static_cast<FwAssertArgType>(this->m_buffer.getSize()));
400  // Serialize packet descriptor FW_PACKET_FILE to the buffer
402  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
403  // Serialize the filePacket content into the buffer, offset by the size of the packet descriptor
404  Fw::Buffer offsetBuffer(
405  this->m_buffer.getData() + sizeof(FwPacketDescriptorType),
406  this->m_buffer.getSize() - static_cast<Fw::Buffer::SizeType>(sizeof(FwPacketDescriptorType)));
407  status = filePacket.toBuffer(offsetBuffer);
408  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
409  // set the buffer size to the packet size
410  this->m_buffer.setSize(bufferSize);
411  this->bufferSendOut_out(0, this->m_buffer);
412  // restore buffer size to max
414  this->m_packetsSent.packetSent();
415 }
416 
417 void FileDownlink ::enterCooldown() {
418  this->m_file.getOsFile().close();
419  this->m_mode.set(Mode::COOLDOWN);
420  this->m_lastCompletedType = Fw::FilePacket::T_NONE;
421  this->m_curTimer = 0;
422 }
423 
424 void FileDownlink ::downlinkPacket() {
425  FW_ASSERT(this->m_lastCompletedType != Fw::FilePacket::T_NONE,
426  static_cast<FwAssertArgType>(this->m_lastCompletedType));
427  FW_ASSERT(this->m_mode.get() == Mode::CANCEL || this->m_mode.get() == Mode::DOWNLINK,
428  static_cast<FwAssertArgType>(this->m_mode.get()));
429  // If canceled mode and currently downlinking data then send a cancel packet
430  if (this->m_mode.get() == Mode::CANCEL && this->m_lastCompletedType == Fw::FilePacket::T_START) {
431  this->sendCancelPacket();
432  this->m_lastCompletedType = Fw::FilePacket::T_CANCEL;
433  }
434  // If in downlink mode and currently downlinking data then continue with the next packer
435  else if (this->m_mode.get() == Mode::DOWNLINK && this->m_lastCompletedType == Fw::FilePacket::T_START) {
436  // Send the next packet, or fail doing so
437  const Os::File::Status status = this->sendDataPacket(this->m_byteOffset);
438  if (status != Os::File::OP_OK) {
439  this->log_WARNING_HI_SendDataFail(this->m_file.getSourceName(), this->m_byteOffset);
440  this->enterCooldown();
443  // Don't go to wait state
444  return;
445  }
446  }
447  // If in downlink mode or cancel and finished downlinking data then send the last packet
448  else if (this->m_lastCompletedType == Fw::FilePacket::T_DATA) {
449  this->sendEndPacket();
450  this->m_lastCompletedType = Fw::FilePacket::T_END;
451  }
452  this->m_mode.set(Mode::WAIT);
453  this->m_curTimer = 0;
454 }
455 
456 void FileDownlink ::finishHelper(bool cancel) {
457  // Complete command and switch to IDLE
458  if (not cancel) {
459  this->m_filesSent.fileSent();
460  this->log_ACTIVITY_HI_FileSent(this->m_file.getSourceName(), this->m_file.getDestName());
461  } else {
462  this->log_ACTIVITY_HI_DownlinkCanceled(this->m_file.getSourceName(), this->m_file.getDestName());
463  }
464  this->enterCooldown();
465  sendResponse(SendFileStatus::STATUS_OK);
466 }
467 
468 void FileDownlink ::getBuffer(Fw::Buffer& buffer, PacketType type) {
469  // Check type is correct
470  FW_ASSERT(type < COUNT_PACKET_TYPE && type >= 0, static_cast<FwAssertArgType>(type));
471  // Wrap the buffer around our indexed memory.
472  buffer.setData(this->m_memoryStore[type]);
474  // Set a known ID to look for later
475  buffer.setContext(m_lastBufferId);
476  m_lastBufferId++;
477 }
478 } // end namespace Svc
Serialization/Deserialization operation was successful.
void setData(U8 *data)
Definition: Buffer.cpp:80
void fromCancelPacket(const CancelPacket &cancelPacket)
Definition: FilePacket.cpp:90
Operation succeeded.
Definition: Os.hpp:26
void fromDataPacket(const DataPacket &dataPacket)
Definition: FilePacket.cpp:76
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:59
The type of a cancel packet.
Definition: FilePacket.hpp:318
Status
status returned from the queue send function
Definition: Queue.hpp:30
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void setContext(SizeType context)
Definition: Buffer.cpp:94
void setSize(SizeType size)
Definition: Buffer.cpp:87
void fromEndPacket(const EndPacket &endPacket)
Definition: FilePacket.cpp:83
The type of a data packet.
Definition: FilePacket.hpp:197
U32 getContext() const
Definition: Buffer.cpp:76
U8 * getData() const
Definition: Buffer.cpp:68
void fromStartPacket(const StartPacket &startPacket)
Definition: FilePacket.cpp:69
Enum representing a command response.
SerializeStatus toBuffer(Buffer &buffer) const
Definition: FilePacket.cpp:117
SerializeStatus
forward declaration for string
Class representing a 32-bit checksum as mandated by the CCSDS File Delivery Protocol.
Definition: Checksum.hpp:53
U32 FwOpcodeType
The type of a command opcode.
U32 bufferSize() const
Definition: FilePacket.cpp:97
char * string_copy(char *destination, const char *source, FwSizeType num)
copy string with null-termination guaranteed
Definition: StringUtils.cpp:7
The type of a start packet.
Definition: FilePacket.hpp:139
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:42
SizeType length() const
Get length of string.
Definition: StringBase.cpp:121
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:19
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:56
Status create(const Fw::StringBase &name, FwSizeType depth, FwSizeType messageSize) override
create queue storage through delegate
Definition: Queue.cpp:20
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
Command had execution error.
const char * toChar() const
Definition: CmdString.hpp:50
Operation was successful.
Definition: File.hpp:30
U32 FwPacketDescriptorType
The type of a com packet descriptor.
PlatformIndexType FwIndexType
Send file response struct.
Command failed validation.
RateGroupDivider component implementation.
message sent/received okay
Definition: Queue.hpp:31
A file packet.
Definition: FilePacket.hpp:27
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:19
static const bool FILEDOWNLINK_COMMAND_FAILURES_DISABLED
SizeType getSize() const
Definition: Buffer.cpp:72
void initialize(const U32 sequenceIndex, const CFDP::Checksum &checksum)
Initialize an end packet.
Definition: EndPacket.cpp:21
U32 SizeType
The size type for a buffer.
Definition: Buffer.hpp:47
void initialize(const U32 sequenceIndex)
Initialize a cancel packet.
ExternalSerializeBufferWithMemberCopy getSerializer()
Definition: Buffer.cpp:107
#define FW_ASSERT(...)
Definition: Assert.hpp:14
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
virtual const CHAR * toChar() const =0
The type of an end packet.
Definition: FilePacket.hpp:269