Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2e00bf6

Browse files
tekka007gioblu
andauthored
Add PJON transport layer (mysensors#1278)
* Add PJON transport layer * Update PJON 13.0 * PJON transport now non-blocking, fixed polling Co-authored-by: Giovanni Blu Mitolo <gioscarab@gmail.com>
1 parent dc562a2 commit 2e00bf6

File tree

134 files changed

+16414
-4
lines changed

Some content is hidden

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

134 files changed

+16414
-4
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'

‎.mystools/cppcheck/config/suppressions.cfg‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
// 3rd party
55
*:hal/architecture/Linux/*
66
*:drivers/*
7+
*:hal/transport/PJON/driver/*

‎MyConfig.h‎

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,55 @@
204204
* @{
205205
*/
206206

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

208257
/**
209258
* @defgroup RS485SettingGrpPub RS485
@@ -2226,7 +2275,7 @@
22262275
#endif
22272276

22282277
// Enable sensor network "feature" if one of the transport types was enabled
2229-
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485)
2278+
#if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RS485)|| defined(MY_PJON)
22302279
#define MY_SENSOR_NETWORK
22312280
#endif
22322281

@@ -2391,6 +2440,9 @@
23912440
#define MY_RS485_DE_PIN
23922441
#define MY_RS485_DE_INVERSE
23932442
#define MY_RS485_HWSERIAL
2443+
// PJON
2444+
#define MY_PJON
2445+
#define MY_DEBUG_VERBOSE_PJON
23942446
// RF24
23952447
#define MY_RADIO_RF24
23962448
#define MY_RADIO_NRF24 //deprecated

‎MySensors.h‎

Lines changed: 14 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

@@ -381,6 +386,13 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
381386
#elif defined(MY_RADIO_RFM95)
382387
#include "hal/transport/RFM95/driver/RFM95.cpp"
383388
#include "hal/transport/RFM95/MyTransportRFM95.cpp"
389+
#elif defined(MY_PJON)
390+
#include "hal/transport/PJON/driver/PJON.h"
391+
#include "hal/transport/PJON/driver/PJONSoftwareBitBang.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"
384396
#endif
385397

386398
#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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /