tool/CommandSiiRead.cpp
changeset 1826 ec6223c3b7ec
parent 1804 742607c464c4
child 1869 14f634f5b613
--- a/tool/CommandSiiRead.cpp	Tue Feb 23 17:40:46 2010 +0100
+++ b/tool/CommandSiiRead.cpp	Wed Feb 24 16:27:11 2010 +0100
@@ -32,6 +32,7 @@
 using namespace std;
 
 #include "CommandSiiRead.h"
+#include "MasterDevice.h"
 
 /*****************************************************************************/
 
@@ -73,7 +74,7 @@
 
 /****************************************************************************/
 
-void CommandSiiRead::execute(MasterDevice &m, const StringVector &args)
+void CommandSiiRead::execute(const StringVector &args)
 {
     SlaveList slaves;
     ec_ioctl_slave_t *slave;
@@ -88,6 +89,11 @@
         throwInvalidUsageException(err);
     }
 
+    if (getMasterIndices().size() != 1) {
+        err << getName() << " requires to select a single master!";
+        throwInvalidUsageException(err);
+    }
+    MasterDevice m(getMasterIndices().front());
     m.open(MasterDevice::Read);
     slaves = selectedSlaves(m);