Introduced ec_master_domain_count() and ec_master_find_domain().
This commit is contained in:
parent
b6f05cafda
commit
e5f7d6f400
|
|
@ -1305,6 +1305,40 @@ ec_slave_t *ec_master_find_slave(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
unsigned int ec_master_domain_count(
|
||||
const ec_master_t *master /**< EtherCAT master. */
|
||||
)
|
||||
{
|
||||
const ec_domain_t *domain;
|
||||
unsigned int count = 0;
|
||||
|
||||
list_for_each_entry(domain, &master->domains, list) {
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
ec_domain_t *ec_master_find_domain(
|
||||
ec_master_t *master, /**< EtherCAT master. */
|
||||
unsigned int index /**< Domain index. */
|
||||
)
|
||||
{
|
||||
ec_domain_t *domain;
|
||||
|
||||
list_for_each_entry(domain, &master->domains, list) {
|
||||
if (index--)
|
||||
continue;
|
||||
return domain;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Realtime interface
|
||||
*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -197,6 +197,9 @@ void ec_master_clear_eoe_handlers(ec_master_t *);
|
|||
#endif
|
||||
void ec_master_destroy_slaves(ec_master_t *);
|
||||
|
||||
unsigned int ec_master_domain_count(const ec_master_t *);
|
||||
ec_domain_t *ec_master_find_domain(ec_master_t *, unsigned int);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue