#include <mock_slave.h>
◆ MockSlave()
MockSlave::MockSlave |
( |
uint16_t | id | ) |
|
|
explicit |
◆ get_all_virtual_parameters()
Get all available configuration parameters on the virtual device.
- Returns
- a list of pointers to all available configuration parameters
Implements VirtualDevice.
◆ get_device_id()
uint16_t MockSlave::get_device_id |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Get the device ID.
- Returns
- the device ID
Implements VirtualDevice.
◆ get_device_type()
◆ get_file_list()
std::variant< MotionMasterError, std::list< std::string > > MockSlave::get_file_list |
( |
| ) |
|
|
nodiscardoverridevirtual |
◆ get_hardware_id()
uint16_t MockSlave::get_hardware_id |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Get the hardware ID.
- Returns
- the hardware ID
Implements VirtualDevice.
◆ get_protocol()
◆ get_virtual_parameter()
VirtualParameter * MockSlave::get_virtual_parameter |
( |
uint16_t | index, |
|
|
uint8_t | subindex ) |
|
nodiscardoverridevirtual |
Get a configuration parameter.
- Parameters
-
index | configuration parameter index |
subindex | configuration parameter index |
- Returns
- a pointer to a configuration parameter
Implements VirtualDevice.
◆ is_operational()
bool MockSlave::is_operational |
( |
| ) |
const |
|
nodiscardoverridevirtual |
Check if the device is operational.
- Returns
- true if operational, false otherwise
Implements VirtualDevice.
◆ read_file()
std::variant< MotionMasterError, std::vector< uint8_t > > MockSlave::read_file |
( |
const std::string & | file_name | ) |
|
|
nodiscardoverridevirtual |
Get the file content from a file from the flash memory.
- Parameters
-
file_name | name of the file in the flash memory |
- Returns
- MotionMasterError or file content
Implements VirtualDevice.
◆ remove_file()
Remove the file from the flash memory.
- Parameters
-
file_name | name of the file in the flash memory |
- Returns
- error
Implements VirtualDevice.
◆ write_file()
MotionMasterError MockSlave::write_file |
( |
const std::string & | file_name, |
|
|
const std::vector< uint8_t > & | content, |
|
|
std::function< void(uint8_t)> | progress_callback ) |
|
overridevirtual |
Write the file to the flash memory.
- Parameters
-
file_name | the name of the file to be written |
content | the content of the file to be written |
progress_callback | function to call for progress changes |
- Returns
- error
Implements VirtualDevice.
The documentation for this class was generated from the following files: