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
+7 -1
View File
@@ -32,6 +32,7 @@
using namespace std;
#include "CommandRegRead.h"
#include "MasterDevice.h"
/*****************************************************************************/
@@ -78,7 +79,7 @@ string CommandRegRead::helpString() const
/****************************************************************************/
void CommandRegRead::execute(MasterDevice &m, const StringVector &args)
void CommandRegRead::execute(const StringVector &args)
{
SlaveList slaves;
ec_ioctl_slave_reg_t data;
@@ -141,6 +142,11 @@ void CommandRegRead::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);