hololink::module::ChannelConfigurationInterfaceV1
hololink::module::ChannelConfigurationInterfaceV1
A Module provides one of these to update EnumerationMetadata based on requests from the application layer.
This service provides device-specific implementation for various configurations that are requested by the application layer. Applications usually call methods on Adapter to modify EnumerationMetadata (e.g. Adapter::use_sensor); many of these work by loading up this device-specific object and calling the appropriate method here. This allows the module to set up the values needed by other module services which will be instantiated later. The framework puts no restrictions on the name/value pairs that can be stored in EnumerationMetadata, Module instances are free to coordinate using this as they wish.
For example, an application can change the sensor number a specific data path transports:
The call to adapter.use_sensor results in loading this service from the module and calling use_sensor on it.
Example
Inherits from: hololink::module::Service< ChannelConfigurationInterfaceV1 > (public)
Methods
use_sensor
Select the physical sensor to be used with this data channel.
Following device enumeration, EnumerationMetadata includes device-specific information about which data channel to use and which sensor is to be transported over that channel. You can modify this default behavior and listen to a different sensor by calling Adapter::use_sensor, which delegates to this method.
Each HSB implementation is able to do what it wants here, but typically data_plane, sensor, sensor_number, the SIF, VP and HIF address fields, and the frame-end event are adjusted.
Throws: std::runtime_error if sensor_number is invalid.
Parameters
Announcement to rewrite in place.
Zero-based index of the sensor to describe.
is_sensor_valid
Returns true if sensor_number is valid for this configuration.
Returns: True if sensor_number is valid.
Parameters
Sensor number to test.
use_mtu
Set the data-plane MTU.
Suggest an MTU for use with this data channel; the implementation is allowed to do any of these:
- use the specific value you’ve passed here,
- adjust that value based on e.g. GPU page size, NIC constraints, or RDMA requirements
- stick with it’s default value, ignoring this suggestion entirely
If the MTU isn’t supported by all links in the network chain, the result is undefined. If the implementation doesn’t ignore this setting, then no data plane packets larger than the given MTU will be sent.
Parameters
Encapsulates connection parameters
Data-plane MTU, in bytes.
use_multicast
Set a multicast destination for the data plane.
Parameters
Encapsulates configuration data.
Multicast group address.
Destination UDP port to send to.
module
The Module that this service was published from.
The service holds no strong reference to its Module, so this does not extend the Module’s lifetime.
Returns: The owning Module, or an empty pointer if the service has not been published or its Module no longer exists.
Static methods
get_service
Fetch the instance a module publishes
Overload 2
Fetch the instance a module publishes.
Returns: The module’s channel configuration service.
Throws: std::runtime_error if the module publishes no channel configuration service and allow_null is false.
Parameters
The module that claims the device, from Adapter::get_module.
Return an empty pointer, rather than throwing, when the module publishes no channel configuration service.
for_each_type_id
Iterate over every type_id supported by this instance.
The callback signature is bool(const char*) — returning false halts the walk; true continues. Iteration is depth-first, so you’ll see the most specific implementation types first.