Skip to content

Commit

Permalink
Documenting code and structure of the telecommands #90
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoria-b committed Aug 15, 2022
1 parent 9aca07e commit 7ce1dd1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Binary file added docs/img/ngham.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 32 additions & 1 deletion docs/telecommands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ Authentication
All the telecommands classified as private use an HMAC authentication scheme. Every
type of private telecommand has a unique 16-digit ASCII character key that with the
telecommand sequence (or message) generates an 160-bits (20-bytes) hash sequence to
be transmitted together with the packet payload. The used hash algorithm is the SHA-1.
be transmitted together with the packet payload. The used hash algorithm is the SHA-1. [3]_

.. image:: img/hmac.png
:width: 500

Telecommands
============
Expand Down Expand Up @@ -53,3 +56,31 @@ Telecommands
Structure of the packages
=========================

Every package payload countains its ID [1 byte], the source callsign (source address of the ground station) [7 bytes] and the package content (data) [up to 212 bytes]. This las tone can either have none or many parameters depending on the funtion of the telecommand.

The communication protocol used is a python variation of the NGHam [1]_: the PyNGHam [2]_.

.. image:: img/ngham.png
:width: 300

Telecommands Code
=================

The Spacelab Transmitter has a generic telecommand class with these functions:

- **generate**: which generate the telecommand payload;
- **set_id**: which sets a new ID for the telecommand;
- **get_id**: which gets the ID of the telecommand;
- **set_name**: which sets a new name for the telecommand;
- **get_name**: which gets the name of the telecommand;
- **_prepare_callsign**: which prepares a callsign for a transmission.

Each telecommand has its own class with the Telecommand class working as a "superclass" with 14 telecommands classes working as "subclasses" (this process is called "inheritance" in object-oriented programming).

References
==========


.. [1] https://github.com/skagmo/ngham
.. [2] https://github.com/mgm8/pyngham
.. [3] https://github.com/spacelab-ufsc/floripasat2-doc

0 comments on commit 7ce1dd1

Please sign in to comment.