--- a/tool/CommandAlias.cpp Tue Feb 23 17:40:46 2010 +0100
+++ b/tool/CommandAlias.cpp Wed Feb 24 16:27:11 2010 +0100
@@ -34,6 +34,7 @@
#include "CommandAlias.h"
#include "sii_crc.h"
+#include "MasterDevice.h"
/*****************************************************************************/
@@ -75,7 +76,7 @@
/** Writes the Secondary slave address (alias) to the slave's SII.
*/
-void CommandAlias::execute(MasterDevice &m, const StringVector &args)
+void CommandAlias::execute(const StringVector &args)
{
uint16_t alias;
stringstream err, strAlias;
@@ -98,6 +99,11 @@
}
alias = number;
+ if (getMasterIndices().size() != 1) {
+ err << getName() << " requires to select a single master!";
+ throwInvalidUsageException(err);
+ }
+ MasterDevice m(getMasterIndices().front());
m.open(MasterDevice::ReadWrite);
slaves = selectedSlaves(m);