--- a/tool/CommandSiiWrite.cpp Tue Feb 23 17:40:46 2010 +0100
+++ b/tool/CommandSiiWrite.cpp Wed Feb 24 16:27:11 2010 +0100
@@ -34,6 +34,7 @@
#include "CommandSiiWrite.h"
#include "sii_crc.h"
+#include "MasterDevice.h"
/*****************************************************************************/
@@ -75,7 +76,7 @@
/****************************************************************************/
-void CommandSiiWrite::execute(MasterDevice &m, const StringVector &args)
+void CommandSiiWrite::execute(const StringVector &args)
{
stringstream err;
ec_ioctl_slave_sii_t data;
@@ -87,6 +88,12 @@
throwInvalidUsageException(err);
}
+ if (getMasterIndices().size() != 1) {
+ err << getName() << " requires to select a single master!";
+ throwInvalidUsageException(err);
+ }
+ MasterDevice m(getMasterIndices().front());
+
if (args[0] == "-") {
loadSiiData(&data, cin);
} else {