diff --git a/NEWS b/NEWS index 5d22df6..495f2a0 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ -libmodbus 2.9.3 (2010-12-XX) +libmodbus 2.9.3 (2011-01-XX) ============================ +- Fix unit identifier not copied by the TCP server. + Reported by Antti Manninen. - New function to reply to an indication with an exception message modbus_reply_exception() - Fix missing modbus_flush() in unit tests diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index d63f7b6..1ce7b35 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -141,7 +141,8 @@ int _modbus_tcp_build_response_basis(sft_t *sft, uint8_t *rsp) /* Length will be set later by send_msg (4 and 5) */ - rsp[6] = 0xFF; + /* The slave ID is copied from the indication */ + rsp[6] = sft->slave; rsp[7] = sft->function; return _MODBUS_TCP_PRESET_RSP_LENGTH;