Skip to content

Commit

Permalink
Updated documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfjlaros committed Feb 14, 2019
1 parent b2fc1c0 commit bbdca88
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/usage_device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ used for missing keys. All descriptions may be empty.
* - ``return``
- ``return``

To reduce the memory footprint, the use of the ``F()`` macro is allowed in the
``interface()`` function. This stores the documentation string in program
memory instead of SRAM. For more information, see the progmem_ documentation.

Example
^^^^^^^

Expand Down Expand Up @@ -146,3 +150,6 @@ Exporting this class method as a remote call goes as follows:
pack(&led, &LED::setBrightness),
"set_led: Set LED brightness. @brightness: Brightness.");
}
.. _progmem: https://www.arduino.cc/reference/en/language/variables/utilities/progmem/
26 changes: 26 additions & 0 deletions docs/usage_host.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,32 @@ Additionally, the ``with`` statement is supported for easy opening and closing.
>>> with Interface('/dev/ttyACM0') as interface:
>>> interface.version()
The class instance has a public member variable named ``methods`` which
contains the definitions of the exported methods.

.. code:: python
>>> interface.methods.keys()
dict_keys(['inc', 'set_led'])
>>> interface.methods['inc']
{
'return': {
'doc': 'a + 1.',
'fmt': '<h',
'typename': 'int'},
'doc': 'Increment a value.',
'name': 'inc',
'index': 2,
'parameters': [
{
'doc': 'Value.',
'name': 'a',
'fmt': '<h',
'typename': 'int'
}
]
}
Example
^^^^^^^

Expand Down

0 comments on commit bbdca88

Please sign in to comment.