Commit aeb710d8 authored by Marius Harjoi's avatar Marius Harjoi

HandleWriteMultipleRegisters request.Data also contains the number of data bytes to follow

parent 1b12bd7d
......@@ -812,7 +812,8 @@ namespace AMWD.Modbus.Tcp.Server
{
var response = new Response(request);
if (request.Count < Consts.MinCount || request.Count > Consts.MaxRegisterCountWrite || request.Count * 2 != request.Data.Length)
//request.Data contains [byte count] [data]..[data]
if (request.Count < Consts.MinCount || request.Count > Consts.MaxRegisterCountWrite || request.Count * 2 != request.Data.Length - 1)
{
response.ErrorCode = ErrorCode.IllegalDataValue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment