From d9fae5d0ade98456529bfe0d4bbb6d65bf86d7b2 Mon Sep 17 00:00:00 2001 From: aleks Date: Wed, 10 Apr 2019 17:45:22 +0200 Subject: [PATCH] freemodbus: fix incorrectly set coils read event 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 https://github.com/espressif/esp-idf/issues/3289 * Original commit: espressif/esp-idf@eebbced5b63fae7f42227ce5902bedbf1c9509bf --- components/freemodbus/modbus_controller/mbcontroller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/freemodbus/modbus_controller/mbcontroller.c b/components/freemodbus/modbus_controller/mbcontroller.c index 2ca06be..b8447b4 100644 --- a/components/freemodbus/modbus_controller/mbcontroller.c +++ b/components/freemodbus/modbus_controller/mbcontroller.c @@ -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: