diff -r c5d6e28eec91 -r 006244d53f68 tool/Command.cpp --- a/tool/Command.cpp Mon Jul 28 14:06:03 2008 +0000 +++ b/tool/Command.cpp Mon Jul 28 14:28:43 2008 +0000 @@ -42,6 +42,27 @@ position = p; }; +/*****************************************************************************/ + +void Command::setDomain(int d) +{ + domain = d; +}; + +/*****************************************************************************/ + +void Command::setDataType(const string &t) +{ + dataType = t; +}; + +/*****************************************************************************/ + +void Command::setForce(bool f) +{ + force = f; +}; + /****************************************************************************/ bool Command::matchesSubstr(const string &cmd) const @@ -226,6 +247,31 @@ /****************************************************************************/ +Command::DomainList Command::selectedDomains(MasterDevice &m) +{ + ec_ioctl_domain_t d; + DomainList list; + + if (domain == -1) { + ec_ioctl_master_t master; + unsigned int i; + + m.getMaster(&master); + + for (i = 0; i < master.domain_count; i++) { + m.getDomain(&d, i); + list.push_back(d); + } + } else { + m.getDomain(&d, domain); + list.push_back(d); + } + + return list; +} + +/****************************************************************************/ + string Command::alStateString(uint8_t state) { switch (state) {