Motion Master
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MockMaster Class Reference

#include <mock_master.h>

Inheritance diagram for MockMaster:
Inheritance graph
[legend]
Collaboration diagram for MockMaster:
Collaboration graph
[legend]

Public Member Functions

 MockMaster (uint16_t devices)
 
 ~MockMaster () override
 
size_t start () override
 Start the mock master. More...
 
void stop () override
 Stop the mock master. More...
 
size_t restart () override
 Restart the mock master. More...
 
int32_t execute (uint64_t pending_signals) override
 Main mock master loop function to be executed at one millisecond interval. More...
 
bool is_running () override
 
int get_slaves_responding () override
 Return the number of slaves. More...
 
std::list< VirtualDevice * > get_slaves () override
 Get all of the available slaves. More...
 
bool disable_all_slaves () override
 Switch all slaves to PREOP. More...
 
void abort_all_client_requests () override
 
- Public Member Functions inherited from EthercatMaster
virtual ~EthercatMaster ()=default
 
virtual size_t start ()=0
 Start the EtherCAT master. More...
 
virtual void stop ()=0
 Stop the EtherCAT master. More...
 
virtual size_t restart ()=0
 Restart the EtherCAT master. More...
 
virtual int32_t execute (uint64_t pending_signals)=0
 Main EtherCAT master loop function to be executed at one millisecond interval. More...
 
virtual bool is_running ()=0
 Check if the EtherCAT master is currently running. More...
 
virtual int get_slaves_responding ()=0
 Return the number of slaves actually responding on the bus. More...
 
virtual std::list< VirtualDevice * > get_slaves ()=0
 Get all of the available slaves. More...
 
virtual bool disable_all_slaves ()=0
 Switch all slaves to PREOP. More...
 
virtual void abort_all_client_requests ()=0
 

Constructor & Destructor Documentation

◆ MockMaster()

MockMaster::MockMaster ( uint16_t  devices)
explicit

◆ ~MockMaster()

MockMaster::~MockMaster ( )
override

Member Function Documentation

◆ abort_all_client_requests()

void MockMaster::abort_all_client_requests ( )
inlineoverridevirtual

Implements EthercatMaster.

◆ disable_all_slaves()

bool MockMaster::disable_all_slaves ( )
overridevirtual

Switch all slaves to PREOP.

Returns
true on success, false otherwise

Implements EthercatMaster.

◆ execute()

int32_t MockMaster::execute ( uint64_t  pending_signals)
overridevirtual

Main mock master loop function to be executed at one millisecond interval.

Returns
error if any

Implements EthercatMaster.

◆ get_slaves()

std::list< VirtualDevice * > MockMaster::get_slaves ( )
overridevirtual

Get all of the available slaves.

Returns
map of pointers to available slaves

Implements EthercatMaster.

◆ get_slaves_responding()

int MockMaster::get_slaves_responding ( )
overridevirtual

Return the number of slaves.

Returns
total number of slaves

Implements EthercatMaster.

◆ is_running()

bool MockMaster::is_running ( )
overridevirtual

/brief Check if the mock master is currently running

/return true if currently running, false otherwise

Implements EthercatMaster.

◆ restart()

size_t MockMaster::restart ( )
overridevirtual

Restart the mock master.

This function deactivates the master (and slaves) and activates it again

Returns
the number of responding slaves

Implements EthercatMaster.

◆ start()

size_t MockMaster::start ( )
overridevirtual

Start the mock master.

Returns
the number of initially responding slaves

Implements EthercatMaster.

◆ stop()

void MockMaster::stop ( )
overridevirtual

Stop the mock master.

Implements EthercatMaster.


The documentation for this class was generated from the following files: