Abstract base class for Network Interface Card (NIC) operations. More...
#include <AbstractNIC.hxx>
Public Member Functions | |
virtual void | startTxService ()=0 |
Start the transmission service. | |
virtual void | stopTxService ()=0 |
Stop the transmission service. | |
virtual void | pauseTx ()=0 |
Temporarily pause transmission. | |
virtual void | resumeTx ()=0 |
Resume paused transmission. | |
virtual bool | isTxServiceStarted () const =0 |
Check if transmission service is running. | |
virtual int | transmitPicoScenesFrame (const ModularPicoScenesTxFrame &frame)=0 |
Transmit a single PicoScenes frame. | |
virtual int | transmitPicoScenesFrameSync (const ModularPicoScenesTxFrame &frame)=0 |
Transmit a frame synchronously. | |
virtual int | transmitFramesInBatch (const std::vector< ModularPicoScenesTxFrame > &frames, uint16_t numRepeats)=0 |
Transmit multiple frames in batch mode. | |
template<int repeat = 1, typename ... Frames, typename = std::enable_if_t<(std::is_same_v<std::remove_cvref_t<Frames>, ModularPicoScenesTxFrame *> &&...) || (std::is_same_v<std::remove_cvref_t<Frames>, ModularPicoScenesTxFrame> &&...) || ((std::is_same_v<std::remove_cvref_t<Frames>, std::shared_ptr<ModularPicoScenesTxFrame>> || std::is_same_v<std::remove_cvref_t<Frames>, std::unique_ptr<ModularPicoScenesTxFrame>>) &&...)>> | |
int | transmitFramesInBatch (Frames &&... frames) |
Template method for batch transmission of frames. | |
virtual ModularPicoScenesTxFrame | initializeTxFrame () |
Initialize a new transmission frame. | |
virtual void | startRxService ()=0 |
Start the reception service. | |
virtual void | stopRxService ()=0 |
Stop the reception service. | |
virtual void | pauseRx ()=0 |
Temporarily pause reception. | |
virtual void | resumeRx ()=0 |
Resume paused reception. | |
virtual bool | isRxServiceStarted () const =0 |
Check if reception service is running. | |
virtual std::optional< ModularPicoScenesRxFrame > | syncRxConditionally (const std::function< bool(const ModularPicoScenesRxFrame &)> &condition, const std::chrono::milliseconds &maxWait_ms, std::optional< std::string > conditionaName=std::nullopt)=0 |
Wait for a frame that matches specific conditions. | |
virtual std::optional< ModularPicoScenesRxFrame > | syncRxWaitTaskId (uint16_t taskid, uint32_t maxWait_ms)=0 |
Wait for a frame with specific task ID. | |
virtual void | registerTaskIdHandler (uint16_t taskId, const std::function< bool(const ModularPicoScenesRxFrame &)> &handle)=0 |
Register a handler for specific task ID. | |
virtual std::function< bool(const ModularPicoScenesRxFrame &)> | getHandlerForFrameType (uint8_t frameType)=0 |
Get handler for specific frame type. | |
virtual void | unregisterTaskIdHandler (uint16_t taskId)=0 |
Unregister handler for specific task ID. | |
virtual bool | checkTaskIdHandlerExist (uint16_t taskId)=0 |
Check if handler exists for specific task ID. | |
virtual void | registerFrameTypeHandler (uint8_t frameType, const std::function< bool(const ModularPicoScenesRxFrame &)> &handle)=0 |
Register handler for specific frame type. | |
virtual std::function< bool(const ModularPicoScenesRxFrame &)> | getHandlerForTaskId (uint16_t taskId)=0 |
Get handler for specific task ID. | |
virtual void | unregisterFrameTypeHandler (uint8_t frameType)=0 |
Unregister handler for specific frame type. | |
virtual bool | checkFrameTypeHandlerExist (uint8_t frameType)=0 |
Check if handler exists for specific frame type. | |
virtual void | registerGeneralHandler (const std::string &handlerKeyName, const std::function< bool(const ModularPicoScenesRxFrame &)> &handle)=0 |
Register a general handler. | |
virtual std::function< bool(const ModularPicoScenesRxFrame &)> | getGeneralHandler (const std::string &handlerKeyName)=0 |
Get general handler by name. | |
virtual void | unregisterGeneralHandler (const std::string &handlerKeyName)=0 |
Unregister general handler. | |
virtual bool | checkGeneralHandlerExist (const std::string &handlerKeyName)=0 |
Check if general handler exists. | |
const std::string & | getReferredInterfaceName () const |
Get the interface name. | |
const std::string & | getPhyId () const |
Get the physical interface ID. | |
const std::shared_ptr< AbstractFrontEnd > & | getFrontEnd () const |
Get the front end interface. | |
virtual const PicoScenesFrameTxParameters & | getUserSpecifiedTxParameters () const =0 |
This methods returns the PicoScenesFrameTxParameters object created by the user specified Tx parameters. . | |
virtual PicoScenesFrameTxParameters & | getUserSpecifiedTxParameters ()=0 |
This methods returns the PicoScenesFrameTxParameters object created by the user specified Tx parameters. . | |
PicoScenesDeviceType | getDeviceType () const |
Get the device type. | |
std::shared_ptr< AbstractHALConfiguration > | getConfiguration () const |
Get the HAL configuration. | |
template<typename FrontEndT , class = std::enable_if_t<std::is_base_of_v<AbstractFrontEnd, FrontEndT>>> | |
std::shared_ptr< FrontEndT > | getTypedFrontEnd () const |
Get typed front end instance. | |
const std::shared_ptr< PicoScenesPluginManager > & | getPluginManager () const |
Get the plugin manager. | |
virtual void | installPlugins () const =0 |
Install plugins for this NIC. | |
std::vector< std::shared_ptr< po::options_description > > | getAllNICOptions () |
Get all NIC options. | |
Protected Member Functions | |
AbstractNIC (const std::string &referredInterfaceName) | |
Protected constructor. | |
Protected Attributes | |
std::string | referredInterfaceName |
Interface name reference. | |
std::string | phyId |
Physical interface identifier. | |
PicoScenesDeviceType | deviceType = PicoScenesDeviceType::Unknown |
Type of the device (NIC/SDR) | |
std::shared_ptr< AbstractHALConfiguration > | configuration |
Hardware abstraction layer configuration. | |
std::shared_ptr< AbstractFrontEnd > | frontEnd |
Frontend interface for hardware interaction. | |
std::shared_ptr< PicoScenesPluginManager > | pluginManager |
Plugin manager for extending functionality. | |
Abstract base class for Network Interface Card (NIC) operations.
This class provides a common interface for different types of network interface cards, including both traditional Wi-Fi NICs and Software Defined Radio (SDR) devices. It manages transmission (Tx) and reception (Rx) services, frame handling, and plugin support.
Definition at line 28 of file AbstractNIC.hxx.
|
explicitprotected |
Protected constructor.
referredInterfaceName | Name of the interface to manage |
|
pure virtual |
Check if handler exists for specific frame type.
frameType | Frame type to check |
|
pure virtual |
Check if general handler exists.
handlerKeyName | Name of the handler to check |
|
pure virtual |
Check if handler exists for specific task ID.
taskId | Task ID to check |
std::vector< std::shared_ptr< po::options_description > > AbstractNIC::getAllNICOptions | ( | ) |
Get all NIC options.
std::shared_ptr< AbstractHALConfiguration > AbstractNIC::getConfiguration | ( | ) | const |
Get the HAL configuration.
PicoScenesDeviceType AbstractNIC::getDeviceType | ( | ) | const |
Get the device type.
const std::shared_ptr< AbstractFrontEnd > & AbstractNIC::getFrontEnd | ( | ) | const |
Get the front end interface.
|
pure virtual |
Get general handler by name.
handlerKeyName | Name of the handler |
|
pure virtual |
Get handler for specific frame type.
frameType | Type of frame |
|
pure virtual |
Get handler for specific task ID.
taskId | Task ID to get handler for |
const std::string & AbstractNIC::getPhyId | ( | ) | const |
Get the physical interface ID.
const std::shared_ptr< PicoScenesPluginManager > & AbstractNIC::getPluginManager | ( | ) | const |
Get the plugin manager.
const std::string & AbstractNIC::getReferredInterfaceName | ( | ) | const |
|
inline |
Get typed front end instance.
FrontEndT | Type of front end to get |
Definition at line 304 of file AbstractNIC.hxx.
References getReferredInterfaceName(), and FrontEndFactory::getTypedFrontEndInstance().
|
pure virtual |
This methods returns the PicoScenesFrameTxParameters object created by the user specified Tx parameters.
.
The user specified Tx parameters in CLI are parsed and interpreted into a PicoScenesFrameTxParameters object. To make this object available to upper-level plugins, it is store in the NIC/SDR's AbstractNIC object.
Plugin developers can access the user specified Tx parameters via this method.
|
pure virtual |
This methods returns the PicoScenesFrameTxParameters object created by the user specified Tx parameters.
.
The user specified Tx parameters in CLI are parsed and interpreted into a PicoScenesFrameTxParameters object. To make this object available to upper-level plugins, it is store in the NIC/SDR's AbstractNIC object.
Plugin developers can access the user specified Tx parameters via this method.
|
inlinevirtual |
Initialize a new transmission frame.
Definition at line 108 of file AbstractNIC.hxx.
References frontEnd.
|
pure virtual |
Install plugins for this NIC.
|
pure virtual |
Check if reception service is running.
|
pure virtual |
Check if transmission service is running.
|
pure virtual |
Temporarily pause reception.
|
pure virtual |
Temporarily pause transmission.
|
pure virtual |
Register handler for specific frame type.
frameType | Type of frame |
handle | Handler function |
|
pure virtual |
Register a general handler.
handlerKeyName | Name of the handler |
handle | Handler function |
|
pure virtual |
Register a handler for specific task ID.
taskId | Task ID to handle |
handle | Handler function |
|
pure virtual |
Resume paused reception.
|
pure virtual |
Resume paused transmission.
|
pure virtual |
Start the reception service.
|
pure virtual |
Start the transmission service.
|
pure virtual |
Stop the reception service.
|
pure virtual |
Stop the transmission service.
|
pure virtual |
Wait for a frame that matches specific conditions.
condition | Function defining the matching condition |
maxWait_ms | Maximum time to wait in milliseconds |
conditionaName | Optional name for the condition |
|
pure virtual |
Wait for a frame with specific task ID.
taskid | Task ID to wait for |
maxWait_ms | Maximum time to wait in milliseconds |
|
pure virtual |
Transmit multiple frames in batch mode.
frames | Vector of frames to transmit |
numRepeats | Number of times to repeat the transmission |
Referenced by transmitFramesInBatch().
|
inline |
Template method for batch transmission of frames.
repeat | Number of times to repeat the transmission |
Frames | Variable number of frame parameters |
frames | Frames to transmit |
Definition at line 90 of file AbstractNIC.hxx.
References transmitFramesInBatch().
|
pure virtual |
Transmit a single PicoScenes frame.
frame | The frame to transmit |
|
pure virtual |
Transmit a frame synchronously.
frame | The frame to transmit |
|
pure virtual |
Unregister handler for specific frame type.
frameType | Frame type to unregister |
|
pure virtual |
Unregister general handler.
handlerKeyName | Name of the handler to unregister |
|
pure virtual |
Unregister handler for specific task ID.
taskId | Task ID to unregister |
|
protected |
Hardware abstraction layer configuration.
Definition at line 344 of file AbstractNIC.hxx.
|
protected |
Type of the device (NIC/SDR)
Definition at line 339 of file AbstractNIC.hxx.
|
protected |
Frontend interface for hardware interaction.
Definition at line 349 of file AbstractNIC.hxx.
Referenced by initializeTxFrame().
|
protected |
Physical interface identifier.
Definition at line 334 of file AbstractNIC.hxx.
|
protected |
Plugin manager for extending functionality.
Definition at line 354 of file AbstractNIC.hxx.
|
protected |
Interface name reference.
Definition at line 329 of file AbstractNIC.hxx.