Go to the documentation of this file.
35 #ifndef ETHERCAT_DEVICE_H
36 #define ETHERCAT_DEVICE_H
41 #include <ethercat/ethercat_defs.h>
42 #include <al/ethercat_slave_handler.h>
48 #include <diagnostic_msgs/DiagnosticArray.h>
108 void collect(
EthercatCom *com, EtherCAT_SlaveHandler *sh);
137 virtual void construct(EtherCAT_SlaveHandler *sh,
int &start_address);
151 virtual void packCommand(
unsigned char *buffer,
bool halt,
bool reset) {}
153 virtual bool unpackState(
unsigned char *this_buffer,
unsigned char *prev_buffer) {
return true;}
161 virtual void multiDiagnostics(vector<diagnostic_msgs::DiagnosticStatus> &vec,
unsigned char *buffer);
187 virtual bool publishTrace(
const string &reason,
unsigned level,
unsigned delay) {
return false;}
194 static int writeData(
EthercatCom *com, EtherCAT_SlaveHandler *sh, EC_UINT address,
void const* buffer, EC_UINT
length, AddrMode addrMode);
202 static int readData(
EthercatCom *com, EtherCAT_SlaveHandler *sh, EC_UINT address,
void *buffer, EC_UINT
length, AddrMode addrMode);
210 static int readWriteData(
EthercatCom *com, EtherCAT_SlaveHandler *sh, EC_UINT address,
void *buffer, EC_UINT
length, AddrMode addrMode);
212 return readWriteData(com, sh_, address, buffer,
length, addrMode);
217 EtherCAT_SlaveHandler *
sh_;
bool writeData(EthercatCom *com, EtherCAT_SlaveHandler *sh, EthercatDevice::AddrMode addrMode, unsigned num) const
int writeData(EthercatCom *com, EC_UINT address, void const *buffer, EC_UINT length, AddrMode addrMode)
bool isGreaterThan(unsigned value) const
pthread_mutex_t diagnosticsLock_
bool readData(EthercatCom *com, EtherCAT_SlaveHandler *sh, EthercatDevice::AddrMode addrMode, unsigned num)
pthread_mutex_t newDiagnosticsIndexLock_
int readWriteData(EthercatCom *com, EC_UINT address, void *buffer, EC_UINT length, AddrMode addrMode)
int devicesRespondingToNodeAddress_
uint64_t forwardedRxErrorTotal
unsigned newDiagnosticsIndex_
bool isClosed(unsigned port)
virtual bool publishTrace(const string &reason, unsigned level, unsigned delay)
Asks device to publish (motor) trace. Only works for devices that support it.
uint64_t invalidFrameTotal
EtherCAT_SlaveHandler * sh_
bool hasLink(unsigned port)
et1x00_error_counters errorCountersPrev_
diagnostic_updater::DiagnosticStatusWrapper diagnostic_status_
bool hasCommunication(unsigned port)
virtual void packCommand(unsigned char *buffer, bool halt, bool reset)
static const EC_UINT BASE_ADDR
unsigned int status_size_
ROSCONSOLE_DECL void initialize()
int readData(EthercatCom *com, EC_UINT address, void *buffer, EC_UINT length, AddrMode addrMode)
struct EthercatPortDiagnostics __attribute__
unsigned int command_size_
bool errorCountersMayBeCleared_
virtual bool unpackState(unsigned char *this_buffer, unsigned char *prev_buffer)
uint8_t forwarded_rx_error[4]
ethercat_hardware
Author(s): Rob Wheeler
, Derek King
autogenerated on Thu Sep 26 2024 02:44:04