mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49:52 +03:00
change verbose logging to find duplicates
This commit is contained in:
@@ -410,7 +410,7 @@ void _debugPrintTelegram(const char * prefix, uint8_t * data, uint8_t len, const
|
|||||||
if (EMS_Sys_Status.emsLogging <= EMS_SYS_LOGGING_BASIC)
|
if (EMS_Sys_Status.emsLogging <= EMS_SYS_LOGGING_BASIC)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char output_str[300] = {0}; // roughly EMS_MAX_TELEGRAM_LENGTH*3 + 20
|
char output_str[200] = {0};
|
||||||
char buffer[16] = {0};
|
char buffer[16] = {0};
|
||||||
|
|
||||||
unsigned long upt = millis();
|
unsigned long upt = millis();
|
||||||
@@ -668,7 +668,7 @@ void _ems_processTelegram(uint8_t * telegram, uint8_t length) {
|
|||||||
|
|
||||||
// print detailed telegram data
|
// print detailed telegram data
|
||||||
if (EMS_Sys_Status.emsLogging >= EMS_SYS_LOGGING_THERMOSTAT) {
|
if (EMS_Sys_Status.emsLogging >= EMS_SYS_LOGGING_THERMOSTAT) {
|
||||||
char output_str[300] = {0}; // roughly EMS_MAX_TELEGRAM_LENGTH*3 + 20
|
char output_str[200] = {0};
|
||||||
char buffer[16] = {0};
|
char buffer[16] = {0};
|
||||||
char color_s[20] = {0};
|
char color_s[20] = {0};
|
||||||
|
|
||||||
@@ -740,7 +740,7 @@ void _ems_processTelegram(uint8_t * telegram, uint8_t length) {
|
|||||||
if (typeFound && (commonType || forUs)) {
|
if (typeFound && (commonType || forUs)) {
|
||||||
if ((EMS_Types[i].processType_cb) != (void *)NULL) {
|
if ((EMS_Types[i].processType_cb) != (void *)NULL) {
|
||||||
// print non-verbose message
|
// print non-verbose message
|
||||||
if ((EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_BASIC) || (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_VERBOSE)) {
|
if (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_BASIC) {
|
||||||
myDebug("<--- %s(0x%02X) received", EMS_Types[i].typeString, type);
|
myDebug("<--- %s(0x%02X) received", EMS_Types[i].typeString, type);
|
||||||
}
|
}
|
||||||
// call callback function to process it
|
// call callback function to process it
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
#define EMS_MIN_TELEGRAM_LENGTH 6 // minimal length for a validation telegram, including CRC
|
#define EMS_MIN_TELEGRAM_LENGTH 6 // minimal length for a validation telegram, including CRC
|
||||||
|
|
||||||
// max length of a telegram, including CRC, for Rx and Tx.
|
// max length of a telegram, including CRC, for Rx and Tx. Data size is 32, so reserving 40 to be safe
|
||||||
#define EMS_MAX_TELEGRAM_LENGTH 99
|
#define EMS_MAX_TELEGRAM_LENGTH 40
|
||||||
|
|
||||||
// default values
|
// default values
|
||||||
#define EMS_VALUE_INT_ON 1 // boolean true
|
#define EMS_VALUE_INT_ON 1 // boolean true
|
||||||
|
|||||||
@@ -10,15 +10,15 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#define EMSUART_UART 0 // UART 0
|
#define EMSUART_UART 0 // UART 0
|
||||||
#define EMSUART_CONFIG 0x1c // 8N1 (8 bits, no stop bits, 1 parity)
|
#define EMSUART_CONFIG 0x1C // 8N1 (8 bits, no stop bits, 1 parity)
|
||||||
#define EMSUART_BAUD 9600 // uart baud rate for the EMS circuit
|
#define EMSUART_BAUD 9600 // uart baud rate for the EMS circuit
|
||||||
|
|
||||||
#define EMS_MAXBUFFERS 4 // 4 buffers for circular filling to avoid collisions
|
#define EMS_MAXBUFFERS 10 // 4 buffers for circular filling to avoid collisions
|
||||||
#define EMS_MAXBUFFERSIZE 128 // max size of the buffer. packets are max 32 bytes
|
#define EMS_MAXBUFFERSIZE 32 // max size of the buffer. packets are max 32 bytes
|
||||||
|
|
||||||
// this is how long we drop the Tx signal to create a 11-bit Break of zeros
|
// this is how long we drop the Tx signal to create a 11-bit Break of zeros (BRK)
|
||||||
// At 9600 baud, 11 bits will be 1144 microseconds
|
// At 9600 baud, 11 bits will be 1144 microseconds
|
||||||
// the BRK from Boiler is roughly 1.039ms, so accounting for hardware lag using around 2078 (for half-duplex) - 8 (lag)
|
// the BRK from Boiler master is roughly 1.039ms, so accounting for hardware lag using around 2078 (for half-duplex) - 8 (lag)
|
||||||
#define EMS_TX_BRK_WAIT 2070
|
#define EMS_TX_BRK_WAIT 2070
|
||||||
|
|
||||||
#define EMSUART_recvTaskPrio 1
|
#define EMSUART_recvTaskPrio 1
|
||||||
|
|||||||
Reference in New Issue
Block a user