mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-15 14:56:30 +00:00
Add Modbus errorcode
This commit is contained in:
parent
7249552582
commit
05650384dd
@ -93,6 +93,9 @@ uint8_t TasmotaModbus::ReceiveBuffer(uint8_t *buffer, uint8_t register_count)
|
||||
buffer[mb_len++] = data;
|
||||
if (3 == mb_len) {
|
||||
if (buffer[1] & 0x80) { // 01 84 02 f2 f1
|
||||
if (0 == buffer[2]) {
|
||||
return 3; // 3 = Illegal Data Value,
|
||||
}
|
||||
return buffer[2]; // 1 = Illegal Function,
|
||||
// 2 = Illegal Data Address,
|
||||
// 3 = Illegal Data Value,
|
||||
|
Loading…
x
Reference in New Issue
Block a user