Added ec_slave_config_find_sdo_request().
authorFlorian Pose <fp@igh-essen.com>
Mon, 02 Feb 2009 13:34:01 +0000
changeset 1351 cf8f08631c8e
parent 1350 cd278db5a872
child 1352 275d2fdeab48
Added ec_slave_config_find_sdo_request().
master/slave_config.c
master/slave_config.h
--- a/master/slave_config.c	Mon Feb 02 13:32:48 2009 +0000
+++ b/master/slave_config.c	Mon Feb 02 13:34:01 2009 +0000
@@ -359,6 +359,26 @@
 
 /** Finds a VoE handler via its position in the list.
  */
+ec_sdo_request_t *ec_slave_config_find_sdo_request(
+        ec_slave_config_t *sc, /**< Slave configuration. */
+        unsigned int pos /**< Position in the list. */
+        )
+{
+    ec_sdo_request_t *req;
+
+    list_for_each_entry(req, &sc->sdo_requests, list) {
+        if (pos--)
+            continue;
+        return req;
+    }
+
+    return NULL;
+}
+
+/*****************************************************************************/
+
+/** Finds a VoE handler via its position in the list.
+ */
 ec_voe_handler_t *ec_slave_config_find_voe_handler(
         ec_slave_config_t *sc, /**< Slave configuration. */
         unsigned int pos /**< Position in the list. */
--- a/master/slave_config.h	Mon Feb 02 13:32:48 2009 +0000
+++ b/master/slave_config.h	Mon Feb 02 13:34:01 2009 +0000
@@ -82,6 +82,8 @@
 unsigned int ec_slave_config_sdo_count(const ec_slave_config_t *);
 const ec_sdo_request_t *ec_slave_config_get_sdo_by_pos_const(
         const ec_slave_config_t *, unsigned int);
+ec_sdo_request_t *ec_slave_config_find_sdo_request(ec_slave_config_t *,
+        unsigned int);
 ec_voe_handler_t *ec_slave_config_find_voe_handler(ec_slave_config_t *,
 		unsigned int);