Skip to content

Commit 751a5dc

Browse files
authored
Fix possible transport deadlock, add sanity check (#500)
1 parent 77bb94c commit 751a5dc

File tree

10 files changed

+212
-95
lines changed

10 files changed

+212
-95
lines changed

libraries/MySensors/MyConfig.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@
8181
//#define MY_RADIO_RFM69
8282
//#define MY_RS485
8383

84+
/**
85+
* @def MY_TRANSPORT_SANITY_CHECK
86+
* @brief If enabled, node will check transport in regular intervals to detect HW issues and re-initialize in case of failure. This feature is enabled for all repeater nodes (incl. GW)
87+
*/
88+
//#define MY_TRANSPORT_SANITY_CHECK
89+
/**
90+
* @def MY_TRANSPORT_SANITY_CHECK_INTERVAL
91+
* @brief Interval (in ms) of transport sanity checks
92+
*/
93+
#ifndef MY_TRANSPORT_SANITY_CHECK_INTERVAL
94+
#define MY_TRANSPORT_SANITY_CHECK_INTERVAL ((uint32_t)60000)
95+
#endif
8496
/**
8597
* @def MY_REGISTRATION_FEATURE
8698
* @brief If enabled, node has to register to gateway/controller before allowed to send sensor data.
@@ -687,5 +699,6 @@
687699
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
688700
#define MY_IS_RFM69HW
689701
#define MY_PARENT_NODE_IS_STATIC
702+
#define MY_REGISTRATION_CONTROLLER
690703
#define MY_DEBUG_VERBOSE_RF24
691704
#endif

libraries/MySensors/core/MyIndication.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ typedef enum {
4646

4747
INDICATION_ERR_START = 100,
4848
INDICATION_ERR_TX, //!< Failed to transmit message.
49+
INDICATION_ERR_TRANSPORT_FAILURE, //!< Transport failure.
4950
INDICATION_ERR_INIT_TRANSPORT, //!< MySensors transport hardware (radio) init failure.
5051
INDICATION_ERR_FIND_PARENT, //!< Failed to find parent node.
5152
INDICATION_ERR_GET_NODEID, //!< Failed to receive node ID.

0 commit comments

Comments
 (0)