Skip to content

Commit 1f8d810

Browse files
fallbergmfalkvidd
authored andcommitted
Add documentation for MyCapabilities (#989)
Also fixed spelling error in the MySigning documentation. Fixes #902
1 parent d44ecd9 commit 1f8d810

File tree

4 files changed

+203
-5
lines changed

4 files changed

+203
-5
lines changed

MyConfig.h

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,14 @@
408408
* @{
409409
*/
410410

411+
/**
412+
* @def MY_RADIO_NRF5_ESB
413+
* @brief Define this to use nRF5 based radios for sensor network communication.
414+
*
415+
* @see ARDUINO_ARCH_NRF5
416+
*/
417+
//#define MY_RADIO_NRF5_ESB
418+
411419
/**
412420
* @def MY_NRF5_ESB_ENABLE_ENCRYPTION
413421
* @brief Define this to enable software based (RF24 compatible) %AES encryption.
@@ -527,6 +535,12 @@
527535
* @{
528536
*/
529537

538+
/**
539+
* @def MY_RADIO_RFM69
540+
* @brief Define this to use RFM69 based radios for sensor network communication.
541+
*/
542+
//#define MY_RADIO_RFM69
543+
530544
/**
531545
* @def MY_DEBUG_VERBOSE_RFM69
532546
* @brief Define this for verbose debug prints related to the %RFM69 driver.
@@ -750,6 +764,12 @@
750764
* @{
751765
*/
752766

767+
/**
768+
* @def MY_RADIO_RFM95
769+
* @brief Define this to use RFM95 based radios for sensor network communication.
770+
*/
771+
//#define MY_RADIO_RFM95
772+
753773
/**
754774
* @def MY_DEBUG_VERBOSE_RFM95
755775
* @brief Define this for verbose debug prints related to the RFM95 driver.
@@ -1802,6 +1822,42 @@
18021822
// Doxygen specific constructs, not included when built normally
18031823
// This is used to enable disabled macros/definitions to be included in the documentation as well.
18041824
#if DOXYGEN
1825+
/**
1826+
* @def ARDUINO_ARCH_SAMD
1827+
* @brief Automatically set when building for SAMD targets
1828+
*/
1829+
#define ARDUINO_ARCH_SAMD
1830+
1831+
/**
1832+
* @def ARDUINO_ARCH_NRF5
1833+
* @brief Automatically set when building for nRF5 targets
1834+
*/
1835+
#define ARDUINO_ARCH_NRF5
1836+
1837+
/**
1838+
* @def ARDUINO_ARCH_ESP8266
1839+
* @brief Automatically set when building for ESP8266 targets
1840+
*/
1841+
#define ARDUINO_ARCH_ESP8266
1842+
1843+
/**
1844+
* @def ARDUINO_ARCH_AVR
1845+
* @brief Automatically set when building for AVR targets
1846+
*/
1847+
#define ARDUINO_ARCH_AVR
1848+
1849+
/**
1850+
* @def ARDUINO_ARCH_STM32F1
1851+
* @brief Automatically set when building for STM32F1 targets
1852+
*/
1853+
#define ARDUINO_ARCH_STM32F1
1854+
1855+
/**
1856+
* @def TEENSYDUINO
1857+
* @brief Automatically set when building for Teensy targets
1858+
*/
1859+
#define TEENSYDUINO
1860+
18051861
// debug
18061862
#define MY_DEBUG
18071863
#define MY_DEBUG_OTA
@@ -1859,6 +1915,7 @@
18591915
#define MY_SIGNING_FEATURE
18601916
#define MY_ENCRYPTION_FEATURE
18611917
// RS485
1918+
#define MY_RS485
18621919
#define MY_RS485_HWSERIAL (Serial1)
18631920
// RF24
18641921
#define MY_RADIO_RF24
@@ -1869,11 +1926,13 @@
18691926
#define MY_RX_MESSAGE_BUFFER_FEATURE
18701927
#define MY_RX_MESSAGE_BUFFER_SIZE
18711928
// NRF5_ESB
1929+
#define MY_RADIO_NRF5_ESB
18721930
#define MY_NRF5_ESB_ENABLE_ENCRYPTION
18731931
#define MY_DEBUG_VERBOSE_NRF5_ESB
18741932
#define MY_NRF5_ESB_REVERSE_ACK_RX
18751933
#define MY_NRF5_ESB_REVERSE_ACK_TX
18761934
// RFM69
1935+
#define MY_RADIO_RFM69
18771936
#define MY_IS_RFM69HW
18781937
#define MY_RFM69_NEW_DRIVER
18791938
#define MY_RFM69_POWER_PIN
@@ -1885,6 +1944,7 @@
18851944
#define MY_DEBUG_VERBOSE_RFM69_REGISTERS
18861945
#define MY_RFM69_ENABLE_LISTENMODE
18871946
// RFM95
1947+
#define MY_RADIO_RFM95
18881948
#define MY_DEBUG_VERBOSE_RFM95
18891949
#define MY_RFM95_ATC_MODE_DISABLED
18901950
#define MY_RFM95_RST_PIN

MySensors.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,15 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
286286
#endif // __avr_atmega1280__, __avr_atmega1284__, __avr_atmega2560__
287287
#endif // ARDUINO_ARCH_AVR
288288
#endif
289+
#ifdef DOXYGEN
290+
/**
291+
* @def MY_RAM_ROUTING_TABLE_ENABLED
292+
* @brief Automatically set if RAM routing table is enabled
293+
*
294+
* @see MY_RAM_ROUTING_TABLE_FEATURE
295+
*/
296+
#define MY_RAM_ROUTING_TABLE_ENABLED
297+
#endif
289298

290299
// SOFTSPI
291300
#ifdef MY_SOFTSPI

core/MyCapabilities.h

Lines changed: 133 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,85 @@
1616
* modify it under the terms of the GNU General Public License
1717
* version 2 as published by the Free Software Foundation.
1818
*/
19-
19+
/**
20+
* @file MyCapabilities.h
21+
* @ingroup MyCapabilities
22+
*/
2023

2124
#ifndef MyCapabilities_h
2225
#define MyCapabilities_h
26+
/**
27+
* @defgroup MyCapabilities Node capabilities indicator
28+
* @ingroup MyConfigGrp
29+
*
30+
* @brief MySensors capabilities indications.
31+
*
32+
* At node startup, a capabilities string is shown as part of the initialization logs.
33+
* This string indicate what configuration the node is running with.
34+
*
35+
* The string symbols are ordered in the following way:
36+
* | Setting | Reset | Radio | OTA | Node | Architecture | Signing | Buffering | Encryption
37+
* |-----------|-------------------|-------------------|--------------------|------------------|------------------|------------------|-------------------|-----------------
38+
* | Indicator | @ref MY_CAP_RESET | @ref MY_CAP_RADIO | @ref MY_CAP_OTA_FW | @ref MY_CAP_TYPE | @ref MY_CAP_ARCH | @ref MY_CAP_SIGN | @ref MY_CAP_RXBUF | @ref MY_CAP_ENCR
39+
*
40+
* @see MY_CAPABILITIES
41+
*
42+
* @{
43+
*/
2344

2445
// Remote reset
46+
/**
47+
* @def MY_CAP_RESET
48+
* @brief Indicate the remote reset setting.
49+
*
50+
* @see MY_DISABLE_REMOTE_RESET
51+
*
52+
* | Setting | Indicator
53+
* |------------|----------
54+
* | Enabled | R
55+
* | Disabled | N
56+
*/
2557
#if defined(MY_DISABLE_REMOTE_RESET)
2658
#define MY_CAP_RESET "N"
2759
#else
2860
#define MY_CAP_RESET "R"
2961
#endif
3062

31-
// OTA firmware uodate feature
63+
// OTA firmware update feature
64+
/**
65+
* @def MY_CAP_OTA_FW
66+
* @brief Indicate the OTA update setting.
67+
*
68+
* @see MY_OTA_FIRMWARE_FEATURE
69+
*
70+
* | Setting | Indicator
71+
* |------------|----------
72+
* | Enabled | O
73+
* | Disabled | N
74+
*/
3275
#if defined(MY_OTA_FIRMWARE_FEATURE)
3376
#define MY_CAP_OTA_FW "O"
3477
#else
3578
#define MY_CAP_OTA_FW "N"
3679
#endif
3780

3881
// Transport
39-
#if defined(MY_RADIO_NRF24) || defined(MY_RADIO_NRF5_ESB)
82+
/**
83+
* @def MY_CAP_RADIO
84+
* @brief Indicate the type of transport selected.
85+
*
86+
* @see MY_RADIO_RF24, MY_RADIO_NRF5_ESB, MY_RADIO_RFM69, MY_RFM69_NEW_DRIVER, MY_RADIO_RFM95, MY_RS485
87+
*
88+
* | Radio | Indicator
89+
* |--------------|----------
90+
* | nRF24/nRF5 | N
91+
* | %RFM69 (old) | R
92+
* | %RFM69 (new) | P
93+
* | RFM95 | L
94+
* | RS485 | S
95+
* | None | -
96+
*/
97+
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB)
4098
#define MY_CAP_RADIO "N"
4199
#elif defined(MY_RADIO_RFM69)
42100
#if !defined(MY_RFM69_NEW_DRIVER)
@@ -55,6 +113,19 @@
55113
#endif
56114

57115
// Node type
116+
/**
117+
* @def MY_CAP_TYPE
118+
* @brief Indicate the type of node.
119+
*
120+
* @see MY_GATEWAY_FEATURE, MY_REPEATER_FEATURE, MY_PASSIVE_NODE
121+
*
122+
* | Node type | Indicator
123+
* |-----------|----------
124+
* | Gateway | G
125+
* | Repeater | R
126+
* | Passive | P
127+
* | Node | N
128+
*/
58129
#if defined(MY_GATEWAY_FEATURE)
59130
#define MY_CAP_TYPE "G"
60131
#elif defined(MY_REPEATER_FEATURE)
@@ -66,6 +137,23 @@
66137
#endif
67138

68139
// Architecture
140+
/**
141+
* @def MY_CAP_ARCH
142+
* @brief Indicate the architecture.
143+
*
144+
* @see ARDUINO_ARCH_SAMD, ARDUINO_ARCH_NRF5, ARDUINO_ARCH_ESP8266, ARDUINO_ARCH_AVR, ARDUINO_ARCH_STM32F1, TEENSYDUINO
145+
*
146+
* | Architecture | Indicator
147+
* |--------------|----------
148+
* | SAMD | S
149+
* | nRF5 | N
150+
* | ESP8266 | E
151+
* | AVR | A
152+
* | STM32F1 | F
153+
* | TEENSY | T
154+
* | Linux | L
155+
* | Unknown | -
156+
*/
69157
#if defined(ARDUINO_ARCH_SAMD)
70158
#define MY_CAP_ARCH "S"
71159
#elif defined(ARDUINO_ARCH_NRF5)
@@ -85,6 +173,18 @@
85173
#endif
86174

87175
// Signing
176+
/**
177+
* @def MY_CAP_SIGN
178+
* @brief Indicate the signing backend used.
179+
*
180+
* @see MY_SIGNING_ATSHA204, MY_SIGNING_SOFT
181+
*
182+
* | Signing backend | Indicator
183+
* |-----------------|----------
184+
* | ATSHA204 | A
185+
* | Software | S
186+
* | No signing | -
187+
*/
88188
#if defined(MY_SIGNING_ATSHA204)
89189
#define MY_CAP_SIGN "A"
90190
#elif defined(MY_SIGNING_SOFT)
@@ -94,20 +194,49 @@
94194
#endif
95195

96196
// RX queue
197+
/**
198+
* @def MY_CAP_RXBUF
199+
* @brief Indicate the rx message buffer setting.
200+
*
201+
* @see MY_RX_MESSAGE_BUFFER_FEATURE
202+
*
203+
* | Setting | Indicator
204+
* |------------|----------
205+
* | Enabled | Q
206+
* | Disabled | -
207+
*/
97208
#if defined(MY_RX_MESSAGE_BUFFER_FEATURE)
98209
#define MY_CAP_RXBUF "Q"
99210
#else
100211
#define MY_CAP_RXBUF "-"
101212
#endif
102213

103214
// Radio encryption
104-
#if defined(MY_RF24_ENABLE_ENCRYPTION) || defined(MY_RFM69_ENABLE_ENCRYPTION)
215+
/**
216+
* @def MY_CAP_ENCR
217+
* @brief Indicate the encryption setting.
218+
*
219+
* @see MY_RF24_ENABLE_ENCRYPTION, MY_RFM69_ENABLE_ENCRYPTION, MY_NRF5_ESB_ENABLE_ENCRYPTION
220+
*
221+
* | Setting | Indicator
222+
* |------------|----------
223+
* | Enabled | X
224+
* | Disabled | -
225+
*/
226+
#if defined(MY_RF24_ENABLE_ENCRYPTION) || defined(MY_RFM69_ENABLE_ENCRYPTION) || defined (MY_NRF5_ESB_ENABLE_ENCRYPTION)
105227
#define MY_CAP_ENCR "X"
106228
#else
107229
#define MY_CAP_ENCR "-"
108230
#endif
109231

110232

233+
/**
234+
* @def MY_CAPABILITIES
235+
* @brief This is the resulting capabilities string.
236+
*
237+
* @see MY_CAP_RESET, MY_CAP_RADIO, MY_CAP_OTA_FW, MY_CAP_TYPE, MY_CAP_ARCH, MY_CAP_SIGN, MY_CAP_RXBUF, MY_CAP_ENCR
238+
*/
111239
#define MY_CAPABILITIES MY_CAP_RESET MY_CAP_RADIO MY_CAP_OTA_FW MY_CAP_TYPE MY_CAP_ARCH MY_CAP_SIGN MY_CAP_RXBUF MY_CAP_ENCR
112240

241+
/** @}*/ // End of MyCapabilities group
113242
#endif /* MyCapabilities_h */

core/MySigning.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394
* That is enough to enable protection from both Eve and Mallory in your network
395395
* although if you do not also enable encryption, Eve can eavesdrop, but not do anything about,
396396
* your messages (except possibly preventing them from arriving). @ref MY_SIGNING_SIMPLE_PASSWD also
397-
* enable encryption autmatically.
397+
* enable encryption automatically.
398398
*
399399
* How are the messages actually affected by the signing?<br>
400400
* The following illustration shows what part of the message is signed, and where the signature is

0 commit comments

Comments
 (0)