diff --git a/CHANGELOG.md b/CHANGELOG.md index 3706ced..43ef8fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/cfdppy/handler/source.py b/src/cfdppy/handler/source.py index 4a320bd..4ad24e0 100644 --- a/src/cfdppy/handler/source.py +++ b/src/cfdppy/handler/source.py @@ -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 @@ -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: @@ -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: diff --git a/tests/test_src_handler_acked.py b/tests/test_src_handler_acked.py index d1faef8..842827a 100644 --- a/tests/test_src_handler_acked.py +++ b/tests/test_src_handler_acked.py @@ -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) @@ -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( @@ -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):