Added getSingleMasterIndex() for command-line tool.

This commit is contained in:
Florian Pose
2010-03-11 15:17:25 +01:00
parent ddaee8a1fc
commit aa0b667b4f
15 changed files with 27 additions and 96 deletions
+1 -7
View File
@@ -85,7 +85,6 @@ string CommandDownload::helpString() const
void CommandDownload::execute(const StringVector &args)
{
stringstream strIndex, strSubIndex, err;
MasterIndexList masterIndices;
ec_ioctl_slave_sdo_download_t data;
unsigned int number;
const DataType *dataType = NULL;
@@ -115,12 +114,7 @@ void CommandDownload::execute(const StringVector &args)
}
data.sdo_entry_subindex = number;
masterIndices = getMasterIndices();
if (masterIndices.size() != 1) {
err << getName() << " requires to select a single master!";
throwInvalidUsageException(err);
}
MasterDevice m(masterIndices.front());
MasterDevice m(getSingleMasterIndex());
m.open(MasterDevice::ReadWrite);
slaves = selectedSlaves(m);
if (slaves.size() != 1) {