Reticulum/docs/source/examples.rst

82 lines
2.4 KiB
ReStructuredText
Raw Normal View History

2021-05-16 19:58:11 +00:00
.. _examples-main:
2021-05-16 17:18:21 +00:00
********
Examples
********
2021-05-16 19:58:11 +00:00
A number of examples are included in the source distribution of Reticulum.
You can use these examples to learn how to write your own programs.
2021-05-16 21:13:56 +00:00
.. _example-minimal:
2021-05-16 19:58:11 +00:00
Minimal
=======
The *Minimal* example demonstrates the bare-minimum setup required to connect to
a Reticulum network from your program. In about five lines of code, you will
have the Reticulum Network Stack initialised, and ready to pass traffic in your
program.
2021-05-17 09:32:00 +00:00
.. literalinclude:: ../../Examples/Minimal.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Minimal.py>`_.
2021-05-16 21:13:56 +00:00
.. _example-announce:
2021-05-16 19:58:11 +00:00
Announce
========
The *Announce* example builds upon the previous example by exploring how to
announce a destination on the network, and how to let your program receive
notifications about announces from relevant destinations.
2021-05-17 09:32:00 +00:00
.. literalinclude:: ../../Examples/Announce.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Announce.py>`_.
2021-05-16 21:13:56 +00:00
.. _example-broadcast:
2021-05-16 19:58:11 +00:00
Broadcast
=========
The *Broadcast* example explores how to transmit plaintext broadcast messages
over the network.
2021-05-17 09:32:00 +00:00
.. literalinclude:: ../../Examples/Broadcast.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Broadcast.py>`_.
2021-05-16 21:13:56 +00:00
.. _example-echo:
2021-05-16 19:58:11 +00:00
Echo
====
The *Echo* example demonstrates communication between two destinations using
the Packet interface.
2021-05-17 09:32:00 +00:00
.. literalinclude:: ../../Examples/Echo.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Echo.py>`_.
2021-05-16 19:58:11 +00:00
.. _example-link:
Link
====
The *Link* example explores establishing an encrypted link to a remote
destination, and passing traffic back and forth over the link.
2021-05-17 09:32:00 +00:00
.. literalinclude:: ../../Examples/Link.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Link.py>`_.
2021-05-16 21:13:56 +00:00
.. _example-filetransfer:
2021-05-16 19:58:11 +00:00
Filetransfer
============
The *Filetransfer* example implements a basic file-server program that
allow clients to connect and download files. The program uses the Resource
2021-05-17 09:32:00 +00:00
interface to efficiently pass files of any size over a Reticulum :ref:`Link<api-link>`.
.. literalinclude:: ../../Examples/Filetransfer.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Filetransfer.py>`_.