XLinkIn

XLinkIn node is used to send data from the host to the device via XLink.

How to place it

pipeline = dai.Pipeline()
xlinkIn = pipeline.create(dai.node.XLinkIn)
dai::Pipeline pipeline;
auto xlinkIn = pipeline.create<dai::node::XLinkIn>();

Inputs and Outputs

            ┌──────────────┐
            │              │
(From host) │              │    out
----------->│   XLinkIn    ├────────►
            │              │
            │              │
            └──────────────┘

Message types

  • out - Any

Usage

pipeline = dai.Pipeline()
xIn = pipeline.create(dai.node.XLinkIn)
xIn.setStreamName("camControl")

# Create ColorCamera beforehand
xIn.out.link(cam.inputControl)

with dai.Device(pipeline) as device:
  device.startPipeline()
  qCamControl = device.getInputQueue("camControl")

  # Send a message to the ColorCamera to capture a still image
  ctrl = dai.CameraControl()
  ctrl.setCaptureStill(True)
  qCamControl.send(ctrl)
dai::Pipeline pipeline;
auto xIn = pipeline.create<dai::node::XLinkIn>();
xIn->setStreamName("camControl");

// Create ColorCamera beforehand
xIn->out.link(cam->inputControl);

// Connect to the device
dai::Device device(pipeline);
device.startPipeline();

auto qCamControl = device.getInputQueue("camControl");

// Send a message to the ColorCamera to capture a still image
dai::CameraControl ctrl;
ctrl.setCaptureStill(true);
qCamControl->send(ctrl)

Reference

class depthai.node.XLinkIn

XLinkIn node. Receives messages over XLink.

class Connection

Connection between an Input and Output

class Id

Node identificator. Unique for every node on a single Pipeline

getAssetManager(*args, **kwargs)

Overloaded function.

  1. getAssetManager(self: depthai.Node) -> depthai.AssetManager

Get node AssetManager as a const reference

  1. getAssetManager(self: depthai.Node) -> depthai.AssetManager

Get node AssetManager as a const reference

getInputRefs(*args, **kwargs)

Overloaded function.

  1. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

Retrieves reference to node inputs

  1. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

Retrieves reference to node inputs

getInputs(self: depthai.Node) → List[depthai.Node.Input]

Retrieves all nodes inputs

getMaxDataSize(self: depthai.node.XLinkIn)int

Get maximum messages size in bytes

getName(self: depthai.Node)str

Retrieves nodes name

getNumFrames(self: depthai.node.XLinkIn)int

Get number of frames in pool

getOutputRefs(*args, **kwargs)

Overloaded function.

  1. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

Retrieves reference to node outputs

  1. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

Retrieves reference to node outputs

getOutputs(self: depthai.Node) → List[depthai.Node.Output]

Retrieves all nodes outputs

getParentPipeline(*args, **kwargs)

Overloaded function.

  1. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

  2. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

getStreamName(self: depthai.node.XLinkIn)str

Get stream name

property id

Id of node

property out

Outputs message of same type as send from host.

setMaxDataSize(self: depthai.node.XLinkIn, maxDataSize: int)None

Set maximum message size it can receive

Parameter maxDataSize:

Maximum size in bytes

setNumFrames(self: depthai.node.XLinkIn, numFrames: int)None

Set number of frames in pool for sending messages forward

Parameter numFrames:

Maximum number of frames in pool

setStreamName(self: depthai.node.XLinkIn, streamName: str)None

Specifies XLink stream name to use.

The name should not start with double underscores ‘__’, as those are reserved for internal use.

Parameter name:

Stream name

class dai::node::XLinkIn : public dai::Node

XLinkIn node. Receives messages over XLink.

Public Functions

std::string getName() const override

Retrieves nodes name.

XLinkIn(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
void setStreamName(const std::string &name)

Specifies XLink stream name to use.

The name should not start with double underscores ‘__’, as those are reserved for internal use.

Parameters
  • name: Stream name

void setMaxDataSize(std::uint32_t maxDataSize)

Set maximum message size it can receive

Parameters
  • maxDataSize: Maximum size in bytes

void setNumFrames(std::uint32_t numFrames)

Set number of frames in pool for sending messages forward

Parameters
  • numFrames: Maximum number of frames in pool

std::string getStreamName() const

Get stream name.

std::uint32_t getMaxDataSize() const

Get maximum messages size in bytes.

std::uint32_t getNumFrames() const

Get number of frames in pool.

Public Members

Output out = {*this, "out", Output::Type::MSender, {{DatatypeEnum::Buffer, true}}}

Outputs message of same type as send from host.

Private Functions

nlohmann::json getProperties() override
std::shared_ptr<Node> clone() override

Private Members

dai::XLinkInProperties properties

Got questions?

We’re always happy to help with code or other questions you might have.