Fixed MODBUS and seneca drivers, added partial counter reset

This commit is contained in:
Emanuele Trabattoni
2025-07-13 13:16:24 +02:00
parent d2eba9085e
commit 7e02f3cef2
5 changed files with 96 additions and 60 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
// #define DEBUGLOG_DEFAULT_LOG_LEVEL_TRACE
#include <DebugLog.h>
#include <Arduino.h>
#include <HardwareSerial.h> // Reference the ESP32 built-in serial port library
@@ -50,7 +52,6 @@ namespace drivers
typedef uint16_t crc_t;
public:
MODBUS(const uint32_t baud, const SerialConfig conf);
// Func 0x01
@@ -84,7 +85,7 @@ namespace drivers
const bool readBinary(const uint8_t device, const uint8_t func, const uint16_t reg, const uint16_t bits, std::vector<bool> &out);
const bool readInteger(const uint8_t device, const uint8_t func, const uint16_t reg, const uint16_t num, std::vector<uint16_t> &out);
const bool writeBinary(const uint8_t device, const uint8_t func, const uint16_t reg, const std::vector<bool> &in);
const bool writeInteger(const uint8_t device, const uint8_t func, const uint16_t reg, const std::vector<uint16_t> &in);
const bool writeInteger(const uint8_t device, const uint8_t func, const uint16_t reg, const std::vector<uint16_t> &in, const bool multi);
const bool verifyCrc(const std::vector<uint8_t> &data);
};
}