hololink::emulation::PyDataPlane

View as Markdown

Inherits from: hololink::emulation::DataPlane (public)


Methods

update_metadata

void hololink::emulation::PyDataPlane::update_metadata() override

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

DataPlane

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 on the heap (Linux) or claims a slot from the file-scope DATA_PLANE_CTXT[] pool (STM32).

Parameters

hsb_emulator
HSBEmulator &

A reference to an HSBEmulator instance that the DataPlane will configure itself from.

ip_address
const IPAddress &

The IP address of the DataPlane.

data_plane_id
uint8_t

The data plane index of the DataPlane.

sensor_id
uint8_t

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.

start

void hololink::emulation::PyDataPlane::start()

Start the DataPlane by initiating the BootP broadcast.

stop

void hololink::emulation::PyDataPlane::stop()

Stop the DataPlane by stopping the BootP broadcast.

stop_bootp

void hololink::emulation::PyDataPlane::stop_bootp()

This is a clear alias for stop().

is_running

bool hololink::emulation::PyDataPlane::is_running()

Check if the DataPlane is running.

(Bootp is broadcasting)

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

send

int64_t hololink::emulation::PyDataPlane::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

tensor
const DLTensor &

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

frame_metadata
FrameMetadata *Defaults to DEFAULT_FRAME_METADATA

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

uint8_t hololink::emulation::PyDataPlane::get_sensor_id() const

Get the sensor ID associated with the DataPlane.

Returns: The sensor ID.

packetizer_enabled

bool hololink::emulation::PyDataPlane::packetizer_enabled() const

Check if the packetizer is enabled.

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

get_start_time

struct timespec hololink::emulation::PyDataPlane::get_start_time() const

broadcast_bootp

int hololink::emulation::PyDataPlane::broadcast_bootp()

Member variables

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