Skip to content

Commit

Permalink
more doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Oct 31, 2021
1 parent 55e9032 commit 0c41d05
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 44 deletions.
38 changes: 22 additions & 16 deletions RF24Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
* a NETWORK_ACK is not required. This is because the radio's auto-ack feature is utilized for
* connections between directly related network nodes. For example: nodes `01` and `011` use the
* radio's auto-ack feature for transmissions between them, but nodes `01` and `02` do not use
* the radio's auto-ack feature for transmissions between them.
* the radio's auto-ack feature for transmissions between them as messages will be routed through
* other nodes.
* @par
* Multicasted messages do use the radio's auto-ack feature because of the hardware limitations of
* nRF24L01 transceivers. This applies to all multicasted messages (directly related nodes or
Expand Down Expand Up @@ -395,9 +396,9 @@ class RF24Network
* location of the node within [RF24Network topology](md_docs_tuning.html).
*
* @note Node addresses are specified in Octal format, see
* [RF24Network Addressing](md_docs_addressing.html) for more information.
* [RF24Network Addressing](md_docs_addressing.html) for more information. The address `04444`
* is reserved for RF24Mesh usage (when a mesh node is connecting to the network).
* @warning Be sure to first call `RF24::begin()` to initialize the radio properly.
* @note The address `04444` is reserved for RF24Mesh usage (when a mesh node is connecting to the network).
*
* **Example 1:** Begin on current radio channel with address 0 (master node)
* @code network.begin(00); @endcode
Expand Down Expand Up @@ -817,9 +818,10 @@ class RF24Network
uint8_t _multicast_level;
#endif
/**
* Logical node address of this unit, typically in range [0, 2,925] (that's [0, 05555] in octal).
* @note The values 0 represents the network master node. Additionally,
* the value 1 is occupied when using RF24Ethernet layer.
* Logical node address of this unit, typically in range [0, 2925] (that's [0, 05555] in
* octal).
* @note The values 0 represents the network master node. Additionally, the value 1 is occupied
* when using RF24Ethernet layer.
*/
uint16_t node_address;

Expand All @@ -842,7 +844,7 @@ class RF24Network
* on the outgoing message's type). NETWORK ACK messages are served to message types in range [65, 191]
* (excluding message fragments that aren't the last fragment of the message).
*/
bool write(uint16_t, uint8_t sendType);
bool write(uint16_t to_node, uint8_t sendType);

/**
* @brief The last stage an outgoing frame reaches (actual/inital transmission is done here).
Expand Down Expand Up @@ -882,9 +884,12 @@ class RF24Network

struct logicalToPhysicalStruct
{
uint16_t send_node; /* the immediate destination (1 hop) of an outgoing frame */
uint8_t send_pipe; /* the pipe number of the `send_node` for which outgoing packets are aimed at */
bool multicast; /* flag to indicate that the outgoing frame does not want an auto-ack from `send_node` */
/** The immediate destination (1 hop) of an outgoing frame */
uint16_t send_node;
/** The pipe number of the `send_node` for which outgoing packets are aimed at */
uint8_t send_pipe;
/** A flag to indicate that the outgoing frame does not want an auto-ack from `send_node` */
bool multicast;
};

/*
Expand Down Expand Up @@ -956,16 +961,16 @@ class RF24Network
/**
* @example helloworld_tx.ino
*
* Simplest possible example of using RF24Network. Put this sketch
* on one node, and helloworld_rx.pde on the other. Tx will send
* Simplest possible example of using RF24Network. Put this sketch
* on one node, and helloworld_rx.pde on the other. Tx will send
* Rx a nice message every 2 seconds which rx will print out for us.
*/

/**
* @example helloworld_rx.ino
*
* Simplest possible example of using RF24Network. Put this sketch
* on one node, and helloworld_tx.pde on the other. Tx will send
* Simplest possible example of using RF24Network. Put this sketch
* on one node, and helloworld_tx.pde on the other. Tx will send
* Rx a nice message every 2 seconds which rx will print out for us.
*/

Expand All @@ -978,6 +983,7 @@ class RF24Network

/**
* @example helloworld_rx_advanced.ino
*
* A more advanced version of helloworld_rx using fragmentation/reassembly
* and variable payload sizes
*/
Expand Down Expand Up @@ -1006,9 +1012,9 @@ class RF24Network
* to go back to sleep immediately.
* The displayed millis() count will give an indication of how much a node has been sleeping compared to the others, as millis() will
* not increment while a node sleeps.
*<br>
*
* - Using this sketch, each node will send a ping to every other node in the network every few seconds.<br>
* - The RF24Network library will route the message across the mesh to the correct node.<br>
* - The RF24Network library will route the message across the mesh to the correct node.
*/

/**
Expand Down
21 changes: 11 additions & 10 deletions docs/addressing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ See the [Topology and Overview](md_docs_tuning.html) page for more info regardin

## Decimal, Octal and Binary formats

Say we want to designate a logical address to a node, using a tree topology as defined by the manufacturer.
In the simplest format, we could assign the first node the address of 1, the second 2 and so on.
Since a single node can only connect to 6 other nodes (1 parent and 5 children) subnets need to be created if using more than 6 nodes.<br>
In this case the:
Say we want to designate a logical address to a node, using a tree topology as defined by the
manufacturer. In the simplest format, we could assign the first node the address of 1, the second
2, and so on. Since a single node can only connect to 6 other nodes (1 parent and 5 children)
subnets need to be created if using more than 6 nodes. In this case, the

- children of node 1 could simply be designated as 011, 021, 031, 041, and 051
- children of node 2 could be designated as 012, 022, 032, 042, and 052
- children of node 1 could simply be designated as 11, 21, 31, 41, and 51
- children of node 2 could be designated as 12, 22, 32, 42, and 52

The above example is exactly how RF24Network manages the addresses, but they are represented in Octal format.

Expand All @@ -34,8 +34,9 @@ The above example is exactly how RF24Network manages the addresses, but they are
| 73 | 0111 | 01001001 |
| 111 | 0157 | 01101111 |

Since the numbers 0-7 can be represented in exactly three bits, each digit is represented by exactly 3 bits when viewed in octal format.
This allows a very simple method of managing addresses via masking and bit shifting.
Since the numbers 0-7 can be represented in exactly three bits, each digit is represented by
exactly 3 bits when viewed in octal format. This allows a very simple method of managing addresses
via masking and bit shifting.

## Displaying Addresses

Expand All @@ -54,5 +55,5 @@ printf("0%o\n", address);
```
@see
- [cplusplus.com tutorial](http://www.cplusplus.com/doc/hex/) for more information number bases.
- the [Topology and Overview page](md_docs_tuning.html) for more information regarding network topology.
- [This cplusplus.com tutorial](http://www.cplusplus.com/doc/hex/) for more information number bases.
- The [Topology and Overview page](md_docs_tuning.html) for more information regarding network topology.
18 changes: 18 additions & 0 deletions docs/sphinx/classRF24Network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,21 @@ Configuration API
.. doxygenvariable:: RF24Network::routeTimeout
.. doxygenfunction:: RF24Network::multicastLevel
.. doxygenfunction:: RF24Network::setup_watchdog

External Applications/Systems
=============================

Interface for External Applications and Systems (RF24Mesh, RF24Ethernet)

.. doxygenvariable:: RF24Network::frame_buffer
.. doxygenvariable:: RF24Network::external_queue
.. doxygenvariable:: RF24Network::frag_ptr
.. doxygenvariable:: RF24Network::returnSysMsgs
.. doxygenvariable:: RF24Network::networkFlags

Protected Members
-----------------
These members are accessible by RF24Network derivatives.

.. doxygenvariable:: RF24Network::_multicast_level
.. doxygenvariable:: RF24Network::node_address
16 changes: 16 additions & 0 deletions docs/sphinx/examples/Arduino/Network_Ping_Sleep.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
Network_Ping_Sleep.ino
==========================

This example demonstrates how nodes on the network utilize sleep mode to conserve power. For example,
the radio itself will draw about 13.5mA in receive mode. In sleep mode, it will use as little as 22ua (.000022mA)
of power when not actively transmitting or receiving data. In addition, the Arduino is powered down as well,
dropping network power consumption dramatically compared to previous capabilities.

.. note::
Sleeping nodes generate traffic that will wake other nodes up. This may be mitigated with further modifications. Sleep
payloads are currently always routed to the master node, which will wake up intermediary nodes. Routing nodes can be configured
to go back to sleep immediately.

The displayed ``millis()`` count will give an indication of how much a node has been sleeping compared to the others, as ``millis()`` will
not increment while a node sleeps.

- Using this sketch, each node will send a ping to every other node in the network every few seconds.<br>
- The RF24Network library will route the message across the mesh to the correct node.

.. literalinclude:: ../../../../examples/Network_Ping_Sleep/Network_Ping_Sleep.ino
:linenos:
17 changes: 0 additions & 17 deletions docs/sphinx/external_api.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Site Index
classRF24Network
net_payload_structs
RF24Network__config_8h
external_api
deprecated


Expand Down

0 comments on commit 0c41d05

Please sign in to comment.