Base Class For Controlling Devices. More...
#include <HC_API.h>
Inheritance diagram for ControlAPI::DeviceController:
Public Member Functions | |
| virtual std::string | className () override |
| virtual bool | checkCommandPackage (int deviceId, DeviceCommandPackage *package) |
| check validity of command package | |
| void | addDeviceInfo (DeviceInfo *dev) |
| Add a device to the controller. More... | |
| void | removeDeviceInfo (DeviceInfo *dev) |
| Remove an already added device. | |
| void | setDisconnectCallback (std::function< void(bool)> callback) |
| set a disconnected callback function to be called when the controller is disconnected. | |
| virtual void | disconnect (bool expected=false) |
| disconnect the controller, should handle both a manual disconnect and could be called from a comm error disconnect. set expected to false if called from a timeout error or unknown disconnect event. - error messages are printed. set expected to true if a manual disconnection is wanted.- info messages are printed. | |
| bool | isConnected () |
| returns true if the controller is currently connected. | |
| int | apiId () |
| the assigned Api Id of the controller | |
| void | setSimulated (bool simulated) |
| set the simulated flag on the controller - simulated controllers can simulate interaction with attached devices. can only be set before the controller is initialized. More... | |
| bool | isSimulated () |
| return if the controller is simulated. More... | |
Public Member Functions inherited from ControlAPI::LoggerFunctionality | |
| std::shared_ptr< spdlog::logger > | getLogger () |
| std::string | loggerName () |
Static Public Member Functions | |
| static std::string | staticClassName () |
Static Public Member Functions inherited from ControlAPI::LoggerFunctionality | |
| static std::string | staticClassName () |
Public Attributes | |
| std::string | alias |
| Alias of the controller. | |
| std::string | port |
| port for connecting, if the device is a serial device this can be "COM3" or "/dev/tty.***" | |
Additional Inherited Members | |
Protected Attributes inherited from ControlAPI::LoggerFunctionality | |
| std::shared_ptr< spdlog::logger > | logger |
| ControlSystem * | controlSystem = nullptr |
Detailed Description
Base Class For Controlling Devices.
Member Function Documentation
◆ addDeviceInfo()
| void ControlAPI::DeviceController::addDeviceInfo | ( | DeviceInfo * | dev | ) |
Add a device to the controller.
- Parameters
-
dev
◆ isSimulated()
| bool ControlAPI::DeviceController::isSimulated | ( | ) |
return if the controller is simulated.
- Returns
◆ setSimulated()
| void ControlAPI::DeviceController::setSimulated | ( | bool | simulated | ) |
set the simulated flag on the controller - simulated controllers can simulate interaction with attached devices. can only be set before the controller is initialized.
- Parameters
-
simulated
The documentation for this class was generated from the following file:
Public Member Functions inherited from