tool/CommandSlaves.cpp
changeset 1160 f02ff486b313
parent 1157 04d1c950cf9d
child 1220 15e8768b304f
equal deleted inserted replaced
1159:25cc77cf3993 1160:f02ff486b313
   100 void CommandSlaves::listSlaves(
   100 void CommandSlaves::listSlaves(
   101         MasterDevice &m,
   101         MasterDevice &m,
   102         const SlaveList &slaves
   102         const SlaveList &slaves
   103         )
   103         )
   104 {
   104 {
   105     unsigned int numSlaves, i;
   105     ec_ioctl_master_t master;
       
   106     unsigned int i;
   106     ec_ioctl_slave_t slave;
   107     ec_ioctl_slave_t slave;
   107     uint16_t lastAlias, aliasIndex;
   108     uint16_t lastAlias, aliasIndex;
   108     Info info;
   109     Info info;
   109     typedef list<Info> InfoList;
   110     typedef list<Info> InfoList;
   110     InfoList infoList;
   111     InfoList infoList;
   111     InfoList::const_iterator iter;
   112     InfoList::const_iterator iter;
   112     stringstream str;
   113     stringstream str;
   113     unsigned int maxPosWidth = 0, maxAliasWidth = 0,
   114     unsigned int maxPosWidth = 0, maxAliasWidth = 0,
   114                  maxRelPosWidth = 0, maxStateWidth = 0;
   115                  maxRelPosWidth = 0, maxStateWidth = 0;
   115     
   116     
   116     numSlaves = m.slaveCount();
   117     m.getMaster(&master);
   117 
   118 
   118     lastAlias = 0;
   119     lastAlias = 0;
   119     aliasIndex = 0;
   120     aliasIndex = 0;
   120     for (i = 0; i < numSlaves; i++) {
   121     for (i = 0; i < master.slave_count; i++) {
   121         m.getSlave(&slave, i);
   122         m.getSlave(&slave, i);
   122         
   123         
   123         if (slave.alias) {
   124         if (slave.alias) {
   124             lastAlias = slave.alias;
   125             lastAlias = slave.alias;
   125             aliasIndex = 0;
   126             aliasIndex = 0;