Reticulum/docs/manual/_sources/examples.rst.txt

128 lines
3.5 KiB
Plaintext
Raw Normal View History

2021-05-16 21:40:49 +00:00
.. _examples-main:
2021-09-25 21:22:33 +00:00
*************
Code Examples
*************
2021-05-16 21:40:49 +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.
.. _example-minimal:
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 12:10:47 +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:40:49 +00:00
.. _example-announce:
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 12:10:47 +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:40:49 +00:00
.. _example-broadcast:
Broadcast
=========
The *Broadcast* example explores how to transmit plaintext broadcast messages
over the network.
2021-05-17 12:10:47 +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:40:49 +00:00
.. _example-echo:
Echo
====
The *Echo* example demonstrates communication between two destinations using
the Packet interface.
2021-05-17 12:10:47 +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 21:40:49 +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 12:10:47 +00:00
.. literalinclude:: ../../Examples/Link.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Link.py>`_.
2021-08-19 12:11:22 +00:00
.. _example-identify:
Identification
==============
The *Identify* example explores identifying an intiator of a link, once
the link has been established.
.. literalinclude:: ../../Examples/Identify.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Identify.py>`_.
2021-08-20 21:29:06 +00:00
.. _example-request:
Requests & Responses
====================
The *Request* example explores sendig requests and receiving responses.
.. literalinclude:: ../../Examples/Request.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Request.py>`_.
2023-03-02 11:47:55 +00:00
.. _example-channel:
Channel
=======
The *Channel* example explores using a ``Channel`` to send structured
data between peers of a ``Link``.
.. literalinclude:: ../../Examples/Channel.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Channel.py>`_.
2023-03-03 21:16:13 +00:00
Buffer
======
The *Buffer* example explores using buffered readers and writers to send
binary data between peers of a ``Link``.
.. literalinclude:: ../../Examples/Buffer.py
This example can also be found at `<https://github.com/markqvist/Reticulum/blob/master/Examples/Buffer.py>`_.
2021-05-16 21:40:49 +00:00
.. _example-filetransfer:
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 12:10:47 +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>`_.