-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Inside the method toRaw() from ModbusException byte order is wrong. Below is the code with the correct order:
Corrected:
std::vector<uint8_t> ModbusException::toRaw() const noexcept {
std::vector<uint8_t> result(3);
result[0] = _slaveId;
result[1] = static_cast<uint8_t>(_functionCode | 0b10000000);
result[2] = static_cast<uint8_t>(_errorCode);
return result;
}
Original:
std::vector<uint8_t> ModbusException::toRaw() const noexcept {
std::vector<uint8_t> result(3);
result[0] = _slaveId;
result[1] = static_cast<uint8_t>(_errorCode | 0b10000000);
result[2] = static_cast<uint8_t>(_functionCode);
return result;
}
Metadata
Metadata
Assignees
Labels
No labels