> 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::emulation::DataPlane

> DataPlane is the partially implemented Abstract Base Class with which HSB Emulator applications control data transmission and HSB Host applications establish "connections" and data flow via Bootp enumeration.

`DataPlane` is the partially implemented Abstract Base Class with which HSB Emulator applications control data transmission and HSB Host applications establish "connections" and data flow via Bootp enumeration.

The parent instance of any `DataPlane` implementation will manage Bootp broadcasting. Each implementation must interface with the HSB Emulator's internal memory model ([`AddressMemory`](addressmemory)) to update and manage metadata and any state needed for the metadata or transport layer for the corresponding `Transmitter`.

```cpp showLineNumbers={false}
#include <hololink/emulation/data_plane.hpp>
```

The `DataPlane` lifecycle operations are managed by the [`HSBEmulator`](hsbemulator) instance it is attached to and therefore `DataPlane` lifetime must be at least as long as the [`HSBEmulator`](hsbemulator) instance or at least until the final `HSBEmulator::stop()` is called.

***

## Constructors

### DataPlane \[#dataplane]

#### Overload 1

```cpp showLineNumbers={false}
hololink::emulation::DataPlane::DataPlane(
    HSBEmulator &hsb_emulator,
    const IPAddress &ip_address,
    uint8_t data_plane_id,
    uint8_t sensor_id
)
```

Constructs a `DataPlane` object with a platform-default per-DataPlane context.

Application code uses this overload; the platform .cpp allocates the [LinuxDataPlaneCtxt](../structs/linuxdataplanectxt) on the heap (Linux) or claims a slot from the file-scope DATA\_PLANE\_CTXT\[] pool (STM32).

**Parameters**

A reference to an [HSBEmulator](hsbemulator) instance that the `DataPlane` will configure itself from.

The IP address of the `DataPlane`.

The data plane index of the `DataPlane`.

The sensor index of the `DataPlane` to associate with the `DataPlane`. The data\_plane\_id and sensor\_id are used to identify registers needed to compile metadata.

#### Overload 2

```cpp showLineNumbers={false}
hololink::emulation::DataPlane::DataPlane(
    HSBEmulator &hsb_emulator,
    const IPAddress &ip_address,
    uint8_t data_plane_id,
    uint8_t sensor_id,
    std::unique_ptr<DataPlaneCtxt, std::function<void(DataPlaneCtxt *)>> ctxt
)
```

Subclass-only overload that lets the subclass supply a pre-constructed per-DataPlane context with its own deleter baked in.

The unique\_ptr is moved into `data_plane_ctxt_`; the deleter the caller chose at construction time encodes the ownership semantics (heap delete vs. no-op for static-pool slots). Application code cannot reach this overload — use the public 4-arg constructor.

**Parameters**

A reference to an [HSBEmulator](hsbemulator) instance that the `DataPlane` will configure itself from.

The IP address of the `DataPlane`.

The data plane index of the `DataPlane`.

The sensor index of the `DataPlane` to associate with the `DataPlane`.

Owning unique\_ptr to a [DataPlaneCtxt](../structs/dataplanectxt) (must be the `base` member of a platform-specific extension: [LinuxDataPlaneCtxt](../structs/linuxdataplanectxt) or [STM32DataPlaneCtxt](../structs/stm32dataplanectxt)). Must be non-null; the caller is responsible for choosing the deleter.

### Destructor \[#destructor]

### \~DataPlane

```cpp showLineNumbers={false}
hololink::emulation::DataPlane::~DataPlane()
```

***

## Methods

### start \[#start]

```cpp showLineNumbers={false}
void hololink::emulation::DataPlane::start()
```

Start the `DataPlane` by initiating the BootP broadcast.

### stop \[#stop]

```cpp showLineNumbers={false}
void hololink::emulation::DataPlane::stop()
```

Stop the `DataPlane` by stopping the BootP broadcast.

### stop\_bootp \[#stopbootp]

