F´ Flight Software - C/C++ Documentation  NASA-v2.1.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
13 #include <Fw/Types/Assert.hpp>
14 #include <Fw/Types/BasicTypes.hpp>
15 #include <Fw/Types/StringUtils.hpp>
16 #include <Os/QueueString.hpp>
17 
18 namespace Svc {
19 
20  // ----------------------------------------------------------------------
21  // Construction, initialization, and destruction
22  // ----------------------------------------------------------------------
23 
26  const char *const name
27  ) :
28  FileDownlinkComponentBase(name),
29  configured(false),
30  filesSent(this),
31  packetsSent(this),
32  warnings(this),
33  sequenceIndex(0),
34  curTimer(0),
35  bufferSize(0),
36  byteOffset(0),
37  endOffset(0),
38  lastCompletedType(Fw::FilePacket::T_NONE),
39  lastBufferId(0),
40  curEntry(),
41  cntxId(0)
42  {
43  }
44 
45  void FileDownlink ::
47  const NATIVE_INT_TYPE queueDepth,
48  const NATIVE_INT_TYPE instance
49  )
50  {
51  FileDownlinkComponentBase::init(queueDepth, instance);
52  }
53 
54  void FileDownlink ::
56  U32 timeout,
57  U32 cooldown,
58  U32 cycleTime,
59  U32 fileQueueDepth
60  )
61  {
62  this->timeout = timeout;
63  this->cooldown = cooldown;
64  this->cycleTime = cycleTime;
65  this->configured = true;
66 
67  Os::Queue::QueueStatus stat = fileQueue.create(
68  Os::QueueString("fileDownlinkQueue"),
69  fileQueueDepth,
70  sizeof(struct FileEntry)
71  );
72  FW_ASSERT(stat == Os::Queue::QUEUE_OK, stat);
73  }
74 
75  void FileDownlink ::
77  {
78  FW_ASSERT(this->configured == true);
79  }
80 
83  {
84 
85  }
86 
87  // ----------------------------------------------------------------------
88  // Handler implementations for user-defined typed input ports
89  // ----------------------------------------------------------------------
90 
91  void FileDownlink ::
92  Run_handler(
93  const NATIVE_INT_TYPE portNum,
94  NATIVE_UINT_TYPE context
95  )
96  {
97  switch(this->mode.get())
98  {
99  case Mode::IDLE: {
100  NATIVE_INT_TYPE real_size = 0;
101  NATIVE_INT_TYPE prio = 0;
102  Os::Queue::QueueStatus stat = fileQueue.receive(
103  (U8 *) &this->curEntry,
104  sizeof(this->curEntry),
105  real_size,
106  prio,
108  );
109 
110  if(stat != Os::Queue::QUEUE_OK || sizeof(this->curEntry) != real_size) {
111  return;
112  }
113 
114  sendFile(
115  this->curEntry.srcFilename,
116  this->curEntry.destFilename,
117  this->curEntry.offset,
118  this->curEntry.length
119  );
120  break;
121  }
122  case Mode::COOLDOWN: {
123  if (this->curTimer >= this->cooldown) {
124  this->curTimer = 0;
125  this->mode.set(Mode::IDLE);
126  } else {
127  this->curTimer += cycleTime;
128  }
129  break;
130  }
131  case Mode::WAIT: {
132  //If current timeout is too-high and we are waiting for a packet, issue a timeout
133  if (this->curTimer >= this->timeout) {
134  this->curTimer = 0;
135  this->log_WARNING_HI_DownlinkTimeout(this->file.sourceName, this->file.destName);
136  this->enterCooldown();
137  this->sendResponse(FILEDOWNLINK_COMMAND_FAILURES_DISABLED ? SendFileStatus::STATUS_OK : SendFileStatus::STATUS_ERROR);
138  } else { //Otherwise update the current counter
139  this->curTimer += cycleTime;
140  }
141  break;
142  }
143  default:
144  break;
145  }
146  }
147 
148  Svc::SendFileResponse FileDownlink ::
149  SendFile_handler(
150  const NATIVE_INT_TYPE portNum,
151  sourceFileNameString sourceFilename, // lgtm[cpp/large-parameter] dictated by command architecture
152  destFileNameString destFilename, // lgtm[cpp/large-parameter] dictated by command architecture
153  U32 offset,
154  U32 length
155  )
156  {
157  struct FileEntry entry;
158  entry.srcFilename[0] = 0;
159  entry.destFilename[0] = 0;
160  entry.offset = offset;
161  entry.length = length;
162  entry.source = FileDownlink::PORT;
163  entry.opCode = 0;
164  entry.cmdSeq = 0;
165  entry.context = cntxId++;
166 
167  FW_ASSERT(sourceFilename.length() < sizeof(entry.srcFilename));
168  FW_ASSERT(destFilename.length() < sizeof(entry.destFilename));
169  Fw::StringUtils::string_copy(entry.srcFilename, sourceFilename.toChar(), sizeof(entry.srcFilename));
170  Fw::StringUtils::string_copy(entry.destFilename, destFilename.toChar(), sizeof(entry.destFilename));
171 
172  Os::Queue::QueueStatus status = fileQueue.send((U8 *) &entry, sizeof(entry), 0, Os::Queue::QUEUE_NONBLOCKING);
173 
174  if(status != Os::Queue::QUEUE_OK) {
175  return SendFileResponse(SendFileStatus::STATUS_ERROR, U32_MAX);
176  }
177  return SendFileResponse(SendFileStatus::STATUS_OK, entry.context);
178  }
179 
180  void FileDownlink ::
181  pingIn_handler(
182  const NATIVE_INT_TYPE portNum,
183  U32 key
184  )
185  {
186  this->pingOut_out(0,key);
187  }
188 
189  void FileDownlink ::
190  bufferReturn_handler(
191  const NATIVE_INT_TYPE portNum,
192  Fw::Buffer &fwBuffer
193  )
194  {
195  //If this is a stale buffer (old, timed-out, or both), then ignore its return.
196  //File downlink actions only respond to the return of the most-recently-sent buffer.
197  if (this->lastBufferId != fwBuffer.getContext() + 1 ||
198  this->mode.get() == Mode::IDLE) {
199  return;
200  }
201  //Non-ignored buffers cannot be returned in "DOWNLINK" and "IDLE" state. Only in "WAIT", "CANCEL" state.
202  FW_ASSERT(this->mode.get() == Mode::WAIT || this->mode.get() == Mode::CANCEL, this->mode.get());
203  //If the last packet has been sent (and is returning now) then finish the file
204  if (this->lastCompletedType == Fw::FilePacket::T_END ||
205  this->lastCompletedType == Fw::FilePacket::T_CANCEL) {
206  finishHelper(this->lastCompletedType == Fw::FilePacket::T_CANCEL);
207  return;
208  }
209  //If waiting and a buffer is in-bound, then switch to downlink mode
210  else if (this->mode.get() == Mode::WAIT) {
211  this->mode.set(Mode::DOWNLINK);
212  }
213 
214  this->downlinkPacket();
215  }
216 
217  // ----------------------------------------------------------------------
218  // Command handler implementations
219  // ----------------------------------------------------------------------
220 
221  void FileDownlink ::
222  SendFile_cmdHandler(
223  const FwOpcodeType opCode,
224  const U32 cmdSeq,
225  const Fw::CmdStringArg& sourceFilename,
226  const Fw::CmdStringArg& destFilename
227  )
228  {
229  struct FileEntry entry;
230  entry.srcFilename[0] = 0;
231  entry.destFilename[0] = 0;
232  entry.offset = 0;
233  entry.length = 0;
234  entry.source = FileDownlink::COMMAND;
235  entry.opCode = opCode;
236  entry.cmdSeq = cmdSeq;
237  entry.context = U32_MAX;
238 
239 
240  FW_ASSERT(sourceFilename.length() < sizeof(entry.srcFilename));
241  FW_ASSERT(destFilename.length() < sizeof(entry.destFilename));
242  Fw::StringUtils::string_copy(entry.srcFilename, sourceFilename.toChar(), sizeof(entry.srcFilename));
243  Fw::StringUtils::string_copy(entry.destFilename, destFilename.toChar(), sizeof(entry.destFilename));
244 
245  Os::Queue::QueueStatus status = fileQueue.send((U8 *) &entry, sizeof(entry), 0, Os::Queue::QUEUE_NONBLOCKING);
246 
247  if(status != Os::Queue::QUEUE_OK) {
248  this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR);
249  }
250  }
251 
252  void FileDownlink ::
253  SendPartial_cmdHandler(
254  FwOpcodeType opCode,
255  U32 cmdSeq,
256  const Fw::CmdStringArg& sourceFilename,
257  const Fw::CmdStringArg& destFilename,
258  U32 startOffset,
259  U32 length
260  )
261  {
262  struct FileEntry entry;
263  entry.srcFilename[0] = 0;
264  entry.destFilename[0] = 0;
265  entry.offset = startOffset;
266  entry.length = length;
267  entry.source = FileDownlink::COMMAND;
268  entry.opCode = opCode;
269  entry.cmdSeq = cmdSeq;
270  entry.context = U32_MAX;
271 
272 
273  FW_ASSERT(sourceFilename.length() < sizeof(entry.srcFilename));
274  FW_ASSERT(destFilename.length() < sizeof(entry.destFilename));
275  Fw::StringUtils::string_copy(entry.srcFilename, sourceFilename.toChar(), sizeof(entry.srcFilename));
276  Fw::StringUtils::string_copy(entry.destFilename, destFilename.toChar(), sizeof(entry.destFilename));
277 
278  Os::Queue::QueueStatus status = fileQueue.send((U8 *) &entry, sizeof(entry), 0, Os::Queue::QUEUE_NONBLOCKING);
279 
280  if(status != Os::Queue::QUEUE_OK) {
281  this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_EXECUTION_ERROR);
282  }
283  }
284 
285  void FileDownlink ::
286  Cancel_cmdHandler(
287  const FwOpcodeType opCode,
288  const U32 cmdSeq
289  )
290  {
291  //Must be able to cancel in both downlink and waiting states
292  if (this->mode.get() == Mode::DOWNLINK || this->mode.get() == Mode::WAIT) {
293  this->mode.set(Mode::CANCEL);
294  }
295  this->cmdResponse_out(opCode, cmdSeq, Fw::COMMAND_OK);
296  }
297 
298  // ----------------------------------------------------------------------
299  // Private helper methods
300  // ----------------------------------------------------------------------
301 
302  Fw::CommandResponse FileDownlink ::
303  statusToCmdResp(SendFileStatus status)
304  {
305  switch(status.e) {
306  case SendFileStatus::STATUS_OK:
307  return Fw::COMMAND_OK;
308  case SendFileStatus::STATUS_ERROR:
309  return Fw::COMMAND_EXECUTION_ERROR;
310  case SendFileStatus::STATUS_INVALID:
311  return Fw::COMMAND_VALIDATION_ERROR;
312  case SendFileStatus::STATUS_BUSY:
313  return Fw::COMMAND_BUSY;
314  default:
315  // Trigger assertion if given unknown status
316  FW_ASSERT(false);
317  }
318 
319  // It's impossible to reach this, but added to suppress gcc missing return warning
320  return Fw::COMMAND_EXECUTION_ERROR;
321  }
322 
323  void FileDownlink ::
324  sendResponse(SendFileStatus resp)
325  {
326  if(this->curEntry.source == FileDownlink::COMMAND) {
327  this->cmdResponse_out(this->curEntry.opCode, this->curEntry.cmdSeq, statusToCmdResp(resp));
328  } else {
329  for(NATIVE_INT_TYPE i = 0; i < this->getNum_FileComplete_OutputPorts(); i++) {
330  if(this->isConnected_FileComplete_OutputPort(i)) {
331  this->FileComplete_out(i, Svc::SendFileResponse(resp, this->curEntry.context));
332  }
333  }
334  }
335  }
336 
337  void FileDownlink ::
338  sendFile(
339  const char* sourceFilename,
340  const char* destFilename,
341  U32 startOffset,
342  U32 length
343  )
344  {
345  // Open file for downlink
346  Os::File::Status status = this->file.open(
347  sourceFilename,
348  destFilename
349  );
350 
351  // Reject command if error when opening file
352  if (status != Os::File::OP_OK) {
353  this->mode.set(Mode::IDLE);
354  this->warnings.fileOpenError();
355  sendResponse(FILEDOWNLINK_COMMAND_FAILURES_DISABLED ? SendFileStatus::STATUS_OK : SendFileStatus::STATUS_ERROR);
356  return;
357  }
358 
359 
360  if (startOffset >= this->file.size) {
361  this->enterCooldown();
362  this->log_WARNING_HI_DownlinkPartialFail(this->file.sourceName, this->file.destName, startOffset, this->file.size);
363  sendResponse(FILEDOWNLINK_COMMAND_FAILURES_DISABLED ? SendFileStatus::STATUS_OK : SendFileStatus::STATUS_INVALID);
364  return;
365  } else if (startOffset + length > this->file.size) {
366  // If the amount to downlink is greater than the file size, emit a Warning and then allow
367  // the file to be downlinked anyway
368  this->log_WARNING_LO_DownlinkPartialWarning(startOffset, length, this->file.size, this->file.sourceName, this->file.destName);
369  length = this->file.size - startOffset;
370  }
371 
372  // Send file and switch to WAIT mode
373  this->getBuffer(this->buffer, FILE_PACKET);
374  this->sendStartPacket();
375  this->mode.set(Mode::WAIT);
376  this->sequenceIndex = 1;
377  this->curTimer = 0;
378  this->byteOffset = startOffset;
379  this->lastCompletedType = Fw::FilePacket::T_START;
380 
381  // zero length means read until end of file
382  if (length > 0) {
383  this->log_ACTIVITY_HI_SendStarted(length, this->file.sourceName, this->file.destName);
384  this->endOffset = startOffset + length;
385  }
386  else {
387  this->log_ACTIVITY_HI_SendStarted(this->file.size - startOffset, this->file.sourceName, this->file.destName);
388  this->endOffset = this->file.size;
389  }
390  }
391 
392  Os::File::Status FileDownlink ::
393  sendDataPacket(U32 &byteOffset)
394  {
395  FW_ASSERT(byteOffset < this->endOffset);
397  const U32 dataSize = (byteOffset + maxDataSize > this->endOffset) ? (this->endOffset - byteOffset) : maxDataSize;
399  //This will be last data packet sent
400  if (dataSize + byteOffset == this->endOffset) {
401  this->lastCompletedType = Fw::FilePacket::T_DATA;
402  }
403 
404  const Os::File::Status status =
405  this->file.read(buffer, byteOffset, dataSize);
406  if (status != Os::File::OP_OK) {
407  this->warnings.fileRead(status);
408  return status;
409  }
410 
411  const Fw::FilePacket::DataPacket dataPacket = {
412  { Fw::FilePacket::T_DATA, this->sequenceIndex },
413  byteOffset,
414  (U16)dataSize,
415  buffer
416  };
417  ++this->sequenceIndex;
418  Fw::FilePacket filePacket;
419  filePacket.fromDataPacket(dataPacket);
420  this->sendFilePacket(filePacket);
421 
422  byteOffset += dataSize;
423 
424  return Os::File::OP_OK;
425 
426  }
427 
428  void FileDownlink ::
429  sendCancelPacket(void)
430  {
431  Fw::Buffer buffer;
432  const Fw::FilePacket::CancelPacket cancelPacket = {
433  { Fw::FilePacket::T_CANCEL, this->sequenceIndex }
434  };
435 
436  Fw::FilePacket filePacket;
437  filePacket.fromCancelPacket(cancelPacket);
438  this->getBuffer(buffer, CANCEL_PACKET);
439 
440  const Fw::SerializeStatus status = filePacket.toBuffer(buffer);
441  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
442  this->bufferSendOut_out(0, buffer);
443  this->packetsSent.packetSent();
444  }
445 
446  void FileDownlink ::
447  sendEndPacket(void)
448  {
449  const Fw::FilePacket::Header header = {
451  this->sequenceIndex
452  };
453  Fw::FilePacket::EndPacket endPacket;
454  endPacket.header = header;
455 
456  CFDP::Checksum checksum;
457  this->file.getChecksum(checksum);
458  endPacket.setChecksum(checksum);
459 
460  Fw::FilePacket filePacket;
461  filePacket.fromEndPacket(endPacket);
462  this->sendFilePacket(filePacket);
463 
464  }
465 
466  void FileDownlink ::
467  sendStartPacket(void)
468  {
469  Fw::FilePacket::StartPacket startPacket;
470  startPacket.initialize(
471  this->file.size,
472  this->file.sourceName.toChar(),
473  this->file.destName.toChar()
474  );
475  Fw::FilePacket filePacket;
476  filePacket.fromStartPacket(startPacket);
477  this->sendFilePacket(filePacket);
478  }
479 
480  void FileDownlink ::
481  sendFilePacket(const Fw::FilePacket& filePacket)
482  {
483  const U32 bufferSize = filePacket.bufferSize();
484  FW_ASSERT(this->buffer.getData() != 0);
485  FW_ASSERT(this->buffer.getSize() >= bufferSize, bufferSize, this->buffer.getSize());
486  const Fw::SerializeStatus status = filePacket.toBuffer(this->buffer);
487  FW_ASSERT(status == Fw::FW_SERIALIZE_OK);
488  // set the buffer size to the packet size
489  this->buffer.setSize(bufferSize);
490  this->bufferSendOut_out(0, this->buffer);
491  // restore buffer size to max
493  this->packetsSent.packetSent();
494  }
495 
496  void FileDownlink ::
497  enterCooldown(void)
498  {
499  this->file.osFile.close();
500  this->mode.set(Mode::COOLDOWN);
501  this->lastCompletedType = Fw::FilePacket::T_NONE;
502  this->curTimer = 0;
503  }
504 
505  void FileDownlink ::
506  downlinkPacket()
507  {
508  FW_ASSERT(this->lastCompletedType != Fw::FilePacket::T_NONE, this->lastCompletedType);
509  FW_ASSERT(this->mode.get() == Mode::CANCEL || this->mode.get() == Mode::DOWNLINK, this->mode.get());
510  //If canceled mode and currently downlinking data then send a cancel packet
511  if (this->mode.get() == Mode::CANCEL && this->lastCompletedType == Fw::FilePacket::T_START) {
512  this->sendCancelPacket();
513  this->lastCompletedType = Fw::FilePacket::T_CANCEL;
514  }
515  //If in downlink mode and currently downlinking data then continue with the next packer
516  else if (this->mode.get() == Mode::DOWNLINK && this->lastCompletedType == Fw::FilePacket::T_START) {
517  //Send the next packet, or fail doing so
518  const Os::File::Status status = this->sendDataPacket(this->byteOffset);
519  if (status != Os::File::OP_OK) {
520  this->log_WARNING_HI_SendDataFail(this->file.sourceName, this->byteOffset);
521  this->enterCooldown();
522  this->sendResponse(FILEDOWNLINK_COMMAND_FAILURES_DISABLED ? SendFileStatus::STATUS_OK : SendFileStatus::STATUS_ERROR);
523  //Don't go to wait state
524  return;
525  }
526  }
527  //If in downlink mode or cancel and finished downlinking data then send the last packet
528  else if (this->lastCompletedType == Fw::FilePacket::T_DATA) {
529  this->sendEndPacket();
530  this->lastCompletedType = Fw::FilePacket::T_END;
531  }
532  this->mode.set(Mode::WAIT);
533  this->curTimer = 0;
534  }
535 
536  void FileDownlink ::
537  finishHelper(bool cancel)
538  {
539  //Complete command and switch to IDLE
540  if (not cancel) {
541  this->filesSent.fileSent();
542  this->log_ACTIVITY_HI_FileSent(this->file.sourceName, this->file.destName);
543  } else {
544  this->log_ACTIVITY_HI_DownlinkCanceled(this->file.sourceName, this->file.destName);
545  }
546  this->enterCooldown();
547  sendResponse(SendFileStatus::STATUS_OK);
548  }
549 
550  void FileDownlink ::
551  getBuffer(Fw::Buffer& buffer, PacketType type)
552  {
553  //Check type is correct
554  FW_ASSERT(type < COUNT_PACKET_TYPE && type >= 0, type);
555  // Wrap the buffer around our indexed memory.
556  buffer.setData(this->memoryStore[type]);
558  //Set a known ID to look for later
559  buffer.setContext(lastBufferId);
560  lastBufferId++;
561  }
562 } // end namespace Svc
Os::Queue::create
QueueStatus create(const Fw::StringBase &name, NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize)
create a message queue
Definition: QueueCommon.cpp:41
Fw::FilePacket::DataPacket::HEADERSIZE
@ HEADERSIZE
Definition: FilePacket.hpp:181
Fw::SerializeStatus
SerializeStatus
forward declaration for string
Definition: Serializable.hpp:14
Fw::CmdStringArg::toChar
const char * toChar(void) const
Definition: CmdString.cpp:40
Fw::FilePacket::toBuffer
SerializeStatus toBuffer(Buffer &buffer) const
Definition: FilePacket.cpp:117
Fw::Buffer::setContext
void setContext(U32 context)
Definition: Buffer.cpp:86
Fw::Buffer::getData
U8 * getData() const
Definition: Buffer.cpp:60
Fw::FilePacket::CancelPacket
The type of a cancel packet.
Definition: FilePacket.hpp:259
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
Svc::FILEDOWNLINK_INTERNAL_BUFFER_SIZE
static const U32 FILEDOWNLINK_INTERNAL_BUFFER_SIZE
Definition: FileDownlinkCfg.hpp:23
Fw::FilePacket::StartPacket
The type of a start packet.
Definition: FilePacket.hpp:118
Fw::Buffer::setData
void setData(U8 *data)
Definition: Buffer.cpp:72
Os::Queue::QueueStatus
QueueStatus
Definition: Queue.hpp:27
Svc::FILEDOWNLINK_COMMAND_FAILURES_DISABLED
static const bool FILEDOWNLINK_COMMAND_FAILURES_DISABLED
Definition: FileDownlinkCfg.hpp:20
Fw::Buffer::getContext
U32 getContext() const
Definition: Buffer.cpp:68
Fw::FilePacket::DataPacket
The type of a data packet.
Definition: FilePacket.hpp:162
Fw::FilePacket::fromDataPacket
void fromDataPacket(const DataPacket &dataPacket)
Definition: FilePacket.cpp:76
Fw::FilePacket::Header
The type of a packet header.
Definition: FilePacket.hpp:83
Fw::Buffer
Definition: Buffer.hpp:43
Fw::FilePacket::T_CANCEL
@ T_CANCEL
Definition: FilePacket.hpp:40
StringUtils.hpp
Fw::CmdStringArg
Definition: CmdString.hpp:11
Fw::FilePacket::EndPacket
The type of an end packet.
Definition: FilePacket.hpp:216
Assert.hpp
Fw::FW_SERIALIZE_OK
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
Definition: Serializable.hpp:15
Os::Queue::send
QueueStatus send(const Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE priority, QueueBlocking block)
send a message
Definition: QueueCommon.cpp:13
Fw::FilePacket::EndPacket::header
Header header
The packet header.
Definition: FilePacket.hpp:223
QueueString.hpp
Fw::FilePacket
A file packet.
Definition: FilePacket.hpp:27
Fw::FilePacket::T_NONE
@ T_NONE
Definition: FilePacket.hpp:41
Os::Queue::receive
QueueStatus receive(Fw::SerializeBufferBase &buffer, NATIVE_INT_TYPE &priority, QueueBlocking block)
receive a message
Definition: QueueCommon.cpp:22
Fw::FilePacket::bufferSize
U32 bufferSize(void) const
Definition: FilePacket.cpp:97
Os::QueueString
Definition: QueueString.hpp:10
Fw::Buffer::getSize
U32 getSize() const
Definition: Buffer.cpp:64
Fw::StringUtils::string_copy
char * string_copy(char *destination, const char *source, U32 num)
copy string with null-termination guaranteed
Definition: StringUtils.cpp:5
FwOpcodeType
#define FwOpcodeType
Type representation for a command opcode.
Definition: FpConfig.hpp:62
Fw::Buffer::setSize
void setSize(U32 size)
Definition: Buffer.cpp:79
Fw::FilePacket::fromStartPacket
void fromStartPacket(const StartPacket &startPacket)
Definition: FilePacket.cpp:69
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Fw::FilePacket::EndPacket::setChecksum
void setChecksum(const CFDP::Checksum &checksum)
Set the checksum.
Definition: EndPacket.cpp:47
Fw::FilePacket::T_START
@ T_START
Definition: FilePacket.hpp:37
Fw::StringBase::length
NATIVE_UINT_TYPE length(void) const
Get length of string.
Definition: StringType.cpp:119
FW_ASSERT
#define FW_ASSERT(...)
Definition: Assert.hpp:9
CFDP::Checksum
Class representing a CFDP checksum.
Definition: Checksum.hpp:23
Os::Queue::QUEUE_OK
@ QUEUE_OK
message sent/received okay
Definition: Queue.hpp:28
Fw::FilePacket::fromEndPacket
void fromEndPacket(const EndPacket &endPacket)
Definition: FilePacket.cpp:83
Fw::FilePacket::T_END
@ T_END
Definition: FilePacket.hpp:39
Svc
Definition: ActiveRateGroupImplCfg.hpp:18
Os::Queue::QUEUE_NONBLOCKING
@ QUEUE_NONBLOCKING
Queue receive always returns even if there is no message.
Definition: Queue.hpp:42
Os::File::Status
Status
Definition: File.hpp:24
BasicTypes.hpp
Declares ISF basic types.
Os::File::OP_OK
@ OP_OK
Operation was successful.
Definition: File.hpp:25
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw::FilePacket::StartPacket::initialize
void initialize(const U32 fileSize, const char *const sourcePath, const char *const destinationPath)
Initialize a StartPacket with sequence number 0.
Definition: StartPacket.cpp:19
Fw::FilePacket::T_DATA
@ T_DATA
Definition: FilePacket.hpp:38
Fw
Definition: Buffer.cpp:21
Fw::FilePacket::fromCancelPacket
void fromCancelPacket(const CancelPacket &cancelPacket)
Definition: FilePacket.cpp:90