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@eebbced5b6
This commit is contained in:
aleks
2019-04-10 17:45:22 +02:00
parent ce241e3ebd
commit d9fae5d0ad

View File

@@ -422,8 +422,8 @@ eMBErrorCode eMBRegCoilsCB(UCHAR* pucRegBuffer, USHORT usAddress,
usCoils--; usCoils--;
} }
// Send an event to notify application task about event // Send an event to notify application task about event
(void)send_param_access_notification(MB_EVENT_COILS_WR); (void)send_param_access_notification(MB_EVENT_COILS_RD);
(void)send_param_info(MB_EVENT_COILS_WR, (uint16_t)usAddress, (void)send_param_info(MB_EVENT_COILS_RD, (uint16_t)usAddress,
(uint8_t*)(pucCoilsDataBuf), (uint16_t)usNCoils); (uint8_t*)(pucCoilsDataBuf), (uint16_t)usNCoils);
break; break;
case MB_REG_WRITE: case MB_REG_WRITE: