modbus fix read input regs max number

This commit is contained in:
Alex Lisitsyn
2024-08-19 16:36:51 +08:00
parent 1eafc29df3
commit 41d426ce3d

View File

@ -87,7 +87,7 @@ eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen )
* return Modbus illegal data value exception.
*/
if( ( usRegCount >= 1 )
&& ( usRegCount < MB_PDU_FUNC_READ_REGCNT_MAX ) )
&& ( usRegCount <= MB_PDU_FUNC_READ_REGCNT_MAX ) )
{
/* Set the current PDU data pointer to the beginning. */
pucFrameCur = &pucFrame[MB_PDU_FUNC_OFF];