优化自定义功能码数据读取校验
This commit is contained in:
10
client.go
10
client.go
@@ -1188,11 +1188,11 @@ func (mc *ModbusClient) readRegistersWithFunctionCode(addr uint16, quantity uint
|
||||
unitId: mc.unitId,
|
||||
}
|
||||
|
||||
if functionCode != fcCustomize {
|
||||
err = ErrUnexpectedParameters
|
||||
mc.logger.Errorf("unexpected function code (%d)", functionCode)
|
||||
return
|
||||
}
|
||||
// if functionCode != fcCustomize {
|
||||
// err = ErrUnexpectedParameters
|
||||
// mc.logger.Errorf("unexpected function code (%d)", functionCode)
|
||||
// return
|
||||
// }
|
||||
|
||||
if functionCode == 0 {
|
||||
err = ErrUnexpectedParameters
|
||||
|
||||
Reference in New Issue
Block a user