Skip to content

Commit a62d9d7

Browse files
authored
Merge pull request #483 from tekka007/transportUpdate
TransportProcess cleanup
2 parents 244f797 + 26044e1 commit a62d9d7

17 files changed

+1046
-594
lines changed

libraries/MySensors/MyConfig.h

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

84+
/**
85+
* @def MY_REGISTRATION_FEATURE
86+
* @brief If enabled, node has to register to gateway/controller before allowed to send sensor data.
87+
*/
88+
#define MY_REGISTRATION_FEATURE
89+
90+
/**
91+
* @def MY_REGISTRATION_RETRIES
92+
* @brief Number of registration retries if no reply received from GW/controller
93+
*/
94+
95+
#ifndef MY_REGISTRATION_RETRIES
96+
#define MY_REGISTRATION_RETRIES 3
97+
#endif
98+
99+
/**
100+
* @def MY_REGISTRATION_DEFAULT
101+
* @brief Node registration default - this applies if no registration response is recieved from controller
102+
*/
103+
104+
#define MY_REGISTRATION_DEFAULT true
105+
106+
/**
107+
* @def MY_REGISTRATION_CONTROLLER
108+
* @brief If enabled, node registration request has to be handled by controller
109+
*/
110+
// #define MY_REGISTRATION_CONTROLLER
111+
112+
/**
113+
* @def MY_CORE_COMPATIBILITY_CHECK
114+
* @brief If enabled, library compatibility is checked during node registration. Incompatible libraries are unable to send sensor data.
115+
*/
116+
#define MY_CORE_COMPATIBILITY_CHECK
117+
84118
/**
85119
* @def MY_NODE_ID
86120
* @brief Node id defaults to AUTO (tries to fetch id from controller).
@@ -97,6 +131,12 @@
97131
#define MY_PARENT_NODE_ID AUTO
98132
#endif
99133

134+
/**
135+
* @def MY_PARENT_NODE_IS_STATIC
136+
* @brief Enable MY_PARENT_NODE_IS_STATIC to disable fall back if parent node fails
137+
*/
138+
//#define MY_PARENT_NODE_IS_STATIC
139+
100140
// Enables repeater functionality (relays messages from other nodes)
101141
// #define MY_REPEATER_FEATURE
102142

@@ -646,4 +686,6 @@
646686
#define MY_SIGNING_REQUEST_SIGNATURES
647687
#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
648688
#define MY_IS_RFM69HW
689+
#define MY_PARENT_NODE_IS_STATIC
690+
#define MY_DEBUG_VERBOSE_RF24
649691
#endif

libraries/MySensors/MySensors.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@
172172
#endif
173173

174174

175+
// FLASH
176+
#if defined(MY_OTA_FIRMWARE_FEATURE)
177+
#include "drivers/SPIFlash/SPIFlash.cpp"
178+
#include "core/MyOTAFirmwareUpdate.cpp"
179+
#endif
175180

176181
// GATEWAY - TRANSPORT
177182
#if defined(MY_GATEWAY_MQTT_CLIENT)
@@ -245,11 +250,6 @@
245250
#include "drivers/AVR/DigitalIO/DigitalIO.h"
246251
#endif
247252

248-
// FLASH
249-
#ifdef MY_OTA_FIRMWARE_FEATURE
250-
#include "drivers/SPIFlash/SPIFlash.cpp"
251-
#include "core/MyOTAFirmwareUpdate.cpp"
252-
#endif
253253
#include "core/MyTransport.cpp"
254254
#if (defined(MY_RADIO_NRF24) && defined(MY_RADIO_RFM69)) || (defined(MY_RADIO_NRF24) && defined(MY_RS485)) || (defined(MY_RADIO_RFM69) && defined(MY_RS485))
255255
#error Only one forward link driver can be activated

libraries/MySensors/core/MyGatewayTransport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "MyGatewayTransport.h"
2121

22-
extern boolean transportSendRoute(MyMessage &message);
22+
extern bool transportSendRoute(MyMessage &message);
2323
extern MyMessage _msg;
2424

2525
inline void gatewayTransportProcess() {

libraries/MySensors/core/MyInclusionMode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* The MySensors Arduino library handles the wireless radio link and protocol
33
* between your home built sensors/actuators and HA controller of choice.
44
* The sensors forms a self healing radio network with optional repeaters. Each

libraries/MySensors/core/MyIndication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* The MySensors Arduino library handles the wireless radio link and protocol
33
* between your home built sensors/actuators and HA controller of choice.
44
* The sensors forms a self healing radio network with optional repeaters. Each

libraries/MySensors/core/MyIndication.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*
22
* The MySensors Arduino library handles the wireless radio link and protocol
33
* between your home built sensors/actuators and HA controller of choice.
44
* The sensors forms a self healing radio network with optional repeaters. Each
@@ -34,6 +34,8 @@ typedef enum {
3434
INDICATION_GOT_PARENT, //!< Found parent node.
3535
INDICATION_REQ_NODEID, //!< Request node ID.
3636
INDICATION_GOT_NODEID, //!< Got a node ID.
37+
INDICATION_REQ_REGISTRATION, //!< Request node registration.
38+
INDICATION_GOT_REGISTRATION, //!< Got registration reponse.
3739
INDICATION_REBOOT, //!< Rebooting node.
3840
INDICATION_PRESENT, //!< Presenting node to gateway.
3941
INDICATION_CLEAR_ROUTING, //!< Clear rrouting table requested.

libraries/MySensors/core/MyMessage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ typedef enum {
188188
I_LOCKED = 23, //!< Node is locked (reason in string-payload)
189189
I_PING = 24, //!< Ping sent to node, payload incremental hop counter
190190
I_PONG = 25, //!< In return to ping, sent back to sender, payload incremental hop counter
191-
I_REGISTER_REQUEST = 26, //!< Register request to GW
192-
I_REGISTER_RESPONSE = 27, //!< Register response from GW
191+
I_REGISTRATION_REQUEST = 26, //!< Register request to GW
192+
I_REGISTRATION_RESPONSE = 27, //!< Register response from GW
193193
I_DEBUG = 28 //!< Debug message
194194
} mysensor_internal;
195195

0 commit comments

Comments
 (0)