# XLinkIn

XLinkIn 节点用于通过 XLink 将数据从主机发送到设备。

## 如何放置

#### Python

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

#### C++

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

## 输入和输出

## 使用

#### Python

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

# 提前创建 ColorCamera
xIn.out.link(cam.inputControl)

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

  # 向 ColorCamera 发送消息以捕获静态图像
  ctrl = dai.CameraControl()
  ctrl.setCaptureStill(True)
  qCamControl.send(ctrl)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto xIn = pipeline.create<dai::node::XLinkIn>();
xIn->setStreamName("camControl");

// 提前创建 ColorCamera
xIn->out.link(cam->inputControl);

// 连接到设备
dai::Device device(pipeline);
device.startPipeline();

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

// 向 ColorCamera 发送消息以捕获静态图像
dai::CameraControl ctrl;
ctrl.setCaptureStill(true);
qCamControl->send(ctrl)
```

## 功能示例

 * [RGB 相机控制](https://docs.luxonis.com/software/depthai/examples/rgb_camera_control.md)
 * [视频与 MobileNetSSD](https://docs.luxonis.com/software/depthai/examples/video_mobilenet.md)
 * [RGB 旋转扭曲](https://docs.luxonis.com/software/depthai/examples/rgb_rotate_warp.md)

## 参考

### 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.

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
