8#define MAX_FILE_LIST_LENGTH 30
38 inline static const std::map<State, std::map<State, State>>
151 uint16_t
index, uint8_t subindex)
override {
161 [[nodiscard]] std::variant<MotionMasterError, std::list<std::string>>
174 [[nodiscard]] std::variant<MotionMasterError, std::vector<uint8_t>>
read_file(
175 const std::string& file_name)
override {
189 const std::string& file_name,
const std::vector<uint8_t>& content,
190 std::function<
void(uint8_t)> progress_callback)
override {
229 [[nodiscard]]
virtual bool has_pdos() {
return false; }
virtual bool has_pdos()
Check if PDO mapping is available.
Definition ethercat_slave.h:229
std::variant< MotionMasterError, std::list< std::string > > get_file_list() override
Get the list of available files on the device.
Definition ethercat_slave.h:162
EthercatSlave(EthercatSlave const &)
Definition ethercat_slave.h:14
MotionMasterError write_file(const std::string &file_name, const std::vector< uint8_t > &content, std::function< void(uint8_t)> progress_callback) override
Write raw content (bytes) into a file in the flash memory.
Definition ethercat_slave.h:188
VirtualParameter * get_virtual_parameter(uint16_t index, uint8_t subindex) override
Get a configuration parameter by its index/subindex.
Definition ethercat_slave.h:150
std::variant< MotionMasterError, std::vector< uint8_t > > read_file(const std::string &file_name) override
Return the raw content (bytes) of the requested file from the flash memory.
Definition ethercat_slave.h:174
static const std::map< FoeError, std::string > foe_error_messages_
Definition ethercat_slave.h:84
virtual State get_state(bool force_refresh) const
Get the slave EtherCAT state.
Definition ethercat_slave.h:236
Protocol get_protocol() const override
Get the protocol the device uses.
Definition ethercat_slave.h:117
static const std::map< State, std::map< State, State > > ecat_state_machine_table_
Definition ethercat_slave.h:39
State
Definition ethercat_slave.h:18
@ kSafeOp
Definition ethercat_slave.h:23
@ kPreOp
Definition ethercat_slave.h:21
@ kOp
Definition ethercat_slave.h:24
@ kUnspecified
Definition ethercat_slave.h:19
@ kBoot
Definition ethercat_slave.h:22
@ kInit
Definition ethercat_slave.h:20
uint16_t obytes
Definition ethercat_slave.h:27
virtual void send_pdos(const uint8_t *process_data)
Definition ethercat_slave.h:269
std::list< VirtualParameter * > get_all_virtual_parameters() override
Get all configuration parameters from a slave.
Definition ethercat_slave.h:136
virtual void update_pdo_mapping_od()
Definition ethercat_slave.h:267
virtual MotionMasterError write_sii(const std::vector< uint8_t > &content)
Write the SII file content onto an EtherCAT slave.
Definition ethercat_slave.h:263
FoeError
Definition ethercat_slave.h:70
@ kAccessDenied
Definition ethercat_slave.h:72
@ kNotBootstrap
Definition ethercat_slave.h:79
@ kProgramError
Definition ethercat_slave.h:81
@ kBootstrapOnly
Definition ethercat_slave.h:78
@ kNoRights
Definition ethercat_slave.h:80
@ kIllegal
Definition ethercat_slave.h:74
@ kAlreadyExists
Definition ethercat_slave.h:76
@ kNotFound
Definition ethercat_slave.h:71
@ kPacketNumberWrong
Definition ethercat_slave.h:75
@ kNoUser
Definition ethercat_slave.h:77
@ kDiskFull
Definition ethercat_slave.h:73
MotionMasterError remove_file(const std::string &file_name) override
Remove a file from the flash memory.
Definition ethercat_slave.h:201
virtual void receive_pdos(const uint8_t *process_data)
Definition ethercat_slave.h:268
~EthercatSlave()
Definition ethercat_slave.h:16
virtual bool request_state_switch(State state)
Definition ethercat_slave.h:270
uint16_t get_device_id() const override
Get the ID (absolute position) of the EtherCAT slave in the EtherCAT chain.
Definition ethercat_slave.h:103
virtual bool has_firmware()
Check if the slave has a firmware installed.
Definition ethercat_slave.h:211
uint16_t ibytes
Definition ethercat_slave.h:28
virtual bool set_state(State state, uint32_t timeout_ms=10000)
Change the EtherCAT state of the slave.
Definition ethercat_slave.h:252
bool is_operational() const override
Request the current slave state.
Definition ethercat_slave.h:220
Type get_device_type() const override
Get the device type.
Definition ethercat_slave.h:126
EthercatSlave()
Definition ethercat_slave.h:12
uint16_t get_hardware_id() const override
Get the hardware ID.
Definition ethercat_slave.h:110
Definition motion_master_error.h:6
Definition virtual_device.h:22
Protocol
Definition virtual_device.h:24
@ kEcat
Definition virtual_device.h:24
Type
Definition virtual_device.h:26
@ kUnspecified
Definition virtual_device.h:26
Definition virtual_parameter.h:9
uint16_t index
Definition co_dictionary.h:0