Motion Master
Loading...
Searching...
No Matches
MockMaster Class Reference

#include <mock_master.h>

Inheritance diagram for MockMaster:
Collaboration diagram for MockMaster:

Public Member Functions

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

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: