mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-30 10:39:12 +03:00
minor updates for modbus
This commit is contained in:
@@ -837,7 +837,7 @@ uint16_t Helpers::string2minutes(const std::string & str) {
|
||||
}
|
||||
}
|
||||
|
||||
float Helpers::numericoperator2scalefactor(uint8_t numeric_operator) {
|
||||
float Helpers::numericoperator2scalefactor(int8_t numeric_operator) {
|
||||
if (numeric_operator == 0)
|
||||
return 1.0f;
|
||||
else if (numeric_operator > 0)
|
||||
|
||||
@@ -50,7 +50,7 @@ class Helpers {
|
||||
static bool check_abs(const int32_t i);
|
||||
static uint32_t abs(const int32_t i);
|
||||
static uint16_t string2minutes(const std::string & str);
|
||||
static float numericoperator2scalefactor(uint8_t numeric_operator);
|
||||
static float numericoperator2scalefactor(int8_t numeric_operator);
|
||||
|
||||
static float transformNumFloat(float value, const int8_t numeric_operator, const uint8_t fahrenheit = 0);
|
||||
|
||||
|
||||
@@ -52,7 +52,8 @@ void Modbus::start(uint8_t systemServerId, uint16_t port, uint8_t max_clients, u
|
||||
void Modbus::stop() {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
modbusServer_->stop();
|
||||
delete modbusServer_;
|
||||
// virtual ~ModbusServerTCPasync() = default;
|
||||
// delete modbusServer_;
|
||||
modbusServer_ = nullptr;
|
||||
#endif
|
||||
}
|
||||
@@ -65,6 +66,7 @@ bool Modbus::check_parameter_order() {
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
} else if (prev == nullptr || !prev->isLessThan(mi)) {
|
||||
// TODO fix nullptr dereference when printing
|
||||
LOG_ERROR("Error in modbus parameters: %s must be listed before %s.", mi.short_name, prev->short_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.7.0-dev.20"
|
||||
#define EMSESP_APP_VERSION "3.7.0-dev.21"
|
||||
|
||||
Reference in New Issue
Block a user