tool/CommandStates.cpp
changeset 1869 14f634f5b613
parent 1826 ec6223c3b7ec
child 1968 4f682084c643
equal deleted inserted replaced
1868:489ea0becd74 1869:14f634f5b613
    66 
    66 
    67 /****************************************************************************/
    67 /****************************************************************************/
    68 
    68 
    69 void CommandStates::execute(const StringVector &args)
    69 void CommandStates::execute(const StringVector &args)
    70 {
    70 {
       
    71 	MasterIndexList masterIndices;
    71     SlaveList slaves;
    72     SlaveList slaves;
    72     SlaveList::const_iterator si;
    73     SlaveList::const_iterator si;
    73     stringstream err;
    74     stringstream err;
    74     string stateStr;
    75     string stateStr;
    75     uint8_t state = 0x00;
    76     uint8_t state = 0x00;
    96     } else {
    97     } else {
    97         err << "Invalid state '" << args[0] << "'!";
    98         err << "Invalid state '" << args[0] << "'!";
    98         throwInvalidUsageException(err);
    99         throwInvalidUsageException(err);
    99     }
   100     }
   100 
   101 
       
   102 	masterIndices = getMasterIndices();
   101     MasterIndexList::const_iterator mi;
   103     MasterIndexList::const_iterator mi;
   102     for (mi = getMasterIndices().begin();
   104     for (mi = masterIndices.begin();
   103             mi != getMasterIndices().end(); mi++) {
   105             mi != masterIndices.end(); mi++) {
   104         MasterDevice m(*mi);
   106         MasterDevice m(*mi);
   105         m.open(MasterDevice::ReadWrite);
   107         m.open(MasterDevice::ReadWrite);
   106         slaves = selectedSlaves(m);
   108         slaves = selectedSlaves(m);
   107 
   109 
   108         for (si = slaves.begin(); si != slaves.end(); si++) {
   110         for (si = slaves.begin(); si != slaves.end(); si++) {