mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-09-25 19:43:49 +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:
@@ -32,6 +32,7 @@
|
||||
using namespace std;
|
||||
|
||||
#include "CommandSiiRead.h"
|
||||
#include "MasterDevice.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -73,7 +74,7 @@ string CommandSiiRead::helpString() const
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
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 @@ void CommandSiiRead::execute(MasterDevice &m, const StringVector &args)
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user