#include <virtual_device_manager.h>
◆ VirtualDeviceManager()
VirtualDeviceManager::VirtualDeviceManager |
( |
Notifier & |
notifier | ) |
|
|
explicit |
◆ ~VirtualDeviceManager()
VirtualDeviceManager::~VirtualDeviceManager |
( |
| ) |
|
◆ clear()
void VirtualDeviceManager::clear |
( |
| ) |
|
Remove all of the available devices.
◆ disable_devices()
bool VirtualDeviceManager::disable_devices |
( |
bool |
blocking = false | ) |
|
Used to "disable" all of the available devices before certain operations.
For instance, all of the EtherCAT devices need to be switched to PREOP
- Attention
- Must be implemented as non-blocking!
- Returns
- true if all of the devices are disabled, false otherwise
◆ execute()
int32_t VirtualDeviceManager::execute |
( |
uint64_t |
pending_signals | ) |
const |
Execute the main loop of the Virtual Device Manager.
- Parameters
-
pending_signals | number of time intervals that passed since the last call to this function |
- Returns
- error if any
◆ get_device()
VirtualDevice * VirtualDeviceManager::get_device |
( |
uint32_t |
address | ) |
const |
Get a virtual device pointer by its ID.
- Parameters
-
- Returns
- a pointer to the requested device if available, or nullptr if not
◆ get_devices()
const std::map< uint32_t, VirtualDevice * > & VirtualDeviceManager::get_devices |
( |
| ) |
const |
Get all available virtual devices.
- Returns
- a map of (pointers to) all available devices
◆ get_responding_device_count()
int VirtualDeviceManager::get_responding_device_count |
( |
| ) |
const |
Get the count of currently responding devices.
- Returns
- number of responding devices
◆ init()
bool VirtualDeviceManager::init |
( |
| ) |
|
Initialize the Virtual Device Manager.
- Returns
- true if initialization is successful, false otherwise
- Exceptions
-
- Attention
- Limit the address range in order to avoid confusing the device address with the device (chain) position
◆ is_initialized()
bool VirtualDeviceManager::is_initialized |
( |
| ) |
const |
Check if VDM has successfully initialized.
- Returns
- true if successfully initialized, false otherwise
◆ is_restart_required()
bool VirtualDeviceManager::is_restart_required |
( |
| ) |
|
Check if VDM restart is required.
Used to enable outside objects check whether the VDM should be restarted
◆ is_running()
bool VirtualDeviceManager::is_running |
( |
| ) |
const |
Check if VDM is running.
- Returns
- true if currently running, false otherwise
◆ restart()
size_t VirtualDeviceManager::restart |
( |
| ) |
|
Restart the EtherCAT master.
- Returns
- the number of available devices
◆ set_restart_required()
void VirtualDeviceManager::set_restart_required |
( |
bool |
restart_required | ) |
|
Mark the VDM as restart required.
Used to enable outside objects set whether the VDM should be restarted
- Parameters
-
restart_required | mark as restart required |
◆ setMonitorMachinePtr()
void VirtualDeviceManager::setMonitorMachinePtr |
( |
void * |
pMM | ) |
|
|
inline |
◆ start()
size_t VirtualDeviceManager::start |
( |
| ) |
|
Start the EtherCAT master.
- Returns
- the number of available devices
◆ stop()
void VirtualDeviceManager::stop |
( |
| ) |
|
Stop the EtherCAT master.
- Parameters
-
send_notifications | send stopping notifications to clients |
◆ stop_devices()
bool VirtualDeviceManager::stop_devices |
( |
| ) |
|
Used to "stop" all of the available devices before certain operations.
For instance, all of the CiA402 devices need to be (quick) stopped before stopping the VDM itself
- Attention
- Must be implemented as non-blocking!
- Returns
- true if all of the devices have been stopped, false otherwise
The documentation for this class was generated from the following files: