# XLinkIn

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

## How to place it

#### Python

```python
pipeline = dai.Pipeline()
xlinkIn = pipeline.create(dai.node.XLinkIn)
```

#### C++

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

## Inputs and Outputs

## Usage

#### Python

```python
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)
```

#### C++

```cpp
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)
```

## Examples of functionality

 * [RGB Camera Control](https://docs.luxonis.com/software/depthai/examples/rgb_camera_control.md)
 * [Video & MobilenetSSD](https://docs.luxonis.com/software/depthai/examples/video_mobilenet.md)
 * [RGB Rotate Warp](https://docs.luxonis.com/software/depthai/examples/rgb_rotate_warp.md)

## Reference

### depthai.node.XLinkIn(depthai.Node)

Kind: Class

XLinkIn node. Receives messages over XLink.

#### getMaxDataSize(self) -> int: int

Kind: Method

Get maximum messages size in bytes

#### getNumFrames(self) -> int: int

Kind: Method

Get number of frames in pool

#### getStreamName(self) -> str: str

Kind: Method

Get stream name

#### setMaxDataSize(self, maxDataSize: typing.SupportsInt)

Kind: Method

Set maximum message size it can receive

Parameter ``maxDataSize``:
Maximum size in bytes

#### setNumFrames(self, numFrames: typing.SupportsInt)

Kind: Method

Set number of frames in pool for sending messages forward

Parameter ``numFrames``:
Maximum number of frames in pool

#### setStreamName(self, streamName: str)

Kind: Method

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

#### out

Kind: Property

Outputs message of same type as send from host.

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
