> This page is for version 3.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 3.0 (Latest) (default): https://docs.nvidia.com/holoscan/sensor-bridge/3-0/llms.txt
> - 2.7: https://docs.nvidia.com/holoscan/sensor-bridge/2-7/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sensor-bridge/archives/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sensor-bridge/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sensor-bridge/_mcp/server.

# hololink::module::ChannelConfigurationInterfaceV1

> A Module provides one of these to update EnumerationMetadata based on requests from the application layer.

A [Module](module) provides one of these to update [EnumerationMetadata](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](adapter) to modify [EnumerationMetadata](enumerationmetadata) (e.g. [Adapter::use_sensor](adapter#usesensor)); 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](enumerationmetadata), [Module](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.

```cpp showLineNumbers={false}
#include <hololink/module/channel_configuration.hpp>
```

## Example

```cpp showLineNumbers={false}
adapter = hololink_module.Adapter.get_adapter()
discovery_timeout_s = 30
enumeration_metadata = adapter.wait_for_channel(hololink="192.168.0.2", discovery_timeout_s)
# By default, this first channel publishes data from sensor 0.
# Let's change it to publish data from sensor 1.
sensor_number = 1
adapter.use_sensor(enumeration_metadata, sensor_number)
...
```

**Inherits from:** `hololink::module::Service< ChannelConfigurationInterfaceV1 >` (public)

---

## Methods

### use_sensor \[#usesensor]

```cpp showLineNumbers={false}
virtual void hololink::module::ChannelConfigurationInterfaceV1::use_sensor(
    EnumerationMetadata &metadata,
    int64_t sensor_number
)
```

Select the physical sensor to be used with this data channel.

Following device enumeration, [EnumerationMetadata](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](adapter#usesensor), 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**

**`metadata`** `EnumerationMetadata &`

Announcement to rewrite in place.

---

**`sensor_number`** `int64_t`

Zero-based index of the sensor to describe.

---

### is_sensor_valid \[#issensorvalid]

```cpp showLineNumbers={false}
virtual bool hololink::module::ChannelConfigurationInterfaceV1::is_sensor_valid(
    int64_t sensor_number
) const
```

Returns true if sensor_number is valid for this configuration.

**Returns:** True if sensor_number is valid.

**Parameters**

**`sensor_number`** `int64_t`

Sensor number to test.

---

### use_mtu \[#usemtu]

```cpp showLineNumbers={false}
virtual void hololink::module::ChannelConfigurationInterfaceV1::use_mtu(
    EnumerationMetadata &metadata,
    uint32_t 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**

**`metadata`** `EnumerationMetadata &`

Encapsulates connection parameters

---

**`mtu`** `uint32_t`

Data-plane MTU, in bytes.

---

### use_multicast \[#usemulticast]

```cpp showLineNumbers={false}
virtual void hololink::module::ChannelConfigurationInterfaceV1::use_multicast(
    EnumerationMetadata &metadata,
    std::string address,
    uint16_t port
)
```

Set a multicast destination for the data plane.

**Parameters**

**`metadata`** `EnumerationMetadata &`

Encapsulates configuration data.

---

**`address`** `std::string`

Multicast group address.

---

**`port`** `uint16_t`

Destination UDP port to send to.

---

### module \[#module]

```cpp showLineNumbers={false}
std::shared_ptr<Module> hololink::module::ServiceBase::module() const
```

The [Module](module) that this service was published from.

The service holds no strong reference to its [Module](module), so this does not extend the [Module](module)'s lifetime.

**Returns:** The owning [Module](module), or an empty pointer if the service has not been published or its [Module](module) no longer exists.

---

## Static methods

### get_service \[#getservice]

#### Fetch the instance a module publishes

```cpp showLineNumbers={false}
static std::shared_ptr<ChannelConfigurationInterfaceV1> hololink::module::ChannelConfigurationInterfaceV1::get_service(
    std::shared_ptr<Module> module,
    bool allow_null = false
)
```

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**

**`module`** `std::shared_ptr<Module>`

The module that claims the device, from [Adapter::get_module](adapter#getmodule).

---

**`allow_null`** `bool` — default: false

Return an empty pointer, rather than throwing, when the module publishes no channel configuration service.

---

#### Overload 2

```cpp showLineNumbers={false}
static std::shared_ptr<ChannelConfigurationInterfaceV1> hololink::module::Service<ChannelConfigurationInterfaceV1>::get_service(
    std::shared_ptr<Module> module,
    const char *instance_id,
    bool allow_null = false
)
```

Type-safe way to fetch a std::shared_ptr to an instance of \<Derived> from a [Module](module).

Note that [Module](module) usually caches instances, it's likely that calls to get_service with the same locator_id will return pointers to the same implementation object.

**Returns:** A shared pointer to the service instance.

**Parameters**

**`module`** `std::shared_ptr<Module>`

Is the shared object that owns the instance we wish to fetch

---

**`instance_id`** `const char *`

Names the specific object, usually expressed as a set of "name=value;..." pairs, as defined by the implementations themselves. This name is normally fetched by calling `Derived::locator_id(enumeration_metadata)`.

---

**`allow_null`** `bool` — default: false

The default value of `false` causes this routine to throw a std::runtime_error if the service cannot be found within the module; this would be expected to terminate the calling program. If the application wants to handle the error, pass in `true` here and get_service will return `nullptr` when this module doesn't provide the requested service.

---

### for_each_type_id \[#foreachtypeid]

```cpp showLineNumbers={false}
static bool hololink::module::Service<ChannelConfigurationInterfaceV1>::for_each_type_id(
    Callback &&cb
)
```

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.