tool/CommandSoeWrite.cpp
changeset 1869 14f634f5b613
parent 1868 489ea0becd74
child 1870 0cee1fb7f0fd
equal deleted inserted replaced
1868:489ea0becd74 1869:14f634f5b613
    78 
    78 
    79 /****************************************************************************/
    79 /****************************************************************************/
    80 
    80 
    81 void CommandSoeWrite::execute(const StringVector &args)
    81 void CommandSoeWrite::execute(const StringVector &args)
    82 {
    82 {
       
    83 	MasterIndexList masterIndices;
    83     stringstream strIdn, err;
    84     stringstream strIdn, err;
    84     const DataType *dataType = NULL;
    85     const DataType *dataType = NULL;
    85     ec_ioctl_slave_soe_write_t ioctl;
    86     ec_ioctl_slave_soe_write_t ioctl;
    86     SlaveList slaves;
    87     SlaveList slaves;
    87     size_t memSize;
    88     size_t memSize;
    96     } catch (runtime_error &e) {
    97     } catch (runtime_error &e) {
    97         err << "Invalid IDN '" << args[0] << "': " << e.what();
    98         err << "Invalid IDN '" << args[0] << "': " << e.what();
    98         throwInvalidUsageException(err);
    99         throwInvalidUsageException(err);
    99     }
   100     }
   100 
   101 
   101     if (getMasterIndices().size() != 1) {
   102 	masterIndices = getMasterIndices();
       
   103     if (masterIndices.size() != 1) {
   102         err << getName() << " requires to select a single master!";
   104         err << getName() << " requires to select a single master!";
   103         throwInvalidUsageException(err);
   105         throwInvalidUsageException(err);
   104     }
   106     }
   105     MasterDevice m(getMasterIndices().front());
   107     MasterDevice m(masterIndices.front());
   106     m.open(MasterDevice::ReadWrite);
   108     m.open(MasterDevice::ReadWrite);
   107     slaves = selectedSlaves(m);
   109     slaves = selectedSlaves(m);
   108     if (slaves.size() != 1) {
   110     if (slaves.size() != 1) {
   109         throwSingleSlaveRequired(slaves.size());
   111         throwSingleSlaveRequired(slaves.size());
   110     }
   112     }