Skip to content
Snippets Groups Projects
Commit e285945d authored by Florian Pose's avatar Florian Pose
Browse files

Added ecrt_sdo_request_data_size().

parent 52a4b806
Branches master
No related tags found
No related merge requests found
......@@ -672,6 +672,18 @@ uint8_t *ecrt_sdo_request_data(
ec_sdo_request_t *req /**< Sdo request. */
);
/** Returns the current Sdo data size.
*
* When the Sdo request is created, the data size is set to the size of the
* reserved memory. After a read operation the size is set to the size of the
* read data. The size is not modified in any other situation.
*
* \return Sdo data size in bytes.
*/
size_t ecrt_sdo_request_data_size(
const ec_sdo_request_t *req /**< Sdo request. */
);
/** Get the current state of the Sdo request.
*
* \return Request state.
......
......@@ -177,6 +177,13 @@ uint8_t *ecrt_sdo_request_data(ec_sdo_request_t *req)
/*****************************************************************************/
size_t ecrt_sdo_request_data_size(const ec_sdo_request_t *req)
{
return req->data_size;
}
/*****************************************************************************/
ec_sdo_request_state_t ecrt_sdo_request_state(const ec_sdo_request_t *req)
{
return state_translation_table[req->state];
......@@ -204,6 +211,7 @@ void ecrt_sdo_request_write(ec_sdo_request_t *req)
EXPORT_SYMBOL(ecrt_sdo_request_timeout);
EXPORT_SYMBOL(ecrt_sdo_request_data);
EXPORT_SYMBOL(ecrt_sdo_request_data_size);
EXPORT_SYMBOL(ecrt_sdo_request_state);
EXPORT_SYMBOL(ecrt_sdo_request_read);
EXPORT_SYMBOL(ecrt_sdo_request_write);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment