1、【修改】FreeModbus主机一处错误的接口命名。
Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
parent
c7e08d179d
commit
b717ccd2e6
|
@ -103,7 +103,7 @@ eMBMasterReqReadCoils( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usNCoils ,LONG
|
||||||
ucMBFrame[MB_PDU_REQ_READ_COILCNT_OFF + 1] = usNCoils;
|
ucMBFrame[MB_PDU_REQ_READ_COILCNT_OFF + 1] = usNCoils;
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
|
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
|
@ -210,7 +210,7 @@ eMBMasterReqWriteCoil( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usCoilData, LO
|
||||||
ucMBFrame[MB_PDU_REQ_WRITE_VALUE_OFF + 1] = usCoilData;
|
ucMBFrame[MB_PDU_REQ_WRITE_VALUE_OFF + 1] = usCoilData;
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_SIZE );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_SIZE );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ eMBMasterReqWriteMultipleCoils( UCHAR ucSndAddr,
|
||||||
}
|
}
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_MUL_SIZE_MIN + ucByteCount );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_MUL_SIZE_MIN + ucByteCount );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ eMBMasterReqReadDiscreteInputs( UCHAR ucSndAddr, USHORT usDiscreteAddr, USHORT u
|
||||||
ucMBFrame[MB_PDU_REQ_READ_DISCCNT_OFF + 1] = usNDiscreteIn;
|
ucMBFrame[MB_PDU_REQ_READ_DISCCNT_OFF + 1] = usNDiscreteIn;
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ eMBMasterReqWriteHoldingRegister( UCHAR ucSndAddr, USHORT usRegAddr, USHORT usRe
|
||||||
ucMBFrame[MB_PDU_REQ_WRITE_VALUE_OFF + 1] = usRegData ;
|
ucMBFrame[MB_PDU_REQ_WRITE_VALUE_OFF + 1] = usRegData ;
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_SIZE );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_SIZE );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ eMBMasterReqWriteMultipleHoldingRegister( UCHAR ucSndAddr,
|
||||||
}
|
}
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_MUL_SIZE_MIN + 2*usNRegs );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_WRITE_MUL_SIZE_MIN + 2*usNRegs );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ eMBMasterReqReadHoldingRegister( UCHAR ucSndAddr, USHORT usRegAddr, USHORT usNRe
|
||||||
ucMBFrame[MB_PDU_REQ_READ_REGCNT_OFF + 1] = usNRegs;
|
ucMBFrame[MB_PDU_REQ_READ_REGCNT_OFF + 1] = usNRegs;
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ eMBMasterReqReadWriteMultipleHoldingRegister( UCHAR ucSndAddr,
|
||||||
}
|
}
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READWRITE_SIZE_MIN + 2*usNWriteRegs );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READWRITE_SIZE_MIN + 2*usNWriteRegs );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ eMBMasterReqReadInputRegister( UCHAR ucSndAddr, USHORT usRegAddr, USHORT usNRegs
|
||||||
ucMBFrame[MB_PDU_REQ_READ_REGCNT_OFF + 1] = usNRegs;
|
ucMBFrame[MB_PDU_REQ_READ_REGCNT_OFF + 1] = usNRegs;
|
||||||
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
vMBMasterSetPDUSndLength( MB_PDU_SIZE_MIN + MB_PDU_REQ_READ_SIZE );
|
||||||
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
( void ) xMBMasterPortEventPost( EV_MASTER_FRAME_SENT );
|
||||||
eErrStatus = vMBMasterWaitRequestFinish( );
|
eErrStatus = eMBMasterWaitRequestFinish( );
|
||||||
}
|
}
|
||||||
return eErrStatus;
|
return eErrStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,7 +392,7 @@ void vMBMasterSetCurTimerMode( eMBMasterTimerMode eMBTimerMode );
|
||||||
BOOL xMBMasterRequestIsBroadcast( void );
|
BOOL xMBMasterRequestIsBroadcast( void );
|
||||||
eMBMasterErrorEventType eMBMasterGetErrorType( void );
|
eMBMasterErrorEventType eMBMasterGetErrorType( void );
|
||||||
void vMBMasterSetErrorType( eMBMasterErrorEventType errorType );
|
void vMBMasterSetErrorType( eMBMasterErrorEventType errorType );
|
||||||
eMBMasterReqErrCode vMBMasterWaitRequestFinish( void );
|
eMBMasterReqErrCode eMBMasterWaitRequestFinish( void );
|
||||||
|
|
||||||
/* ----------------------- Callback -----------------------------------------*/
|
/* ----------------------- Callback -----------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ void vMBMasterCBRequestScuuess( void ) {
|
||||||
*
|
*
|
||||||
* @return request error code
|
* @return request error code
|
||||||
*/
|
*/
|
||||||
eMBMasterReqErrCode vMBMasterWaitRequestFinish( void ) {
|
eMBMasterReqErrCode eMBMasterWaitRequestFinish( void ) {
|
||||||
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;
|
eMBMasterReqErrCode eErrStatus = MB_MRE_NO_ERR;
|
||||||
rt_uint32_t recvedEvent;
|
rt_uint32_t recvedEvent;
|
||||||
/* waiting for OS event */
|
/* waiting for OS event */
|
||||||
|
|
Loading…
Reference in New Issue