Skip to content

Commit

Permalink
Add example of creating CFDP entities to docs (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
aywaldron committed May 17, 2019
1 parent 71738d5 commit fbfcbb1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ait/dsn/bin/ait_cfdp_start_receiver
Original file line number Diff line number Diff line change
Expand Up @@ -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...')
Expand Down
4 changes: 2 additions & 2 deletions ait/dsn/bin/ait_cfdp_start_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 22 additions & 3 deletions doc/source/ait_cfdp.rst
Original file line number Diff line number Diff line change
@@ -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 <https://public.ccsds.org/pubs/727x0b4.pdf>`_. An overview can be found in the AIT docs `here <https://ait-core.readthedocs.io/en/master/cfdp.html>`_. The implementation closely follows the `Implementer's Guide <https://public.ccsds.org/Pubs/720x2g3ec1.pdf>`_.

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 <https://public.ccsds.org/pubs/727x0b4.pdf>`_. The implementation closely follows the `Implementer's Guide <https://public.ccsds.org/Pubs/720x2g3ec1.pdf>`_.
Transmission Modes
^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit fbfcbb1

Please sign in to comment.