From 2b401119db2166705147cc805472f6ecf734eb8b Mon Sep 17 00:00:00 2001 From: Florian Pose <fp@igh-essen.com> Date: Mon, 28 Jul 2008 12:11:50 +0000 Subject: [PATCH] Improved alias/position addressing in case od duplicated aliases. --- TODO | 1 - tool/Command.cpp | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index bd5ffc4a..c0c1ee76 100644 --- a/TODO +++ b/TODO @@ -21,7 +21,6 @@ Version 1.4.0: - Add a -n (numeric) switch. - Check for options, remove global variables. - Remove MasterDevice::slaveCount(). - - Alias index? - Add 'etherlab version'. Future issues: diff --git a/tool/Command.cpp b/tool/Command.cpp index d3c9e6bc..95cd0a69 100644 --- a/tool/Command.cpp +++ b/tool/Command.cpp @@ -143,12 +143,11 @@ Command::SlaveList Command::selectedSlaves(MasterDevice &m) 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++; -- GitLab