Improved alias/position addressing in case od duplicated aliases.
authorFlorian Pose <fp@igh-essen.com>
Mon, 28 Jul 2008 12:11:50 +0000
changeset 1159 25cc77cf3993
parent 1158 f65164fa4a58
child 1160 f02ff486b313
Improved alias/position addressing in case od duplicated aliases.
TODO
tool/Command.cpp
--- a/TODO	Mon Jul 28 11:43:08 2008 +0000
+++ b/TODO	Mon Jul 28 12:11:50 2008 +0000
@@ -21,7 +21,6 @@
     - Add a -n (numeric) switch.
     - Check for options, remove global variables.
     - Remove MasterDevice::slaveCount().
-    - Alias index?
     - Add 'etherlab version'.
 
 Future issues:
--- a/tool/Command.cpp	Mon Jul 28 11:43:08 2008 +0000
+++ b/tool/Command.cpp	Mon Jul 28 12:11:50 2008 +0000
@@ -143,12 +143,11 @@
             aliasIndex = 0;
             for (i = 0; i < numSlaves; i++) {
                 m.getSlave(&slave, i);
-                if (slave.alias) { // FIXME 'lock' first alias
+                if (slave.alias && slave.alias == (uint16_t) alias) {
                     lastAlias = slave.alias;
                     aliasIndex = 0;
                 }
-                if (lastAlias == (uint16_t) alias
-                        && aliasIndex == (unsigned int) position) {
+                if (lastAlias && aliasIndex == (unsigned int) position) {
                     list.push_back(slave);
                 }
                 aliasIndex++;