modbus_lib icon indicating copy to clipboard operation
modbus_lib copied to clipboard

Unify error handling procedure

Open ceremcem opened this issue 3 years ago • 0 comments

Currently two different error management approaches are used. One uses return modbus_lib_send_error(MBUS_RESPONSE_SERVICE_DEVICE_FAILURE) and other uses return MBUS_RESPONSE_SERVICE_DEVICE_FAILURE in modbus_lib_read_handler and modbus_lib_write_handler respectively.

Proper approach might be using modbus_lib_send_error() for both of them (reverse the #4 changes) or create a relevant error function for each error code in order to get rid of writing modbus_lib_send_error, which will become:

return MBUS_RESPONSE_SERVICE_DEVICE_FAILURE();

ceremcem avatar Jul 02 '22 10:07 ceremcem