# Pair Bluetooth Device

## Overview

![The Pair Bluetooth Device Node.](https://2561100106-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff6JZovzOqBctA4C1o76u%2Fuploads%2Fgit-blob-a2e0be6ca9f6de211bb520300033aa27122f2b5f%2Fpairbluetoothdevicesreal.png?alt=media)

The **Pair Bluetooth Device Node** attempts to pair a given *Bluetooth* device that may have been previously discovered by the [**Scan For Bluetooth Devices Node**](https://docs.incari.com/incari-studio/2023.2/toolbox/communication/bluetooth/scanforbluetoothdevices). A more detailed explanation of this process can be found [here](https://docs.incari.com/incari-studio/2023.2/toolbox/communication/bluetooth/..#bluetooth-guideline).

The **Node** only schedules the pairing process and then returns immediately. This means that it is possible to trigger the **Node** multiple times with different inputs, resulting in consecutive pairing attempts. This is the reason for returning the error *Bluetooth* address, as it properly attributes the error to the relevant device.

**Bluetooth Communication** in **Incari** is available as a plugin and is enabled as default. However, in the case that it is disabled in the **Plugins Editor**, **Pair Bluetooth Device** will not show up in the [**Toolbox**](https://docs.incari.com/incari-studio/2023.2/toolbox/overview). Please refer to the [**Plugins Editor**](https://docs.incari.com/incari-studio/2023.2/modules/plugins) to find out more information.

It is important to note that while the **Pair Bluetooth Device** connects to a **Bluetooth** device (like a phone), it will not finish pairing when the **Node** is executed. This will lead to the **Logic** attached to its **Output Pulse** not to work even though there is technically nothing wrong. In order to avoid this, it is necessary to use the [**On Bluetooth Device Paired Node**](https://docs.incari.com/incari-studio/2023.2/toolbox/communication/bluetooth/events/onbluetoothdevicepaired) instead. This way, the **Logic** will only execute once the **Bluetooth** device has definitely been paired with.

Again, the user must first use the **Pair Bluetooth Device Node** to pair with a device. Separately, the **On Bluetooth Device Paired Node** can be used to execute the desired **Communication Logic**.

![Pair Bluetooth Device Node and On Bluetooth Device Paired Configuration.](https://2561100106-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff6JZovzOqBctA4C1o76u%2Fuploads%2Fgit-blob-41af6293106b70defe1eef9711e3f90fb2ad5a56%2Fpairbluetoothonbluetoothpairedexample2.png?alt=media)

[**Scope**](https://docs.incari.com/incari-studio/2023.2/overview#scopes): **Project**, **Scene**.

## Inputs

| Input               | Type       | Description                                                                                                                                                                                                                                                |
| ------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Input* (►)   | **Pulse**  | A standard **Input Pulse**, to trigger the execution of the **Node**.                                                                                                                                                                                      |
| `Bluetooth Address` | **String** | The unique *Bluetooth* identifier that is associated with a *Bluetooth* device. This can be discovered by the [**Scan For Bluetooth Devices Node**](https://docs.incari.com/incari-studio/2023.2/toolbox/communication/bluetooth/scanforbluetoothdevices). |

## Outputs

| Output              | Type       | Description                                                                                                                            |
| ------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►)  | **Pulse**  | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `On Error`(►)       | **Pulse**  | An **Event Pulse** that fires in the event of an error, namely that pairing failed.                                                    |
| `Error Message`     | **String** | The error message in the event of an error.                                                                                            |
| `Bluetooth Address` | **String** | The *Bluetooth* address of the device for which the pairing failed, in the event of an error.                                          |

## See Also

* [**Unpair Bluetooth Devices**](https://docs.incari.com/incari-studio/2023.2/toolbox/communication/bluetooth/unpairbluetoothdevices)
