mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-08-20 21:51:25 +08:00
Multi-master support for command-line tool. The --master option supports
ranges like '1-3,6,7-9'. The ioctl() interface version is checked.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
using namespace std;
|
||||
|
||||
#include "CommandData.h"
|
||||
#include "MasterDevice.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -63,7 +64,7 @@ string CommandData::helpString() const
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
void CommandData::execute(MasterDevice &m, const StringVector &args)
|
||||
void CommandData::execute(const StringVector &args)
|
||||
{
|
||||
DomainList domains;
|
||||
DomainList::const_iterator di;
|
||||
@@ -74,6 +75,12 @@ void CommandData::execute(MasterDevice &m, const StringVector &args)
|
||||
throwInvalidUsageException(err);
|
||||
}
|
||||
|
||||
if (getMasterIndices().size() != 1) {
|
||||
stringstream err;
|
||||
err << getName() << " requires to select a single master!";
|
||||
throwInvalidUsageException(err);
|
||||
}
|
||||
MasterDevice m(getMasterIndices().front());
|
||||
m.open(MasterDevice::Read);
|
||||
domains = selectedDomains(m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user