Added ec_sdo_request_copy(). stable-1.4
authorFlorian Pose <fp@igh-essen.com>
Tue, 25 Nov 2008 12:31:53 +0000
branchstable-1.4
changeset 1676 6ad30897a9dc
parent 1675 2a7a693a046e
child 1677 e1a31667fa48
Added ec_sdo_request_copy().
master/sdo_request.c
master/sdo_request.h
--- 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(
--- 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);