@@ -45,13 +45,11 @@ namespace Svc {
4545
4646 void FileDownlink ::
4747 configure (
48- U32 timeout,
4948 U32 cooldown,
5049 U32 cycleTime,
5150 U32 fileQueueDepth
5251 )
5352 {
54- this ->m_timeout = timeout;
5553 this ->m_cooldown = cooldown;
5654 this ->m_cycleTime = cycleTime;
5755 this ->m_configured = true ;
@@ -121,15 +119,7 @@ namespace Svc {
121119 break ;
122120 }
123121 case Mode::WAIT : {
124- // If current timeout is too-high and we are waiting for a packet, issue a timeout
125- if (this ->m_curTimer >= this ->m_timeout ) {
126- this ->m_curTimer = 0 ;
127- this ->log_WARNING_HI_DownlinkTimeout (this ->m_file .getSourceName (), this ->m_file .getDestName ());
128- this ->enterCooldown ();
129- this ->sendResponse (FILEDOWNLINK_COMMAND_FAILURES_DISABLED ? SendFileStatus::STATUS_OK : SendFileStatus::STATUS_ERROR );
130- } else { // Otherwise update the current counter
131- this ->m_curTimer += m_cycleTime;
132- }
122+ this ->m_curTimer += m_cycleTime;
133123 break ;
134124 }
135125 default :
@@ -184,16 +174,17 @@ namespace Svc {
184174 Fw::Buffer &fwBuffer
185175 )
186176 {
187- // If this is a stale buffer (old, timed-out, or both), then ignore its return.
188- // File downlink actions only respond to the return of the most-recently-sent buffer.
189- if (this ->m_lastBufferId != fwBuffer.getContext () + 1 ||
190- this ->m_mode .get () == Mode::IDLE ) {
191- return ;
192- }
193- // Non-ignored buffers cannot be returned in "DOWNLINK" and "IDLE" state. Only in "WAIT", "CANCEL" state.
194- FW_ASSERT (this ->m_mode .get () == Mode::WAIT || this ->m_mode .get () == Mode::CANCEL , this ->m_mode .get ());
177+ // If this is a stale buffer (old, timed-out, or both), then ignore its return.
178+ // File downlink actions only respond to the return of the most-recently-sent buffer.
179+ if (this ->m_lastBufferId != fwBuffer.getContext () + 1 ||
180+ this ->m_mode .get () == Mode::IDLE ||
181+ this ->m_mode .get () == Mode::COOLDOWN ) {
182+ return ;
183+ }
184+ // Non-ignored buffers cannot be returned in "DOWNLINK", "IDLE", or "COOLDOWN" state. Only in "WAIT", "CANCEL" state.
185+ FW_ASSERT (this ->m_mode .get () == Mode::WAIT || this ->m_mode .get () == Mode::CANCEL , this ->m_mode .get ());
195186 // If the last packet has been sent (and is returning now) then finish the file
196- if (this ->m_lastCompletedType == Fw::FilePacket::T_END ||
187+ if (this ->m_lastCompletedType == Fw::FilePacket::T_END ||
197188 this ->m_lastCompletedType == Fw::FilePacket::T_CANCEL ) {
198189 finishHelper (this ->m_lastCompletedType == Fw::FilePacket::T_CANCEL );
199190 return ;
@@ -501,7 +492,7 @@ namespace Svc {
501492 this ->sendCancelPacket ();
502493 this ->m_lastCompletedType = Fw::FilePacket::T_CANCEL ;
503494 }
504- // If in downlink mode and currently downlinking data then continue with the next packer
495+ // If in downlink mode and currently downlinking data then continue with the next packet
505496 else if (this ->m_mode .get () == Mode::DOWNLINK && this ->m_lastCompletedType == Fw::FilePacket::T_START ) {
506497 // Send the next packet, or fail doing so
507498 const Os::File::Status status = this ->sendDataPacket (this ->m_byteOffset );
0 commit comments