```cpp showLineNumbers={false}
void hololink::emulation::DataPlane::stop_bootp()
```

This is a clear alias for stop().

### is\_running \[#isrunning]

```cpp showLineNumbers={false}
bool hololink::emulation::DataPlane::is_running()
```

Check if the `DataPlane` is running.

(Bootp is broadcasting)

**Returns:** True if the `DataPlane` is running, false otherwise.

### send \[#send]

#### Send a tensor over the \`DataPlane\`

```cpp showLineNumbers={false}
int64_t hololink::emulation::DataPlane::send(
    const DLTensor &tensor,
    FrameMetadata *frame_metadata = DEFAULT_FRAME_METADATA
)
```

Send a tensor over the `DataPlane`.

This method is synchronous. It will block and metadata will be protected by a mutex until the send is complete.

**Returns:** The number of bytes sent or \< 0 if error occurred.

**Parameters**

The tensor object reference to send. Supported device types are kDLCPU, kDLCUDA, kDLCUDAHost (host pinned), and kDLCUDAManaged (Unified Memory)

The frame metadata to send. Acts as a buffer flush. If nullptr, the data is by default buffered until the next send command that fills an MTU or a non-nullptr frame\_metadata is provided.

#### Send a buffer over the \`DataPlane\`

```cpp showLineNumbers={false}
int64_t hololink::emulation::DataPlane::send(
    const uint8_t *buffer,
    size_t buffer_size,
    FrameMetadata *frame_metadata = nullptr
)
```

Send a buffer over the `DataPlane`.

**Returns:** The number of bytes sent or \< 0 if error occurred.

**Parameters**

The buffer to send.

The size of the buffer.

The frame metadata to send. Acts as a buffer flush. If nullptr, the data is by default buffered until the next send command that fills an MTU or a non-nullptr frame\_metadata is provided.

### get\_sensor\_id \[#getsensorid]

```cpp showLineNumbers={false}
uint8_t hololink::emulation::DataPlane::get_sensor_id() const
```

Get the sensor ID associated with the `DataPlane`.

**Returns:** The sensor ID.

### packetizer\_enabled \[#packetizerenabled]

```cpp showLineNumbers={false}
bool hololink::emulation::DataPlane::packetizer_enabled() const
```

Check if the packetizer is enabled.

**Returns:** True if the packetizer is enabled, false otherwise.

### get\_start\_time \[#getstarttime]

```cpp showLineNumbers={false}
struct timespec hololink::emulation::DataPlane::get_start_time() const
```

### broadcast\_bootp \[#broadcastbootp]

```cpp showLineNumbers={false}
int hololink::emulation::DataPlane::broadcast_bootp()
```

### update\_metadata \[#updatemetadata]

```cpp showLineNumbers={false}
void hololink::emulation::DataPlane::update_metadata()
```

method to update metadata model for the appropriate transmitter subclass can assume that appropriate locks are held while accessing memory registers and the transmitter metadata

### init \[#init]

```cpp showLineNumbers={false}
void hololink::emulation::DataPlane::init(
    HSBEmulator &hsb_emulator
)
```

Initialize the `DataPlane` by validating the configuration and registers.

This is platform specific and should assume the internal configuration has been set and resources allocated, but no other state

***

## Member variables

| Name               | Type                                                                             | Description |
| ------------------ | -------------------------------------------------------------------------------- | ----------- |
| `registers_`       | `AddressMemory &`                                                                |             |
| `ip_address_`      | `IPAddress`                                                                      |             |
| `configuration_`   | `HSBConfiguration`                                                               |             |
| `sensor_id_`       | `uint8_t`                                                                        |             |
| `data_plane_id_`   | `uint8_t`                                                                        |             |
| `transmitter_`     | `BaseTransmitter *`                                                              |             |
| `data_plane_ctxt_` | `std::unique_ptr< struct DataPlaneCtxt, std::function< void(DataPlaneCtxt *)> >` |             |