mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-09-23 02:23:47 +08:00
Open master device as late as possible.
This commit is contained in:
@@ -80,6 +80,7 @@ string CommandSoeWrite::helpString() const
|
||||
|
||||
void CommandSoeWrite::execute(const StringVector &args)
|
||||
{
|
||||
MasterIndexList masterIndices;
|
||||
stringstream strIdn, err;
|
||||
const DataType *dataType = NULL;
|
||||
ec_ioctl_slave_soe_write_t ioctl;
|
||||
@@ -98,11 +99,12 @@ void CommandSoeWrite::execute(const StringVector &args)
|
||||
throwInvalidUsageException(err);
|
||||
}
|
||||
|
||||
if (getMasterIndices().size() != 1) {
|
||||
masterIndices = getMasterIndices();
|
||||
if (masterIndices.size() != 1) {
|
||||
err << getName() << " requires to select a single master!";
|
||||
throwInvalidUsageException(err);
|
||||
}
|
||||
MasterDevice m(getMasterIndices().front());
|
||||
MasterDevice m(masterIndices.front());
|
||||
m.open(MasterDevice::ReadWrite);
|
||||
slaves = selectedSlaves(m);
|
||||
if (slaves.size() != 1) {
|
||||
|
||||
Reference in New Issue
Block a user