![]() |
|
IpbusMock
1.0.0
Library which integrates IPbus use in Phoenix
|
#include <HwInterface.h>
Public Member Functions | |
| Node & | getNode (const std::string nodeId) |
| Retrieves a node by its identifier. | |
| HwInterface (std::string connectionFilePath, std::string connectionId, PSocketMode::PSocketMode _mock_mode, std::string mock_directory="") | |
| Constructor for the HwInterface class. | |
| virtual | ~HwInterface () |
| Destructor for the HwInterface class. | |
Public Attributes | |
| friend | Node |
Protected Member Functions | |
| uint32_t | read (const std::string nodeId) const |
| Reads data from a specific node. | |
| std::vector< uint32_t > | readBlock (const std::string &nodeId, const uint32_t &aSize) const |
| Reads a block of data from a specific node. | |
| bool | write (const std::string &nodeId, const uint32_t &aValue) |
| Writes data to a specific node. | |
| bool | writeBlock (const std::string &nodeId, const std::vector< uint32_t > &aValues) const |
| Writes a block of data to a specific node. | |
Protected Attributes | |
| std::string | connectionFilePath |
| std::string | connectionId |
| std::string | mock_directory |
| PSocketMode::PSocketMode | mock_mode |
| std::map< std::string, std::unique_ptr< Node > > | nodes |
Static Protected Attributes | |
| static SocketManager | manager = SocketManager() |
Definition at line 38 of file HwInterface.h.
| HwInterface::HwInterface | ( | std::string | connectionFilePath, |
| std::string | connectionId, | ||
| PSocketMode::PSocketMode | mock_mode, | ||
| std::string | mock_directory = "" ) |
Constructor for the HwInterface class.
Initializes the hardware interface, sets the mock mode, and adds a server socket for communication.
| connectionFilePath | Path to the connection file. |
| connectionId | Identifier for the connection. |
| mock_mode | Mode for mock operation (e.g., MOCK_RECORD or MOCK_PLAYBACK). |
| mock_directory | Directory for mock data storage (default: "/tmp"). |
Definition at line 22 of file HwInterface.cpp.
References connectionFilePath, connectionId, manager, mock_directory, and mock_mode.
|
virtual |
Destructor for the HwInterface class.
Cleans up resources, including deleting all dynamically allocated Node objects and clearing the nodes map.
Definition at line 46 of file HwInterface.cpp.
References connectionFilePath, connectionId, and nodes.
| Node & HwInterface::getNode | ( | const std::string | nodeId | ) |
Retrieves a node by its identifier.
If the node does not exist, it creates a new Node object, stores it in the nodes map, and returns it.
| nodeId | Identifier of the node to retrieve. |
Definition at line 62 of file HwInterface.cpp.
|
protected |
Reads data from a specific node.
Sends a request to the node and retrieves the value stored in the node.
| nodeId | Identifier of the node to read from. |
Definition at line 93 of file HwInterface.cpp.
References connectionId, manager, and UaMessage::value.
|
protected |
Reads a block of data from a specific node.
| nodeId | Identifier of the node to read from. |
| aSize | Number of values to read. |
Definition at line 120 of file HwInterface.cpp.
References connectionId, and manager.
|
protected |
Writes data to a specific node.
Sends a message containing the node identifier and the value to be written.
| nodeId | Identifier of the node to write to. |
| aValue | Value to write to the node. |
Definition at line 79 of file HwInterface.cpp.
References connectionId, and manager.
|
protected |
Writes a block of data to a specific node.
| nodeId | Identifier of the node to write to. |
| aValues | Vector of values to write to the node. |
Definition at line 107 of file HwInterface.cpp.
References connectionId, and manager.
|
protected |
Definition at line 50 of file HwInterface.h.
Referenced by HwInterface(), and ~HwInterface().
|
protected |
Definition at line 51 of file HwInterface.h.
Referenced by HwInterface(), read(), readBlock(), write(), writeBlock(), and ~HwInterface().
|
staticprotected |
Definition at line 54 of file HwInterface.h.
Referenced by HwInterface(), read(), readBlock(), write(), and writeBlock().
|
protected |
Definition at line 53 of file HwInterface.h.
Referenced by HwInterface().
|
protected |
Definition at line 52 of file HwInterface.h.
Referenced by HwInterface().
| friend PIpBusInterface::HwInterface::Node |
Definition at line 40 of file HwInterface.h.
Referenced by getNode().
|
protected |
Definition at line 55 of file HwInterface.h.
Referenced by getNode(), and ~HwInterface().