Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Bump allowed `spacepackets` to >=0.30, <=0.31
- Transition CRC library from `crcmod` to `fastcrc`

## Removed

- `TransactionStep.SENDING_ACK_OF_FINISHED` for source handler which is not required anymore.

# [v0.5.1] 2025-02-10

- Bump allowed `spacepackets` to v0.28.0
Expand Down
7 changes: 1 addition & 6 deletions src/cfdppy/handler/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class TransactionStep(enum.Enum):
SENDING_EOF = 6
WAITING_FOR_EOF_ACK = 7
WAITING_FOR_FINISHED = 8
SENDING_ACK_OF_FINISHED = 9
NOTICE_OF_COMPLETION = 10


Expand Down Expand Up @@ -789,9 +788,7 @@ def _handle_wait_for_finish(self, packet_holder: PduHolder) -> None:
self._params.finished_params = finished_pdu.finished_params
if self.transmission_mode == TransmissionMode.ACKNOWLEDGED:
self._prepare_finished_ack_packet(finished_pdu.condition_code)
self.states.step = TransactionStep.SENDING_ACK_OF_FINISHED
else:
self.states.step = TransactionStep.NOTICE_OF_COMPLETION
self.states.step = TransactionStep.NOTICE_OF_COMPLETION

def _notice_of_completion(self) -> None:
if self.cfg.indication_cfg.transaction_finished_indication_required:
Expand Down Expand Up @@ -822,8 +819,6 @@ def _fsm_advancement_after_packets_were_sent(self) -> None:
self.states.step = self._params.ack_params.step_before_retransmission
elif self.states.step == TransactionStep.SENDING_FILE_DATA:
self._handle_file_data_sent()
elif self.states.step == TransactionStep.SENDING_ACK_OF_FINISHED:
self.states.step = TransactionStep.NOTICE_OF_COMPLETION

def _handle_eof_sent(self, cancel_eof: bool) -> None:
if self.transmission_mode == TransmissionMode.ACKNOWLEDGED:
Expand Down
10 changes: 5 additions & 5 deletions tests/test_src_handler_acked.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _generic_acked_transfer_completion(
)
pdu_conf = eof_pdu.pdu_header.pdu_conf
self._insert_eof_ack_packet(eof_pdu)
self._insert_finished_pdu(pdu_conf)
self._insert_finished_pdu(pdu_conf, 1)
self._acknowledge_finished_pdu(pdu_conf)
self.source_handler.state_machine()
self._verify_transaction_finished_indication(transaction_id, expected_finished_params)
Expand All @@ -253,7 +253,7 @@ def _generic_acked_transfer_completion(
TransactionStep.IDLE,
)

def _insert_finished_pdu(self, pdu_conf: PduConfig):
def _insert_finished_pdu(self, pdu_conf: PduConfig, expected_num_of_packets: int):
finished_pdu = FinishedPdu(
pdu_conf,
FinishedParams(
Expand All @@ -265,9 +265,9 @@ def _insert_finished_pdu(self, pdu_conf: PduConfig):
self.source_handler.state_machine(finished_pdu)
self._state_checker(
None,
True,
CfdpState.BUSY,
TransactionStep.SENDING_ACK_OF_FINISHED,
expected_num_of_packets,
CfdpState.IDLE,
TransactionStep.IDLE,
)

def _verify_eof_pdu_for_positive_ack(self, expected_eof: EofPdu, expected_ack_counter: int):
Expand Down
Loading