internal int ResponseBytesToRead(byte[] frameStart) { byte functionCode = frameStart[1]; if (functionCode > Modbus.ExceptionOffset) { return(1); } IModbusFunctionService service = ModbusFactory.GetFunctionServiceOrThrow(functionCode); return(service.GetRtuResponseBytesToRead(frameStart)); }
internal int ResponseBytesToRead(byte[] frameStart) { byte functionCode = frameStart[1]; if (functionCode > Modbus.ExceptionOffset) { return(1); } IModbusFunctionService service = _modbusFactory.GetFunctionService(functionCode); if (service == null) { string msg = $"Function code {functionCode} not supported."; Logger.Warning(msg); throw new NotImplementedException(msg); } return(service.GetRtuResponseBytesToRead(frameStart)); }