mirror of https://github.com/arendst/Tasmota.git
Update TasmotaModbus to v1.1.1
Update TasmotaModbus to v1.1.1
This commit is contained in:
parent
0e3a88bbe2
commit
9cd21815c6
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "TasmotaModbus",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"keywords": [
|
||||
"serial", "io", "TasmotaModbus"
|
||||
],
|
|
@ -1,5 +1,5 @@
|
|||
name=TasmotaModbus
|
||||
version=1.1.0
|
||||
version=1.1.1
|
||||
author=Theo Arends
|
||||
maintainer=Theo Arends <theo@arends.com>
|
||||
sentence=Basic modbus wrapper for TasmotaSerial for ESP8266.
|
|
@ -100,7 +100,10 @@ uint8_t TasmotaModbus::ReceiveBuffer(uint8_t *buffer, uint8_t register_count)
|
|||
}
|
||||
|
||||
if (len < 7) { return 7; } // 7 = Not enough data
|
||||
if (len != buffer[2] + 5) { return 8; } // 8 = Unexpected result
|
||||
if (len != buffer[2] + 5) {
|
||||
buffer[2] = len - 5; // As it's wrong anyway let's store actual number received in here (5 will be added by client)
|
||||
return 8; // 8 = Unexpected result
|
||||
}
|
||||
|
||||
uint16_t crc = (buffer[len -1] << 8) | buffer[len -2];
|
||||
if (CalculateCRC(buffer, len -2) != crc) { return 9; } // 9 = crc error
|
Loading…
Reference in New Issue