mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-08-18 00:57:23 +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:
@@ -34,6 +34,7 @@ using namespace std;
|
||||
|
||||
#include "CommandRegWrite.h"
|
||||
#include "sii_crc.h"
|
||||
#include "MasterDevice.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -80,7 +81,7 @@ string CommandRegWrite::helpString() const
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
void CommandRegWrite::execute(MasterDevice &m, const StringVector &args)
|
||||
void CommandRegWrite::execute(const StringVector &args)
|
||||
{
|
||||
stringstream strOffset, err;
|
||||
ec_ioctl_slave_reg_t data;
|
||||
@@ -100,6 +101,12 @@ void CommandRegWrite::execute(MasterDevice &m, const StringVector &args)
|
||||
err << "Invalid offset '" << args[0] << "'!";
|
||||
throwInvalidUsageException(err);
|
||||
}
|
||||
|
||||
if (getMasterIndices().size() != 1) {
|
||||
err << getName() << " requires to select a single master!";
|
||||
throwInvalidUsageException(err);
|
||||
}
|
||||
MasterDevice m(getMasterIndices().front());
|
||||
|
||||
if (getDataType().empty()) {
|
||||
if (args[1] == "-") {
|
||||
|
||||
Reference in New Issue
Block a user