master/slave.c
changeset 135 80d493917205
parent 133 b36d187ecc0b
child 136 a03a684cac89
--- a/master/slave.c	Tue Mar 28 12:38:05 2006 +0000
+++ b/master/slave.c	Tue Mar 28 13:42:50 2006 +0000
@@ -58,6 +58,7 @@
     INIT_LIST_HEAD(&slave->eeprom_strings);
     INIT_LIST_HEAD(&slave->eeprom_syncs);
     INIT_LIST_HEAD(&slave->eeprom_pdos);
+    INIT_LIST_HEAD(&slave->sdo_dictionary);
 }
 
 /*****************************************************************************/
@@ -72,6 +73,7 @@
     ec_eeprom_sync_t *sync, *next_sync;
     ec_eeprom_pdo_t *pdo, *next_pdo;
     ec_eeprom_pdo_entry_t *entry, *next_ent;
+    ec_sdo_t *sdo, *next_sdo;
 
     // Alle Strings freigeben
     list_for_each_entry_safe(string, next_str, &slave->eeprom_strings, list) {
@@ -103,6 +105,13 @@
     if (slave->eeprom_name) kfree(slave->eeprom_name);
     if (slave->eeprom_group) kfree(slave->eeprom_group);
     if (slave->eeprom_desc) kfree(slave->eeprom_desc);
+
+    // Alle SDOs freigeben
+    list_for_each_entry_safe(sdo, next_sdo, &slave->sdo_dictionary, list) {
+        list_del(&sdo->list);
+        if (sdo->name) kfree(sdo->name);
+        kfree(sdo);
+    }
 }
 
 /*****************************************************************************/
@@ -792,6 +801,7 @@
     ec_eeprom_sync_t *sync;
     ec_eeprom_pdo_t *pdo;
     ec_eeprom_pdo_entry_t *entry;
+    ec_sdo_t *sdo;
     int first;
 
     EC_INFO("x-- EtherCAT slave information ---------------\n");
@@ -892,6 +902,16 @@
         }
     }
 
+    if (!list_empty(&slave->sdo_dictionary)) {
+        EC_INFO("|   SDO-Dictionary:\n");
+        list_for_each_entry(sdo, &slave->sdo_dictionary, list) {
+            EC_INFO("|     0x%04X: \"%s\"\n", sdo->index,
+                    sdo->name ? sdo->name : "");
+            EC_INFO("|       Type 0x%04X, subindices: %i, features: 0x%02X\n",
+                    sdo->type, sdo->max_subindex, sdo->features);
+        }
+    }
+
     EC_INFO("x---------------------------------------------\n");
 }