# Using Bluetooth

### Overview <a href="#usingbluetooth-overview" id="usingbluetooth-overview"></a>

LinkIt 7697 supports Bluetooth Low Energy by providing the **LBLE** library. However, it does not support classic profiles such as Bluetooth BR or EDR.

A Bluetooth Low Energy device is either a **central** device or a **peripheral** device. A peripheral device, such as a heart rate sensor, **advertises** itself by broadcasting information to others. A central device **discovers** nearby peripheral devices, and **connects** to the peripheral device to access its **attributes**, such as **services** or **characteristics**.

<br>

![](https://3972650740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY4gduUSLWOCI23CXUWej%2Fuploads%2FZS0VkNKblbM5f98QcTsx%2Fble_intro.png?alt=media\&token=4a476475-a77a-4f65-9567-42230896face)

In the Arduino supporting package, an **LBLE** library with the following classes are provided:

* **LBLE** class are used to initialize Bluetooth Low Energy subsystem.
* **LBLECentral** class provides basic central device operations, such as scanning for nearby peripherals.
* **LBLEPeripheral** class provides basic peripheral device features, including:
  * Setting **advertisement** package.
  * Configuring **characteristics** and services.

### Initializing Bluetooth <a href="#usingbluetooth-initializingbluetooth" id="usingbluetooth-initializingbluetooth"></a>

On LinkIt 7697, you must initialize the Bluetooth subsystem before using it. In order to do so, you need to call `LBLE.begin()` first and wait for the initialization sequence to complete by checking `LBLE.ready().`

```
LBLE.begin();
while(!LBLE.ready())
{
    delay(50);
}
```

You must initialize the Bluetooth subsystem before using any other Bluetooth functions, including central and peripheral classes.

After intializing the Bluetooth subsystem, you have the following choices:

* [Create a Bluetooth beacon](https://docs.labs.mediatek.com/resource/linkit7697-arduino/en/developer-guide/using-bluetooth/beacons)
* [Create a Bluetooth central device](https://docs.labs.mediatek.com/resource/linkit7697-arduino/en/developer-guide/using-bluetooth/central-devices) to connect to other peripherals
* [Create a Bluetooth peripheral device](https://docs.labs.mediatek.com/resource/linkit7697-arduino/en/developer-guide/using-bluetooth/peripheral-devices) to provide data and service to central devices


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cavedu.gitbook.io/linkit-7697/linkit-7697-development-guide-for-arduino-ide/developer-guide/using-bluetooth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
