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