[RF] handle 64 bits values (except for UNO) (#698)

* handle 64 bits values, except for UNO
Arduino UNO is not enough powerfull to handle properly uint64_t in terms of memory so differenciate the variable type depending on the board type
With this configuration ATMega will not be able to receive with simpleReceiving 64 bits values. Of course Json will work with 64 bits values for this board.
* Simplify jsondata.success() condition
* Renamings and optimize deduplication functions
* replace 2 dimensions array by a structure so as to handle the time with an uint32_t  when using an ESP (instead of a uint64_t)
* change storeValue and isAduplicate function names
* point to the rcswitch revision with the new 40 bits protocol

Co-authored-by: Leon Kiefer <leon.k97@gmx.de>
This commit is contained in:
FlorianandLeon Kiefer authored and GitHub committed 2020-07-18 17:14:19 -05:00
1 parent b66d72ac99
commit 6e9b170c00
10 files changed
+115 -73

No files matched your search

+13 -4
View File
@@ -169,12 +169,21 @@ char gateway_name[parameters_size * 2] = Gateway_Name;
#ifdef ESP32
//#define multiCore //uncomment to use multicore function of ESP32 for BLE
#endif
#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
# define JSON_MSG_BUFFER 512 // Json message max buffer size, don't put 1024 or higher it is causing unexpected behaviour on ESP8266
# define ARDUINOJSON_USE_LONG_LONG 1
#if defined(ESP8266) || defined(ESP32)
# define JSON_MSG_BUFFER 512 // Json message max buffer size, don't put 1024 or higher it is causing unexpected behaviour on ESP8266
# define SIGNAL_SIZE_UL_ULL uint64_t
# define STRTO_UL_ULL strtoull
#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
# define JSON_MSG_BUFFER 512 // Json message max buffer size, don't put 1024 or higher it is causing unexpected behaviour on ESP8266
# define SIGNAL_SIZE_UL_ULL uint64_t
# define STRTO_UL_ULL strtoul
#else // boards with smaller memory
# define JSON_MSG_BUFFER 64 // Json message max buffer size, don't put 1024 or higher it is causing unexpected behaviour on ESP8266
# define JSON_MSG_BUFFER 64 // Json message max buffer size, don't put 1024 or higher it is causing unexpected behaviour on ESP8266
# define SIGNAL_SIZE_UL_ULL uint32_t
# define STRTO_UL_ULL strtoul
#endif
#define TimeBetweenReadingSYS 120000 // time between system readings (like memory)
#define subjectSYStoMQTT "/SYStoMQTT"
#define subjectMQTTtoSYSset "/commands/MQTTtoSYS/config"