mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 14:46:40 +00:00
[modbus] [modbus_controller] Fix server role read coil 0x1 crc (#8859)
Co-authored-by: Stanley Pinchak <stanley.pinchak@gmail.com>
This commit is contained in:
parent
455624105b
commit
0b1c5b825e
@ -90,7 +90,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// data starts at 2 and length is 4 for read registers commands
|
// data starts at 2 and length is 4 for read registers commands
|
||||||
if (this->role == ModbusRole::SERVER && (function_code == 0x3 || function_code == 0x4)) {
|
if (this->role == ModbusRole::SERVER && (function_code == 0x1 || function_code == 0x3 || function_code == 0x4)) {
|
||||||
data_offset = 2;
|
data_offset = 2;
|
||||||
data_len = 4;
|
data_len = 4;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user