Added ec_slave_config_find_voe_handler().
authorFlorian Pose <fp@igh-essen.com>
Tue, 14 Oct 2008 09:56:38 +0000
changeset 1263 f44720defbc5
parent 1262 3c462a0dbf3c
child 1264 e7882f246d7a
Added ec_slave_config_find_voe_handler().
master/slave_config.c
master/slave_config.h
--- a/master/slave_config.c	Tue Oct 14 08:39:42 2008 +0000
+++ b/master/slave_config.c	Tue Oct 14 09:56:38 2008 +0000
@@ -364,6 +364,26 @@
     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. */
+        )
+{
+    ec_voe_handler_t *voe;
+
+    list_for_each_entry(voe, &sc->voe_handlers, list) {
+        if (pos--)
+            continue;
+        return voe;
+    }
+
+    return NULL;
+}
+
 /******************************************************************************
  *  Realtime interface
  *****************************************************************************/
--- a/master/slave_config.h	Tue Oct 14 08:39:42 2008 +0000
+++ b/master/slave_config.h	Tue Oct 14 09:56:38 2008 +0000
@@ -89,6 +89,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_voe_handler_t *ec_slave_config_find_voe_handler(ec_slave_config_t *,
+		unsigned int);
 
 /*****************************************************************************/