SlaveInterface.cpp
Go to the documentation of this file.
1#include "SlaveInterface.h"
2
3#include "Bus.h"
5
7{
8
13
14 /**
15 * This returns the slave number of the slave on the bus +1 because slave 0 is the master
16 * @return index in ec_slave array
17 */
18 std::uint16_t
20 {
21 return static_cast<std::uint16_t>(slaveIdentifier.slaveIndex);
22 }
23
24 bool
26 {
27 return not hasError();
28 }
29
30 const SlaveIdentifier&
35
36 void
37 SlaveInterface::setName(const std::string& name)
38 {
39 slaveIdentifier.setName(name);
40 }
41
42 void
43 SlaveInterface::setParentDeviceName(const std::string& name)
44 {
45 slaveIdentifier.setParentDeviceName(name);
46 }
47
48 void
55
62
63} // namespace armarx::control::ethercat
The SlaveIdentifier class is a POD-type representing a unique set of values identifying an EtherCAT s...
SlaveErrorRegistersDevicePtr getErrorRegistersDevice() const
SlaveErrorRegistersDevicePtr errorRegistersDevice
virtual bool hasError()=0
This function indicates if there is a error or Problem with this slave.
virtual bool handleErrors()
This tries to clear oder fix the errors or problems of the slave or just gives detailed information a...
virtual void setName(const std::string &name)
SlaveInterface(const SlaveIdentifier &slaveIdentifier)
void setParentDeviceName(const std::string &name)
const SlaveIdentifier & getSlaveIdentifier() const
std::uint16_t getSlaveNumber() const
This returns the slave number of the slave on the bus +1 because slave 0 is the master.
void setErrorRegistersDevice(SlaveErrorRegistersDevicePtr errorRegistersDevice)
#define ARMARX_CHECK_IS_NULL(ptr)
This macro evaluates whether ptr is null and if it turns out to be false it will throw an ExpressionE...
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
std::shared_ptr< SlaveErrorRegistersDevice > SlaveErrorRegistersDevicePtr