4040 InvalidDestinationId ,
4141 InvalidPduDirection ,
4242 InvalidPduForDestHandler ,
43- NoRemoteEntityCfgFound ,
43+ NoRemoteEntityConfigFound ,
4444 PduIgnoredForDest ,
4545 PduIgnoredForDestReason ,
4646 UnretrievedPdusToBeSent ,
@@ -441,7 +441,7 @@ def _check_inserted_packet(self, packet: GenericPduPacket) -> None:
441441 if packet .dest_entity_id .value != self .cfg .local_entity_id .value :
442442 raise InvalidDestinationId (self .cfg .local_entity_id , packet .dest_entity_id )
443443 if self .remote_cfg_table .get_cfg (packet .source_entity_id ) is None :
444- raise NoRemoteEntityCfgFound (entity_id = packet .dest_entity_id )
444+ raise NoRemoteEntityConfigFound (entity_id = packet .dest_entity_id )
445445 if get_packet_destination (packet ) == PacketDestination .SOURCE_HANDLER :
446446 raise InvalidPduForDestHandler (packet )
447447 if (self .states .state == CfdpState .IDLE ) and (
@@ -514,12 +514,12 @@ def __idle_fsm(self, packet: GenericPduPacket | None) -> None:
514514 pdu_holder = PduHolder (packet )
515515 if pdu_holder .pdu_type == PduType .FILE_DATA :
516516 file_data_pdu = pdu_holder .to_file_data_pdu ()
517- self ._start_transaction_missing_metadata_recv_fd (file_data_pdu )
517+ self ._start_transaction_first_packet_file_data (file_data_pdu )
518518 else :
519519 assert pdu_holder .pdu_directive_type is not None
520520 if pdu_holder .pdu_directive_type == DirectiveType .EOF_PDU :
521521 eof_pdu = pdu_holder .to_eof_pdu ()
522- self ._start_transaction_missing_metadata_recv_eof (eof_pdu )
522+ self ._start_transaction_first_packet_eof (eof_pdu )
523523 elif pdu_holder .pdu_directive_type == DirectiveType .METADATA_PDU :
524524 metadata_pdu = pdu_holder .to_metadata_pdu ()
525525 self ._start_transaction (metadata_pdu )
@@ -584,7 +584,7 @@ def _handle_first_packet_not_metadata_pdu(self, packet: GenericPduPacket) -> Non
584584 packet ,
585585 )
586586
587- def _start_transaction_missing_metadata_recv_eof (self , eof_pdu : EofPdu ) -> None :
587+ def _start_transaction_first_packet_eof (self , eof_pdu : EofPdu ) -> None :
588588 self ._common_first_packet_not_metadata_pdu_handler (eof_pdu )
589589 self ._handle_eof_without_previous_metadata (eof_pdu )
590590
@@ -596,10 +596,7 @@ def _handle_eof_without_previous_metadata(self, eof_pdu: EofPdu) -> None:
596596 if self ._params .fp .progress > 0 :
597597 # Clear old list, deferred procedure for the whole file is now active.
598598 self ._params .acked_params .lost_seg_tracker .reset ()
599- # I will just wait until the metadata has been received with re-requesting the file
600- # data PDU. How does the standard expect me to process file data PDUs where I do not
601- # even know the filenames? How would I even generically do this? I will add the whole
602- # file to the lost segments map for now.
599+ # Add the whole file to the lost segments map for now.
603600 self ._params .acked_params .lost_seg_tracker .add_lost_segment ((0 , eof_pdu .file_size ))
604601 if self .cfg .indication_cfg .eof_recv_indication_required :
605602 assert self ._params .transaction_id is not None
@@ -622,9 +619,9 @@ def _eof_ack_pdu_done(self) -> None:
622619 self ._checksum_verify ()
623620 self .states .step = TransactionStep .TRANSFER_COMPLETION
624621
625- def _start_transaction_missing_metadata_recv_fd (self , fd_pdu : FileDataPdu ) -> None :
622+ def _start_transaction_first_packet_file_data (self , fd_pdu : FileDataPdu ) -> None :
626623 self ._common_first_packet_not_metadata_pdu_handler (fd_pdu )
627- self ._handle_fd_without_previous_metadata (fd_pdu )
624+ self ._handle_file_data_without_previous_metadata (fd_pdu )
628625
629626 def _handle_finished_pdu_sent (self ) -> None :
630627 if (
@@ -636,13 +633,10 @@ def _handle_finished_pdu_sent(self) -> None:
636633 return
637634 self ._reset_internal (False )
638635
639- def _handle_fd_without_previous_metadata (self , fd_pdu : FileDataPdu ) -> None :
636+ def _handle_file_data_without_previous_metadata (self , fd_pdu : FileDataPdu ) -> None :
640637 self ._params .fp .progress = fd_pdu .offset + len (fd_pdu .file_data )
641638 if len (fd_pdu .file_data ) > 0 :
642- # I will just wait until the metadata has been received with re-requesting the file
643- # data PDU. How does the standard expect me to process file data PDUs where I do not
644- # even know the filenames? How would I even generically do this?
645- # I will add this file segment (and all others which came before and might be missing
639+ # Add this file segment (and all others which came before and might be missing
646640 # as well) to the lost segment list.
647641 self ._params .acked_params .lost_seg_tracker .add_lost_segment (
648642 (0 , self ._params .fp .progress )
@@ -707,7 +701,7 @@ def _handle_metadata_packet(self, metadata_pdu: MetadataPdu) -> None:
707701 _LOGGER .warning (
708702 f"No remote configuration found for remote ID { metadata_pdu .dest_entity_id } "
709703 )
710- raise NoRemoteEntityCfgFound (metadata_pdu .dest_entity_id )
704+ raise NoRemoteEntityConfigFound (metadata_pdu .dest_entity_id )
711705 if not self ._params .fp .metadata_only :
712706 self .states .step = TransactionStep .RECEIVING_FILE_DATA
713707 self ._init_vfs_handling (Path (metadata_pdu .source_file_name ).name ) # type: ignore
@@ -760,7 +754,7 @@ def _handle_waiting_for_missing_metadata(self, packet_holder: PduHolder) -> None
760754 if packet_holder .pdu is None :
761755 return
762756 if packet_holder .pdu_type == PduType .FILE_DATA :
763- self ._handle_fd_without_previous_metadata (packet_holder .to_file_data_pdu ())
757+ self ._handle_file_data_without_previous_metadata (packet_holder .to_file_data_pdu ())
764758 elif packet_holder .pdu_directive_type == DirectiveType .METADATA_PDU :
765759 self ._handle_metadata_packet (packet_holder .to_metadata_pdu ())
766760 if self ._params .acked_params .deferred_lost_segment_detection_active :
0 commit comments