mbc_master_send_request() function
Send data request as defined in parameter request, waits response from slave and returns status of command execution. This function provides standard way for read/write access to Modbus devices in the network.
Arguments
request
pointer to request structure of type mb_param_request_t
data_ptr
pointer to data buffer to send or received data (dependent of command field in request)
Return value
- esp_err_t ESP_OK - request was successful - esp_err_t ESP_ERR_INVALID_ARG - invalid argument of function - esp_err_t ESP_ERR_INVALID_RESPONSE - an invalid response from slave - esp_err_t ESP_ERR_TIMEOUT - operation timeout or no response from slave - esp_err_t ESP_ERR_NOT_SUPPORTED - the request command is not supported by slave - esp_err_t ESP_FAIL - slave returned an exception or other failure