diff --git a/ait/dsn/bin/ait_cfdp_start_receiver b/ait/dsn/bin/ait_cfdp_start_receiver index 5a772e5..3b2faf5 100755 --- a/ait/dsn/bin/ait_cfdp_start_receiver +++ b/ait/dsn/bin/ait_cfdp_start_receiver @@ -25,8 +25,8 @@ if __name__ == '__main__': cfdp = ait.dsn.cfdp.CFDP(2) try: - # cfdp.connect(('127.0.0.1', 8002)) - # # Set the address of the counterpart + cfdp.connect(('127.0.0.1', 8002)) + # Set the address of the counterpart # cfdp.mib.set_remote('1', 'ut_address', ('127.0.0.1', 8001)) while True: # ait.core.log.info('Sleeping...') diff --git a/ait/dsn/bin/ait_cfdp_start_sender.py b/ait/dsn/bin/ait_cfdp_start_sender.py index 51d02be..d4e0e5f 100755 --- a/ait/dsn/bin/ait_cfdp_start_sender.py +++ b/ait/dsn/bin/ait_cfdp_start_sender.py @@ -25,8 +25,8 @@ if __name__ == '__main__': cfdp = ait.dsn.cfdp.CFDP(1) try: - # cfdp.connect(('127.0.0.1', 9001)) - # # Set address of counterpart + cfdp.connect(('127.0.0.1', 9001)) + # Set address of counterpart # cfdp.mib.set_remote('2', 'ut_address', ('127.0.0.1', 9002)) destination_id = 2 diff --git a/doc/source/ait_cfdp.rst b/doc/source/ait_cfdp.rst index 31751ba..db7061d 100644 --- a/doc/source/ait_cfdp.rst +++ b/doc/source/ait_cfdp.rst @@ -1,7 +1,26 @@ -AIT's CFDP Implementation -========================= +AIT CFDP User Guide +==================== + +This user guide for AIT's CFDP implementation assumes some familiarity with the `CFDP standard `_. An overview can be found in the AIT docs `here `_. The implementation closely follows the `Implementer's Guide `_. + +Creating a CFDP Entity +^^^^^^^^^^^^^^^^^^^^^^ +CFDP entities are implemented by the :mod:`ait.dsn.cfdp.cfdp.CFDP` class. CFDP entities must be instantiated with an entity ID. To connect an entity to a socket, call the ``connect`` method of the CFDP object, passing in the a tuple of the host and port to connect to (example below). The ``put`` method can be used to initiate a transaction with destination ID, source path, destination path, and optional transmission mode parameters (example below). More complete examples can be found in **ait/dsn/bin**. + +.. code-block:: python + + import ait.dsn.cfdp + from ait.dsn.cfdp.primitives import TransmissionMode + + cfdp = ait.dsn.cfdp.CFDP(1) + + cfdp.connect(('127.0.0.1', 9001)) + + cfdp.put(2, 'path/to/sourcefile', 'path/to/destfile', transmission_mode=TransmissionMode.NO_ACK) + + cfdp.disconnect() + -This documentation of AIT's CFDP implementation assumes some familiarity with the `CFDP standard `_. The implementation closely follows the `Implementer's Guide `_. Transmission Modes ^^^^^^^^^^^^^^^^^^