Class nebula::drivers::SampleHwInterface
ClassList > nebula > drivers > SampleHwInterface
Receives raw sensor packets and forwards them to a registered callback. More...
#include <sample_hw_interface.hpp>
Classes
| Type | Name |
|---|---|
| struct | Error Rich error payload for hardware interface operations. |
Public Functions
| Type | Name |
|---|---|
| SampleHwInterface (ConnectionConfiguration connection_configuration) Construct the hardware interface with connection settings. |
|
| util::expected< std::monostate, Error > | register_scan_callback (connections::UdpSocket::callback_t scan_callback) Register or replace the callback invoked for each incoming packet. |
| util::expected< std::monostate, Error > | sensor_interface_start () Start packet reception. |
| util::expected< std::monostate, Error > | sensor_interface_stop () Stop packet reception. |
Public Static Functions
| Type | Name |
|---|---|
| const char * | to_cstr (Error::Code code) |
Detailed Description
This class owns the transport-facing state used by the sample driver.
Public Functions Documentation
function SampleHwInterface
Construct the hardware interface with connection settings.
explicit nebula::drivers::SampleHwInterface::SampleHwInterface (
ConnectionConfiguration connection_configuration
)
Parameters:
connection_configurationNetwork addresses and ports used by the sensor stream.
function register_scan_callback
Register or replace the callback invoked for each incoming packet.
util::expected< std::monostate, Error > nebula::drivers::SampleHwInterface::register_scan_callback (
connections::UdpSocket::callback_t scan_callback
)
Parameters:
scan_callbackCallback receiving packet bytes and transport metadata.
Returns:
std::monostate if callback is accepted, Error otherwise.
function sensor_interface_start
Start packet reception.
util::expected< std::monostate, Error > nebula::drivers::SampleHwInterface::sensor_interface_start ()
Returns:
std::monostate on success, Error on failure.
Postcondition:
On success, incoming packets are delivered through the registered callback.
function sensor_interface_stop
Stop packet reception.
util::expected< std::monostate, Error > nebula::drivers::SampleHwInterface::sensor_interface_stop ()
Returns:
std::monostate on success, Error on failure.
Public Static Functions Documentation
function to_cstr
static const char * nebula::drivers::SampleHwInterface::to_cstr (
Error::Code code
)
The documentation for this class was generated from the following file src/nebula_sample/nebula_sample_hw_interfaces/include/nebula_sample_hw_interfaces/sample_hw_interface.hpp