Skip to content

Commit

Permalink
1、【修复】FreeModbus主机写线圈一处潜在的Bug。
Browse files Browse the repository at this point in the history
Signed-off-by: armink <[email protected]>
  • Loading branch information
armink committed Mar 9, 2015
1 parent 226dd18 commit b48c073
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FreeModbus/modbus/functions/mbfunccoils_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ eMBMasterReqWriteCoil( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usCoilData, LO
UCHAR *ucMBFrame;
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;

if ( usCoilAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
if ( ucSndAddr > MB_MASTER_TOTAL_SLAVE_NUM ) eErrStatus = MB_MRE_ILL_ARG;
else if ( ( usCoilData != 0xFF00 ) && ( usCoilData != 0x0000 ) ) eErrStatus = MB_MRE_ILL_ARG;
else if ( xMBMasterRunResTake( lTimeOut ) == FALSE ) eErrStatus = MB_MRE_MASTER_BUSY;
else
Expand Down

0 comments on commit b48c073

Please sign in to comment.