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:
Florian Pose
2010-02-24 16:27:11 +01:00
parent edf5fdf61f
commit f41dadb84f
61 changed files with 916 additions and 298 deletions

View File

@@ -33,6 +33,7 @@
using namespace std;
#include "CommandCStruct.h"
#include "MasterDevice.h"
/*****************************************************************************/
@@ -67,7 +68,7 @@ string CommandCStruct::helpString() const
/****************************************************************************/
void CommandCStruct::execute(MasterDevice &m, const StringVector &args)
void CommandCStruct::execute(const StringVector &args)
{
SlaveList slaves;
SlaveList::const_iterator si;
@@ -78,11 +79,16 @@ void CommandCStruct::execute(MasterDevice &m, const StringVector &args)
throwInvalidUsageException(err);
}
m.open(MasterDevice::Read);
slaves = selectedSlaves(m);
MasterIndexList::const_iterator mi;
for (mi = getMasterIndices().begin();
mi != getMasterIndices().end(); mi++) {
MasterDevice m(*mi);
m.open(MasterDevice::Read);
slaves = selectedSlaves(m);
for (si = slaves.begin(); si != slaves.end(); si++) {
generateSlaveCStruct(m, *si);
for (si = slaves.begin(); si != slaves.end(); si++) {
generateSlaveCStruct(m, *si);
}
}
}