Slave address in build_request_packet_tcp() is hardcoded as 0xFF
Bug #181887 reported by
Nicodemmus
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmodbus |
Fix Released
|
High
|
Stéphane Raimbault |
Bug Description
I am using version 1.2.2 of libmodbus and I noticed that there is a problem in the following function:
int build_request_
The problem is that the slave address is hardcoded as 0xFF, thus ignoring the function argument "int slave" when creating the package.
Line 209 is as follows:
packet[6] = 0xFF;
and it should be :
packet[6] = slave;
Regards.
Related branches
Changed in libmodbus: | |
assignee: | nobody → sra |
importance: | Undecided → High |
milestone: | none → 1.2.3 |
status: | New → Fix Committed |
Changed in libmodbus: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Thank you for your bug report.
I previously did this change in trunk, I will change the stable version too.
This error came from a bad documentation about the Modbus protocol.