# HG changeset patch # User Florian Pose # Date 1227616313 0 # Node ID 6ad30897a9dcc1ce389bdd4a7d523f0fd4f613db # Parent 2a7a693a046e16c37aa52a1c674dc8f5e8e55ee0 Added ec_sdo_request_copy(). diff -r 2a7a693a046e -r 6ad30897a9dc master/sdo_request.c --- a/master/sdo_request.c Thu Nov 06 15:45:40 2008 +0000 +++ b/master/sdo_request.c Tue Nov 25 12:31:53 2008 +0000 @@ -95,6 +95,22 @@ /*****************************************************************************/ +/** Copy another Sdo request. + * + * \attention Only the index subindex and data are copied. + */ +int ec_sdo_request_copy( + ec_sdo_request_t *req, + const ec_sdo_request_t *other + ) +{ + req->index = other->index; + req->subindex = other->subindex; + return ec_sdo_request_copy_data(req, other->data, other->data_size); +} + +/*****************************************************************************/ + /** Sdo request destructor. */ void ec_sdo_request_clear_data( diff -r 2a7a693a046e -r 6ad30897a9dc master/sdo_request.h --- a/master/sdo_request.h Thu Nov 06 15:45:40 2008 +0000 +++ b/master/sdo_request.h Tue Nov 25 12:31:53 2008 +0000 @@ -77,6 +77,7 @@ void ec_sdo_request_init(ec_sdo_request_t *); void ec_sdo_request_clear(ec_sdo_request_t *); +int ec_sdo_request_copy(ec_sdo_request_t *, const ec_sdo_request_t *); void ec_sdo_request_address(ec_sdo_request_t *, uint16_t, uint8_t); int ec_sdo_request_alloc(ec_sdo_request_t *, size_t); int ec_sdo_request_copy_data(ec_sdo_request_t *, const uint8_t *, size_t);