microservices/CFDP/app/models/cfdp_source_transaction.rb in openc3-cosmos-cfdp-1.0.0 vs microservices/CFDP/app/models/cfdp_source_transaction.rb in openc3-cosmos-cfdp-1.0.1

- old
+ new

@@ -94,11 +94,11 @@ if @state != "SUSPENDED" if @eof_ack_timeout and Time.now > @eof_ack_timeout and @destination_entity['enable_acks'] # Resend eof pdu cmd_params = {} cmd_params[@item_name] = @eof_pdu - cmd(@target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) + cfdp_cmd(@destination_entity, @target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) @eof_count += 1 if @eof_count > @destination_entity['ack_timer_expiration_limit'] # Positive ACK Limit Reached Fault @condition_code = "ACK_LIMIT_REACHED" handle_fault() @@ -204,11 +204,11 @@ options: options, segmentation_control: @segmentation_control, transmission_mode: @transmission_mode) cmd_params = {} cmd_params[@item_name] = @metadata_pdu - cmd(@target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) + cfdp_cmd(@destination_entity, @target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) if source_file checksum = get_checksum(@destination_entity['default_checksum_type']) unless checksum # Unsupported algorithm - Use modular instead @@ -234,11 +234,11 @@ destination_entity: @destination_entity, segmentation_control: @segmentation_control, transmission_mode: @transmission_mode) cmd_params = {} cmd_params[@item_name] = file_data_pdu - cmd(@target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) + cfdp_cmd(@destination_entity, @target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) checksum.add(offset, file_data) offset += file_data.length @progress = offset end end @@ -269,11 +269,11 @@ segmentation_control: @segmentation_control, transmission_mode: @transmission_mode, canceling_entity_id: @canceling_entity_id) cmd_params = {} cmd_params[@item_name] = @eof_pdu - cmd(@target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) + cfdp_cmd(@destination_entity, @target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) rescue => err abandon() if @canceling_entity_id raise err end @@ -325,10 +325,11 @@ end end end @state = "FINISHED" unless @state == "CANCELED" or @state == "ABANDONED" @transaction_status = "TERMINATED" + @complete_time = Time.now.utc OpenC3::Logger.info("CFDP Finished Source Transaction #{@id}, #{@condition_code}", scope: ENV['OPENC3_SCOPE']) if CfdpMib.source_entity['transaction_finished_indication'] if @filestore_responses.length > 0 CfdpTopic.write_indication("Transaction-Finished", @@ -367,11 +368,11 @@ condition_code: @finished_pdu_hash["CONDITION_CODE"], ack_directive_code: "FINISHED", transaction_status: @transaction_status) cmd_params = {} cmd_params[@item_name] = ack_pdu - cmd(@target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) + cfdp_cmd(@destination_entity, @target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) end when "ACK" # EOF Ack @eof_ack_pdu_hash = pdu_hash @@ -410,11 +411,11 @@ if start_offset == 0 and end_offset == 0 # Send Metadata PDU cmd_params = {} cmd_params[@item_name] = @metadata_pdu - cmd(@target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) + cfdp_cmd(@destination_entity, @target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) else # Send File Data PDU(s) offset = start_offset source_file.seek(offset, IO::SEEK_SET) while true @@ -436,10 +437,10 @@ destination_entity: @destination_entity, segmentation_control: @segmentation_control, transmission_mode: @transmission_mode) cmd_params = {} cmd_params[@item_name] = file_data_pdu - cmd(@target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) + cfdp_cmd(@destination_entity, @target_name, @packet_name, cmd_params, scope: ENV['OPENC3_SCOPE']) offset += file_data.length end end end