equal
deleted
inserted
replaced
83 /****************************************************************************/ |
83 /****************************************************************************/ |
84 |
84 |
85 void CommandDownload::execute(const StringVector &args) |
85 void CommandDownload::execute(const StringVector &args) |
86 { |
86 { |
87 stringstream strIndex, strSubIndex, err; |
87 stringstream strIndex, strSubIndex, err; |
88 MasterIndexList masterIndices; |
|
89 ec_ioctl_slave_sdo_download_t data; |
88 ec_ioctl_slave_sdo_download_t data; |
90 unsigned int number; |
89 unsigned int number; |
91 const DataType *dataType = NULL; |
90 const DataType *dataType = NULL; |
92 SlaveList slaves; |
91 SlaveList slaves; |
93 |
92 |
113 err << "Invalid SDO subindex '" << args[1] << "'!"; |
112 err << "Invalid SDO subindex '" << args[1] << "'!"; |
114 throwInvalidUsageException(err); |
113 throwInvalidUsageException(err); |
115 } |
114 } |
116 data.sdo_entry_subindex = number; |
115 data.sdo_entry_subindex = number; |
117 |
116 |
118 masterIndices = getMasterIndices(); |
117 MasterDevice m(getSingleMasterIndex()); |
119 if (masterIndices.size() != 1) { |
|
120 err << getName() << " requires to select a single master!"; |
|
121 throwInvalidUsageException(err); |
|
122 } |
|
123 MasterDevice m(masterIndices.front()); |
|
124 m.open(MasterDevice::ReadWrite); |
118 m.open(MasterDevice::ReadWrite); |
125 slaves = selectedSlaves(m); |
119 slaves = selectedSlaves(m); |
126 if (slaves.size() != 1) { |
120 if (slaves.size() != 1) { |
127 throwSingleSlaveRequired(slaves.size()); |
121 throwSingleSlaveRequired(slaves.size()); |
128 } |
122 } |