Removed MasterDevice::slaveCount().
This commit is contained in:
parent
ddc95f672f
commit
94177f81b5
1
TODO
1
TODO
|
|
@ -20,7 +20,6 @@ Version 1.4.0:
|
|||
- Data type abbreviations.
|
||||
- Add a -n (numeric) switch.
|
||||
- Check for options, remove global variables.
|
||||
- Remove MasterDevice::slaveCount().
|
||||
- Add 'etherlab version'.
|
||||
|
||||
Future issues:
|
||||
|
|
|
|||
|
|
@ -108,15 +108,18 @@ void Command::throwSingleSlaveRequired(unsigned int size) const
|
|||
|
||||
Command::SlaveList Command::selectedSlaves(MasterDevice &m)
|
||||
{
|
||||
unsigned int numSlaves = m.slaveCount(), i, aliasIndex;
|
||||
ec_ioctl_master_t master;
|
||||
unsigned int i, aliasIndex;
|
||||
uint16_t lastAlias;
|
||||
ec_ioctl_slave_t slave;
|
||||
SlaveList list;
|
||||
|
||||
m.getMaster(&master);
|
||||
|
||||
if (alias == -1) { // no alias given
|
||||
if (position == -1) { // no alias and position given
|
||||
// all items
|
||||
for (i = 0; i < numSlaves; i++) {
|
||||
for (i = 0; i < master.slave_count; i++) {
|
||||
m.getSlave(&slave, i);
|
||||
list.push_back(slave);
|
||||
}
|
||||
|
|
@ -129,7 +132,7 @@ Command::SlaveList Command::selectedSlaves(MasterDevice &m)
|
|||
if (position == -1) { // alias, but no position given
|
||||
// take all items with a given alias
|
||||
lastAlias = 0;
|
||||
for (i = 0; i < numSlaves; i++) {
|
||||
for (i = 0; i < master.slave_count; i++) {
|
||||
m.getSlave(&slave, i);
|
||||
if (slave.alias) {
|
||||
lastAlias = slave.alias;
|
||||
|
|
@ -141,7 +144,7 @@ Command::SlaveList Command::selectedSlaves(MasterDevice &m)
|
|||
} else { // alias and position given
|
||||
lastAlias = 0;
|
||||
aliasIndex = 0;
|
||||
for (i = 0; i < numSlaves; i++) {
|
||||
for (i = 0; i < master.slave_count; i++) {
|
||||
m.getSlave(&slave, i);
|
||||
if (slave.alias && slave.alias == (uint16_t) alias) {
|
||||
lastAlias = slave.alias;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ void CommandSlaves::listSlaves(
|
|||
const SlaveList &slaves
|
||||
)
|
||||
{
|
||||
unsigned int numSlaves, i;
|
||||
ec_ioctl_master_t master;
|
||||
unsigned int i;
|
||||
ec_ioctl_slave_t slave;
|
||||
uint16_t lastAlias, aliasIndex;
|
||||
Info info;
|
||||
|
|
@ -113,11 +114,11 @@ void CommandSlaves::listSlaves(
|
|||
unsigned int maxPosWidth = 0, maxAliasWidth = 0,
|
||||
maxRelPosWidth = 0, maxStateWidth = 0;
|
||||
|
||||
numSlaves = m.slaveCount();
|
||||
m.getMaster(&master);
|
||||
|
||||
lastAlias = 0;
|
||||
aliasIndex = 0;
|
||||
for (i = 0; i < numSlaves; i++) {
|
||||
for (i = 0; i < master.slave_count; i++) {
|
||||
m.getSlave(&slave, i);
|
||||
|
||||
if (slave.alias) {
|
||||
|
|
|
|||
|
|
@ -68,16 +68,6 @@ void MasterDevice::close()
|
|||
|
||||
/****************************************************************************/
|
||||
|
||||
unsigned int MasterDevice::slaveCount()
|
||||
{
|
||||
ec_ioctl_master_t data;
|
||||
|
||||
getMaster(&data);
|
||||
return data.slave_count;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
void MasterDevice::getMaster(ec_ioctl_master_t *data)
|
||||
{
|
||||
if (ioctl(fd, EC_IOCTL_MASTER, data) < 0) {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ class MasterDevice
|
|||
void open(Permissions);
|
||||
void close();
|
||||
|
||||
unsigned int slaveCount();
|
||||
|
||||
void getMaster(ec_ioctl_master_t *);
|
||||
void getConfig(ec_ioctl_config_t *, unsigned int);
|
||||
void getConfigPdo(ec_ioctl_config_pdo_t *, unsigned int, uint8_t,
|
||||
|
|
|
|||
Loading…
Reference in New Issue