Skip to content

Commit

Permalink
freemodbus: fix incorrectly set coils read event
Browse files Browse the repository at this point in the history
incorrect set of the MB_EVENT_COILS_WR event is changed while read coils in mbcontroller.c file
added read/write handling for appropriate registers in freemodbus.c example file

Closes espressif/esp-idf#3289


* Original commit: espressif/esp-idf@eebbced
  • Loading branch information
alisitsyn committed Mar 21, 2022
1 parent ce241e3 commit d9fae5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/freemodbus/modbus_controller/mbcontroller.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ eMBErrorCode eMBRegCoilsCB(UCHAR* pucRegBuffer, USHORT usAddress,
usCoils--;
}
// Send an event to notify application task about event
(void)send_param_access_notification(MB_EVENT_COILS_WR);
(void)send_param_info(MB_EVENT_COILS_WR, (uint16_t)usAddress,
(void)send_param_access_notification(MB_EVENT_COILS_RD);
(void)send_param_info(MB_EVENT_COILS_RD, (uint16_t)usAddress,
(uint8_t*)(pucCoilsDataBuf), (uint16_t)usNCoils);
break;
case MB_REG_WRITE:
Expand Down

0 comments on commit d9fae5d

Please sign in to comment.