Class SimpleSlave

Inheritance Relationships

Base Type

  • public canopen::BasicSlave

Class Documentation

class SimpleSlave : public canopen::BasicSlave

Public Functions

inline SimpleSlave(io::TimerBase &timer, io::CanChannelBase &chan, const std::string &slave_config, const std::string &slave_bin, uint8_t node_id)
inline SimpleSlave(io::TimerBase &timer, io::CanChannelBase &chan, const std::string &slave_config, uint8_t node_id)
inline ~SimpleSlave()

Protected Functions

inline uint32_t GetValue(const uint16_t idx, const uint8_t subidx) const noexcept

This function gets an object value through the typed interface. Only supports object types that can fit in a 32-bit container.

Parameters:
  • idx – The index of the PDO.

  • subidx – The subindex of the PDO.

Returns:

value of object stored in a 32-bit container

inline void OnWrite(uint16_t idx, uint8_t subidx) noexcept override

This function is called when a value is written to the local object dictionary by an SDO or RPDO. Also copies the RPDO value to TPDO. A function from the class Device.

Parameters:
  • idx – The index of the PDO.

  • subidx – The subindex of the PDO.

inline void fake_periodic_messages()

This function is attached to a thread and sends periodic messages via 0x4004.

Protected Attributes

std::thread message_thread

Protected Static Functions

static inline uint32_t parse_vendor_id(const std::string &slave_config)