Fix small index compare bug in modbus

This commit is contained in:
Jesse Hills 2022-12-16 16:21:04 +13:00
parent 39af967433
commit 69fe18f1ef
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) {
uint8_t function_code = raw[1];
// Byte 2: Size (with modbus rtu function code 4/3)
// See also https://en.wikipedia.org/wiki/Modbus
if (at == 2)
if (at <= 2)
return true;
uint8_t data_len = raw[2];