diff -r 65781b048a47 -r ec6223c3b7ec tool/CommandDownload.cpp --- a/tool/CommandDownload.cpp Tue Feb 23 17:40:46 2010 +0100 +++ b/tool/CommandDownload.cpp Wed Feb 24 16:27:11 2010 +0100 @@ -32,6 +32,7 @@ using namespace std; #include "CommandDownload.h" +#include "MasterDevice.h" /*****************************************************************************/ @@ -83,7 +84,7 @@ /****************************************************************************/ -void CommandDownload::execute(MasterDevice &m, const StringVector &args) +void CommandDownload::execute(const StringVector &args) { stringstream strIndex, strSubIndex, strValue, err; ec_ioctl_slave_sdo_download_t data; @@ -115,6 +116,11 @@ } data.sdo_entry_subindex = 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); if (slaves.size() != 1) {