Skip to content

Commit b24711f

Browse files
committed
Add PJON transport layer
1 parent a5f4007 commit b24711f

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
@@ -203,6 +203,53 @@
203203
* @{
204204
*/
205205

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

207254
/**
208255
* @defgroup RS485SettingGrpPub RS485
@@ -2107,7 +2154,7 @@
21072154
#endif
21082155

21092156
// Enable sensor network "feature" if one of the transport types was enabled
2110-
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485)
2157+
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485) || defined(MY_PJON)
21112158
#define MY_SENSOR_NETWORK
21122159
#endif
21132160

@@ -2300,6 +2347,9 @@
23002347
// RS485
23012348
#define MY_RS485
23022349
#define MY_RS485_HWSERIAL
2350+
// PJON
2351+
#define MY_PJON
2352+
#define MY_DEBUG_VERBOSE_PJON
23032353
// RF24
23042354
#define MY_RADIO_RF24
23052355
#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)