8#define MAX_FILE_SIZE 9000
9#define MAX_FILE_LIST_LENGTH 30
39 inline static const std::map<State, std::map<State, State>>
152 uint16_t
index, uint8_t subindex)
override {
162 [[nodiscard]] std::variant<MotionMasterError, std::list<std::string>>
175 [[nodiscard]] std::variant<MotionMasterError, std::vector<uint8_t>>
read_file(
176 const std::string& file_name)
override {
190 const std::string& file_name,
const std::vector<uint8_t>& content,
191 std::function<
void(uint8_t)> progress_callback)
override {
230 [[nodiscard]]
virtual bool has_pdos() {
return false; };
Definition: ethercat_slave.h:11
virtual bool has_pdos()
Check if PDO mapping is available.
Definition: ethercat_slave.h:230
std::variant< MotionMasterError, std::list< std::string > > get_file_list() override
Get the list of available files on the device.
Definition: ethercat_slave.h:163
EthercatSlave(EthercatSlave const &)
Definition: ethercat_slave.h:15
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:189
VirtualParameter * get_virtual_parameter(uint16_t index, uint8_t subindex) override
Get a configuration parameter by its index/subindex.
Definition: ethercat_slave.h:151
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:175
static const std::map< FoeError, std::string > foe_error_messages_
Definition: ethercat_slave.h:85
virtual State get_state(bool force_refresh) const
Get the slave EtherCAT state.
Definition: ethercat_slave.h:237
Protocol get_protocol() const override
Get the protocol the device uses.
Definition: ethercat_slave.h:118
static const std::map< State, std::map< State, State > > ecat_state_machine_table_
Definition: ethercat_slave.h:40
State
Definition: ethercat_slave.h:19
uint16_t obytes
Definition: ethercat_slave.h:28
virtual void send_pdos(const uint8_t *process_data)
Definition: ethercat_slave.h:270
std::list< VirtualParameter * > get_all_virtual_parameters() override
Get all configuration parameters from a slave.
Definition: ethercat_slave.h:137
virtual void update_pdo_mapping_od()
Definition: ethercat_slave.h:268
virtual MotionMasterError write_sii(const std::vector< uint8_t > &content)
Write the SII file content onto an EtherCAT slave.
Definition: ethercat_slave.h:264
FoeError
Definition: ethercat_slave.h:71
MotionMasterError remove_file(const std::string &file_name) override
Remove a file from the flash memory.
Definition: ethercat_slave.h:202
virtual void receive_pdos(const uint8_t *process_data)
Definition: ethercat_slave.h:269
~EthercatSlave()
Definition: ethercat_slave.h:17
virtual bool request_state_switch(State state)
Definition: ethercat_slave.h:271
uint16_t get_device_id() const override
Get the ID (absolute position) of the EtherCAT slave in the EtherCAT chain.
Definition: ethercat_slave.h:104
virtual bool has_firmware()
Check if the slave has a firmware installed.
Definition: ethercat_slave.h:212
uint16_t ibytes
Definition: ethercat_slave.h:29
virtual bool set_state(State state, uint32_t timeout_ms=10000)
Change the EtherCAT state of the slave.
Definition: ethercat_slave.h:253
bool is_operational() const override
Request the current slave state.
Definition: ethercat_slave.h:221
Type get_device_type() const override
Get the device type.
Definition: ethercat_slave.h:127
EthercatSlave()
Definition: ethercat_slave.h:13
uint16_t get_hardware_id() const override
Get the hardware ID.
Definition: ethercat_slave.h:111
Definition: motion_master_error.h:6
Definition: virtual_device.h:20
Protocol
Definition: virtual_device.h:22
Type
Definition: virtual_device.h:24
Definition: virtual_parameter.h:9
uint16_t index
Definition: co_dictionary.h:0