Merge branch 'bugfix/modbus_serial_fsm_fix_address_offset' into 'master'

Bugfix/modbus serial fsm fix address offset

See merge request idf/esp-modbus!18
This commit is contained in:
Alex Lisitsyn
2022-07-16 01:02:27 +08:00
2 changed files with 4 additions and 2 deletions

View File

@@ -437,7 +437,8 @@ xMBMasterASCIITransmitFSM( void )
/* Notify the task which called eMBMasterASCIISend that the frame has /* Notify the task which called eMBMasterASCIISend that the frame has
* been sent. */ * been sent. */
case STATE_M_TX_NOTIFY: case STATE_M_TX_NOTIFY:
xFrameIsBroadcast = ( ucMasterASCIISndBuf[MB_SER_PDU_ADDR_OFF] == MB_ADDRESS_BROADCAST ) ? TRUE : FALSE; xFrameIsBroadcast = ( ucMasterASCIISndBuf[MB_SEND_BUF_PDU_OFF - MB_SER_PDU_PDU_OFF]
== MB_ADDRESS_BROADCAST ) ? TRUE : FALSE;
vMBMasterRequestSetType( xFrameIsBroadcast ); vMBMasterRequestSetType( xFrameIsBroadcast );
eSndState = STATE_M_TX_XFWR; eSndState = STATE_M_TX_XFWR;
/* If the frame is broadcast ,master will enable timer of convert delay, /* If the frame is broadcast ,master will enable timer of convert delay,

View File

@@ -350,7 +350,8 @@ xMBMasterRTUTransmitFSM( void )
} }
else else
{ {
xFrameIsBroadcast = ( ucMasterRTUSndBuf[MB_SER_PDU_ADDR_OFF] == MB_ADDRESS_BROADCAST ) ? TRUE : FALSE; xFrameIsBroadcast = ( ucMasterRTUSndBuf[MB_SEND_BUF_PDU_OFF - MB_SER_PDU_PDU_OFF]
== MB_ADDRESS_BROADCAST ) ? TRUE : FALSE;
vMBMasterRequestSetType( xFrameIsBroadcast ); vMBMasterRequestSetType( xFrameIsBroadcast );
eSndState = STATE_M_TX_XFWR; eSndState = STATE_M_TX_XFWR;
/* If the frame is broadcast ,master will enable timer of convert delay, /* If the frame is broadcast ,master will enable timer of convert delay,