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
+8 -1
View File
@@ -34,6 +34,7 @@ using namespace std;
#include "CommandSiiWrite.h"
#include "sii_crc.h"
#include "MasterDevice.h"
/*****************************************************************************/
@@ -75,7 +76,7 @@ string CommandSiiWrite::helpString() const
/****************************************************************************/
void CommandSiiWrite::execute(MasterDevice &m, const StringVector &args)
void CommandSiiWrite::execute(const StringVector &args)
{
stringstream err;
ec_ioctl_slave_sii_t data;
@@ -87,6 +88,12 @@ void CommandSiiWrite::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());
if (args[0] == "-") {
loadSiiData(&data, cin);
} else {