Skip to content

Commit 069a713

Browse files
committed
Add PJON transport layer
1 parent 1fa4728 commit 069a713

File tree

117 files changed

+15174
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+15174
-5
lines changed

.ci/doxygen.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def call(config) {
66
Documentation/doxygen.sh"""
77
warnings canComputeNew: false, canResolveRelativePaths: false,
88
defaultEncoding: '',
9-
excludePattern: '''.*/hal/architecture/Linux/drivers/.*,.*/hal/architecture/AVR/drivers/.*,.*/drivers/TinyGSM/.*''',
9+
excludePattern: '''.*/hal/architecture/Linux/drivers/.*,.*/hal/transport/PJON/driver/.*,.*/hal/architecture/AVR/drivers/.*,.*/drivers/TinyGSM/.*''',
1010
failedTotalAll: '', healthy: '', includePattern: '', messagesPattern: '',
1111
parserConfigurations: [[parserName: 'Doxygen', pattern: config.repository_root+'doxygen.log']],
1212
unHealthy: '', unstableTotalAll: '0'

MyConfig.h

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,53 @@
198198
* @{
199199
*/
200200

201+
/**
202+
* @defgroup PJONSettingGrpPub PJON
203+
* @ingroup RadioSettingGrpPub
204+
* @brief These options are specific to the PJON wired transport.
205+
* @{
206+
*/
207+
208+
/**
209+
* @def MY_PJON
210+
* @brief Define this to use the PJON wired transport for sensor network communication.
211+
*/
212+
//#define MY_PJON
213+
214+
/**
215+
* @def MY_PJON_PIN
216+
* @brief Define this to change pin for PJON communication
217+
*/
218+
#ifndef MY_PJON_PIN
219+
#define MY_PJON_PIN (12u)
220+
#endif
221+
222+
/**
223+
* @def MY_DEBUG_VERBOSE_PJON
224+
* @brief Define this for verbose debug prints related to the %PJON driver.
225+
*/
226+
//#define MY_DEBUG_VERBOSE_PJON
227+
228+
/**
229+
* @def MY_PJON_MAX_RETRIES
230+
* @brief Define this to change max send retry in PJON communication
231+
*/
232+
#ifndef MY_PJON_MAX_RETRIES
233+
#define MY_PJON_MAX_RETRIES (5u)
234+
#endif
235+
236+
#ifdef MY_PJON
237+
238+
#ifndef PJON_STRATEGY_ALL
239+
#define PJON_STRATEGY_BITBANG
240+
#endif
241+
242+
#define PJON_NOT_ASSIGNED (253u)
243+
#define PJON_BROADCAST (255u)
244+
245+
#define SWBB_MAX_ATTEMPTS (50u)
246+
#define PJON_INCLUDE_SWBB
247+
#endif
201248

202249
/**
203250
* @defgroup RS485SettingGrpPub RS485
@@ -2103,7 +2150,7 @@
21032150
#endif
21042151

21052152
// Enable sensor network "feature" if one of the transport types was enabled
2106-
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485)
2153+
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) || defined(MY_PJON)
21072154
#define MY_SENSOR_NETWORK
21082155
#endif
21092156

@@ -2296,6 +2343,9 @@
22962343
// RS485
22972344
#define MY_RS485
22982345
#define MY_RS485_HWSERIAL
2346+
// PJON
2347+
#define MY_PJON
2348+
#define MY_DEBUG_VERBOSE_PJON
22992349
// RF24
23002350
#define MY_RADIO_RF24
23012351
#define MY_RADIO_NRF24 //deprecated

MySensors.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,13 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
285285
#else
286286
#define __RS485CNT 0 //!< __RS485CNT
287287
#endif
288+
#if defined(MY_PJON)
289+
#define _PJONCNT 1 //!< _PJONCNT
290+
#else
291+
#define _PJONCNT 0 //!< _PJONCNT
292+
#endif
288293

289-
#if (__RF24CNT + __NRF5ESBCNT + __RFM69CNT + __RFM95CNT + __RS485CNT > 1)
294+
#if (__RF24CNT + __NRF5ESBCNT + __RFM69CNT + __RFM95CNT + __RS485CNT + _PJONCNT > 1)
290295
#error Only one forward link driver can be activated
291296
#endif
292297
#endif //DOXYGEN
@@ -297,7 +302,7 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
297302
#endif
298303

299304
// TRANSPORT INCLUDES
300-
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485)
305+
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) || defined (MY_PJON)
301306
#include "hal/transport/MyTransportHAL.h"
302307
#include "core/MyTransport.h"
303308

@@ -382,6 +387,12 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
382387
#elif defined(MY_RADIO_RFM95)
383388
#include "hal/transport/RFM95/driver/RFM95.cpp"
384389
#include "hal/transport/RFM95/MyTransportRFM95.cpp"
390+
#elif defined(MY_PJON)
391+
#include "hal/transport/PJON/driver/PJON.h"
392+
#if (PJON_BROADCAST == 0)
393+
#error "You must change PJON_BROADCAST to BROADCAST_ADDRESS (255u) and PJON_NOT_ASSIGNED to other one."
394+
#endif
395+
#include "hal/transport/PJON/MyTransportPJON.cpp"
385396
#endif
386397

387398
#if (defined(MY_RF24_ENABLE_ENCRYPTION) && defined(MY_RADIO_RF24)) || (defined(MY_NRF5_ESB_ENABLE_ENCRYPTION) && defined(MY_RADIO_NRF5_ESB)) || (defined(MY_RFM69_ENABLE_ENCRYPTION) && defined(MY_RADIO_RFM69)) || (defined(MY_RFM95_ENABLE_ENCRYPTION) && defined(MY_RADIO_RFM95))

examples/AirQualitySensor/AirQualitySensor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
//#define MY_RADIO_NRF5_ESB
4343
//#define MY_RADIO_RFM69
4444
//#define MY_RADIO_RFM95
45+
//#define MY_PJON
4546

4647
#include <MySensors.h>
4748

examples/BatteryPoweredSensor/BatteryPoweredSensor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
//#define MY_RADIO_NRF5_ESB
3737
//#define MY_RADIO_RFM69
3838
//#define MY_RADIO_RFM95
39+
//#define MY_PJON
3940

4041
#include <MySensors.h>
4142

examples/BinarySwitchSleepSensor/BinarySwitchSleepSensor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
//#define MY_RADIO_NRF5_ESB
3939
//#define MY_RADIO_RFM69
4040
//#define MY_RADIO_RFM95
41+
//#define MY_PJON
4142

4243
#include <MySensors.h>
4344

examples/CO2Sensor/CO2Sensor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
//#define MY_RADIO_NRF5_ESB
4747
//#define MY_RADIO_RFM69
4848
//#define MY_RADIO_RFM95
49+
//#define MY_PJON
4950

5051
#include <MySensors.h>
5152

examples/DimmableLEDActuator/DimmableLEDActuator.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
//#define MY_RADIO_NRF5_ESB
4444
//#define MY_RADIO_RFM69
4545
//#define MY_RADIO_RFM95
46+
//#define MY_PJON
4647

4748
#include <MySensors.h>
4849

examples/DimmableLight/DimmableLight.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
//#define MY_RADIO_NRF5_ESB
3838
//#define MY_RADIO_RFM69
3939
//#define MY_RADIO_RFM95
40+
//#define MY_PJON
4041

4142
#include <MySensors.h>
4243

examples/DustSensor/DustSensor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
//#define MY_RADIO_NRF5_ESB
4747
//#define MY_RADIO_RFM69
4848
//#define MY_RADIO_RFM95
49+
//#define MY_PJON
4950

5051
#include <MySensors.h>
5152

0 commit comments

Comments
 (0)