---
description: The Capacitor Bluetooth Low Energy plugin enables interaction with Bluetooth Low Energy (BLE) devices in the central and peripheral role.
title: Capacitor BLE Plugin: Bluetooth Low Energy - Capawesome
image: https://capawesome.io/docs/assets/images/social/blog/announcing-the-capacitor-bluetooth-low-energy-plugin.png
---

<!doctype html> 

[Skip to content ](#capacitor-ble-plugin-bluetooth-low-energy) 

[🖥️ Introducing the **Capacitor Electron Platform** — build desktop apps for macOS, Windows, and Linux. Free & open source. ](/blog/announcing-the-capacitor-electron-platform/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Intercom ](/docs/sdks/capacitor/intercom/)
* [ Intune ](/docs/sdks/capacitor/intune/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Tauri ](/docs/sdks/capacitor/tauri/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ YouTube Player ](/docs/sdks/capacitor/youtube-player/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ Peripheral role ](#peripheral-role)
* [ FAQ ](#faq)
* [ Closing Thoughts ](#closing-thoughts)

* Related links

# Capacitor BLE Plugin: Bluetooth Low Energy[¶](#capacitor-ble-plugin-bluetooth-low-energy "Permanent link")

Building an app that talks to a smart device — a wearable, a sensor, a beacon, or your own hardware? The [Capacitor Bluetooth Low Energy plugin](/docs/sdks/capacitor/bluetooth-low-energy/) lets your app act as both a BLE central (connecting to devices) and a BLE peripheral (advertising to others), with cross-platform support for Android and iOS. It's available to all Capawesome [Insiders](/docs/insiders/).

Let's take a quick look at the [API](/docs/sdks/capacitor/bluetooth-low-energy/#api) and how you can use the plugin to communicate with BLE devices.

## Installation[¶](#installation "Permanent link")

To install the Capacitor Bluetooth Low Energy plugin, please refer to the [Installation](/docs/sdks/capacitor/bluetooth-low-energy/#installation) section in the plugin documentation.

## Usage[¶](#usage "Permanent link")

Let's take a look at the basic usage of the plugin. The plugin supports two roles:

* **Central role**: The app acts as a central device that can connect to and communicate with peripheral devices.
* **Peripheral role**: The app acts as a peripheral device that can advertise its services and accept connections from central devices.

The plugin supports both roles on Android and iOS. The following sections will show you how to use the plugin in both roles.

### Central role[¶](#central-role "Permanent link")

The central role allows you to connect to and communicate with BLE devices.

#### Initialize the plugin[¶](#initialize-the-plugin "Permanent link")

First, you need to initialize the plugin and request the necessary permissions:

`[](#%5F%5Fcodelineno-0-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-0-2)import { Capacitor } from "@capacitor/core";
[](#%5F%5Fcodelineno-0-3)
[](#%5F%5Fcodelineno-0-4)const initialize = async () => {
[](#%5F%5Fcodelineno-0-5)  if (Capacitor.getPlatform() === "ios") {
[](#%5F%5Fcodelineno-0-6)    await BluetoothLowEnergy.initialize({
[](#%5F%5Fcodelineno-0-7)      mode: "central",
[](#%5F%5Fcodelineno-0-8)    });
[](#%5F%5Fcodelineno-0-9)  } else {
[](#%5F%5Fcodelineno-0-10)    await BluetoothLowEnergy.requestPermissions();
[](#%5F%5Fcodelineno-0-11)  }
[](#%5F%5Fcodelineno-0-12)};
`

In this context, there are differences between Android and iOS. On **iOS**, you need to call the [initialize](/docs/sdks/capacitor/bluetooth-low-energy/#initialize) method to initialize the plugin every time the app starts. On **Android**, you need to call the [requestPermissions](/docs/sdks/capacitor/bluetooth-low-energy/#requestpermissions) method to request the necessary permissions.

#### Scan for devices[¶](#scan-for-devices "Permanent link")

Before you can connect to a device for the first time, you need to scan for devices. For this, you can use the [startScan](/docs/sdks/capacitor/bluetooth-low-energy/#startscan):

`[](#%5F%5Fcodelineno-1-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-1-2)
[](#%5F%5Fcodelineno-1-3)const startScan = async () => {
[](#%5F%5Fcodelineno-1-4)  await BluetoothLowEnergy.addListener("deviceScanned", (event) => {
[](#%5F%5Fcodelineno-1-5)    console.log("Device scanned", event.device);
[](#%5F%5Fcodelineno-1-6)  });
[](#%5F%5Fcodelineno-1-7)  await BluetoothLowEnergy.startScan();
[](#%5F%5Fcodelineno-1-8)};
[](#%5F%5Fcodelineno-1-9)
[](#%5F%5Fcodelineno-1-10)const stopScan = async () => {
[](#%5F%5Fcodelineno-1-11)  await BluetoothLowEnergy.stopScan();
[](#%5F%5Fcodelineno-1-12)};
`

Every time a device is found, the `deviceScanned` event is emitted. You can now display the found devices to your users and let them select the device they want to connect to. As soon as the user has selected a device, you should stop the scan with [stopScan](/docs/sdks/capacitor/bluetooth-low-energy/#stopscan).

#### Connect to a device[¶](#connect-to-a-device "Permanent link")

To connect to a device, you can use the [connect](/docs/sdks/capacitor/bluetooth-low-energy/#connect) method:

`[](#%5F%5Fcodelineno-2-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-2-2)
[](#%5F%5Fcodelineno-2-3)const connect = async (deviceId: string) => {
[](#%5F%5Fcodelineno-2-4)  await BluetoothLowEnergy.connect({ deviceId });
[](#%5F%5Fcodelineno-2-5)};
`

You just need to pass the `deviceId` of the device you want to connect to. The `deviceId` is the address of the device (e.g. `00:11:22:33:AA:BB`) and is usually provided by the `deviceScanned` event.

Reconnect to a device 

You don't need to scan for devices every time you want to connect to a device. You can simply save the `deviceId` of the device and use it to reconnect to the device later.

#### Communicate with a device[¶](#communicate-with-a-device "Permanent link")

Before you can communicate with a device, you need to discover the services and characteristics of the device. For this, you can use the [discoverServices](/docs/sdks/capacitor/bluetooth-low-energy/#discoverservices) method:

`[](#%5F%5Fcodelineno-3-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-3-2)
[](#%5F%5Fcodelineno-3-3)const discoverServices = async () => {
[](#%5F%5Fcodelineno-3-4)  await BluetoothLowEnergy.discoverServices();
[](#%5F%5Fcodelineno-3-5)};
`

Use the [getServices](/docs/sdks/capacitor/bluetooth-low-energy/#getservices) method to get a list of all services, characteristics, and descriptors of the device:

`[](#%5F%5Fcodelineno-4-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const getServices = async () => {
[](#%5F%5Fcodelineno-4-4)  const { services } = await BluetoothLowEnergy.getServices();
[](#%5F%5Fcodelineno-4-5)  console.log("Services: ", services);
[](#%5F%5Fcodelineno-4-6)};
`

Now you can read, write, and subscribe to characteristics and descriptors using the following methods:

* [readCharacteristic](/docs/sdks/capacitor/bluetooth-low-energy/#readcharacteristic)
* [writeCharacteristic](/docs/sdks/capacitor/bluetooth-low-energy/#writecharacteristic)
* [startCharacteristicNotifications](/docs/sdks/capacitor/bluetooth-low-energy/#startcharacteristicnotifications)
* [stopCharacteristicNotifications](/docs/sdks/capacitor/bluetooth-low-energy/#stopcharacteristicnotifications)
* [readDescriptor](/docs/sdks/capacitor/bluetooth-low-energy/#readdescriptor)
* [writeDescriptor](/docs/sdks/capacitor/bluetooth-low-energy/#writedescriptor)

This is an example of how to read a characteristic value:

`[](#%5F%5Fcodelineno-5-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-5-2)
[](#%5F%5Fcodelineno-5-3)const readCharacteristic = async (characteristicId: string) => {
[](#%5F%5Fcodelineno-5-4)  const { value } = await BluetoothLowEnergy.readCharacteristic({
[](#%5F%5Fcodelineno-5-5)    characteristicId,
[](#%5F%5Fcodelineno-5-6)  });
[](#%5F%5Fcodelineno-5-7)  console.log("Value: ", value); // e.g. [1, 2, 3, 4]
[](#%5F%5Fcodelineno-5-8)};
`

Values are exchanged as byte arrays. You can convert them to a hex string using the [convertBytesToHex](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/bluetooth-low-energy/docs/utils/README.md) method:

`[](#%5F%5Fcodelineno-6-1)import { BluetoothLowEnergyUtils } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)const convertBytesToHex = async (bytes: number[]) => {
[](#%5F%5Fcodelineno-6-4)  const { hex } = await BluetoothLowEnergyUtils.convertBytesToHex({ bytes });
[](#%5F%5Fcodelineno-6-5)  console.log("Hex: ", hex); // e.g. "01020304"
[](#%5F%5Fcodelineno-6-6)};
`

#### Disconnect from a device[¶](#disconnect-from-a-device "Permanent link")

To disconnect from a device, you simply need to call the [disconnect](/docs/sdks/capacitor/bluetooth-low-energy/#disconnect) method:

`[](#%5F%5Fcodelineno-7-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-7-2)
[](#%5F%5Fcodelineno-7-3)const disconnect = async () => {
[](#%5F%5Fcodelineno-7-4)  await BluetoothLowEnergy.disconnect();
[](#%5F%5Fcodelineno-7-5)};
`

### Peripheral role[¶](#peripheral-role "Permanent link")

The peripheral role allows you to advertise your app as a BLE device and accept connections from central devices.

#### Initialize the plugin[¶](#initialize-the-plugin%5F1 "Permanent link")

The initialization process is the same as in the central role. You need to call the [initialize](/docs/sdks/capacitor/bluetooth-low-energy/#initialize) method on iOS and the [requestPermissions](/docs/sdks/capacitor/bluetooth-low-energy/#requestpermissions) method on Android.

`[](#%5F%5Fcodelineno-8-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-8-2)
[](#%5F%5Fcodelineno-8-3)const initialize = async () => {
[](#%5F%5Fcodelineno-8-4)  if (Capacitor.getPlatform() === "ios") {
[](#%5F%5Fcodelineno-8-5)    await BluetoothLowEnergy.initialize({
[](#%5F%5Fcodelineno-8-6)      mode: "peripheral",
[](#%5F%5Fcodelineno-8-7)    });
[](#%5F%5Fcodelineno-8-8)  } else {
[](#%5F%5Fcodelineno-8-9)    await BluetoothLowEnergy.requestPermissions();
[](#%5F%5Fcodelineno-8-10)  }
[](#%5F%5Fcodelineno-8-11)};
`

#### Start advertising[¶](#start-advertising "Permanent link")

To start advertising your app as a BLE device, you can use the [startAdvertising](/docs/sdks/capacitor/bluetooth-low-energy/#startadvertising) method:

`[](#%5F%5Fcodelineno-9-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-9-2)
[](#%5F%5Fcodelineno-9-3)const startAdvertising = async () => {
[](#%5F%5Fcodelineno-9-4)  await BluetoothLowEnergy.startAdvertising({
[](#%5F%5Fcodelineno-9-5)    name: "CapBLE",
[](#%5F%5Fcodelineno-9-6)    services: [
[](#%5F%5Fcodelineno-9-7)      {
[](#%5F%5Fcodelineno-9-8)        id: "12345678-1234-1234-1234-1234567890AB",
[](#%5F%5Fcodelineno-9-9)        characteristics: [
[](#%5F%5Fcodelineno-9-10)          {
[](#%5F%5Fcodelineno-9-11)            id: "87654321-4321-4321-4321-BA0987654321",
[](#%5F%5Fcodelineno-9-12)            descriptors: [],
[](#%5F%5Fcodelineno-9-13)            permissions: {
[](#%5F%5Fcodelineno-9-14)              read: true,
[](#%5F%5Fcodelineno-9-15)              write: true,
[](#%5F%5Fcodelineno-9-16)            },
[](#%5F%5Fcodelineno-9-17)            properties: {
[](#%5F%5Fcodelineno-9-18)              indicate: true,
[](#%5F%5Fcodelineno-9-19)              notify: true,
[](#%5F%5Fcodelineno-9-20)              read: true,
[](#%5F%5Fcodelineno-9-21)              write: true,
[](#%5F%5Fcodelineno-9-22)            },
[](#%5F%5Fcodelineno-9-23)          },
[](#%5F%5Fcodelineno-9-24)        ],
[](#%5F%5Fcodelineno-9-25)      },
[](#%5F%5Fcodelineno-9-26)    ],
[](#%5F%5Fcodelineno-9-27)  });
[](#%5F%5Fcodelineno-9-28)};
`

The `startAdvertising` method allows you to specify the name of the peripheral and the services it provides. The services can include characteristics with various properties and permissions.

#### Communicate with a device[¶](#communicate-with-a-device%5F1 "Permanent link")

After starting advertising, devices can connect to your app. You can listen to the `deviceConnected` event to get notified when a device connects to your app:

`[](#%5F%5Fcodelineno-10-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-10-2)
[](#%5F%5Fcodelineno-10-3)const addListener = async () => {
[](#%5F%5Fcodelineno-10-4)  await BluetoothLowEnergy.addListener("deviceConnected", (event) => {
[](#%5F%5Fcodelineno-10-5)    console.log("Device connected", event.deviceId);
[](#%5F%5Fcodelineno-10-6)  });
[](#%5F%5Fcodelineno-10-7)};
`

You can also listen to the `deviceDisconnected` event to get notified when a device disconnects from your app:

`[](#%5F%5Fcodelineno-11-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-11-2)
[](#%5F%5Fcodelineno-11-3)const addListener = async () => {
[](#%5F%5Fcodelineno-11-4)  await BluetoothLowEnergy.addListener("deviceDisconnected", (event) => {
[](#%5F%5Fcodelineno-11-5)    console.log("Device disconnected", event.deviceId);
[](#%5F%5Fcodelineno-11-6)  });
[](#%5F%5Fcodelineno-11-7)};
`

Read requests from devices are handled automatically by the plugin. You can use the [setCharacteristicValue](/docs/sdks/capacitor/bluetooth-low-energy/#setcharacteristicvalue) method to set or update the value of a characteristic:

`[](#%5F%5Fcodelineno-12-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-12-2)
[](#%5F%5Fcodelineno-12-3)const setCharacteristicValue = async () => {
[](#%5F%5Fcodelineno-12-4)  await BluetoothLowEnergy.setCharacteristicValue({
[](#%5F%5Fcodelineno-12-5)    characteristicId: "87654321-4321-4321-4321-BA0987654321",
[](#%5F%5Fcodelineno-12-6)    serviceId: "12345678-1234-1234-1234-1234567890AB",
[](#%5F%5Fcodelineno-12-7)    value: [1, 2, 3, 4], // Value byte array
[](#%5F%5Fcodelineno-12-8)  });
[](#%5F%5Fcodelineno-12-9)};
`

If a device wants to write a value to a characteristic, the plugin will emit the `characteristicWriteRequest` event. You can listen to this event and respond to the write request using the [setCharacteristicValue](/docs/sdks/capacitor/bluetooth-low-energy/#setcharacteristicvalue) method:

`[](#%5F%5Fcodelineno-13-1)import { BluetoothLowEnergy } from "@capawesome-team/capacitor-bluetooth-low-energy";
[](#%5F%5Fcodelineno-13-2)
[](#%5F%5Fcodelineno-13-3)const addListener = async () => {
[](#%5F%5Fcodelineno-13-4)  await BluetoothLowEnergy.addListener(
[](#%5F%5Fcodelineno-13-5)    "characteristicWriteRequest",
[](#%5F%5Fcodelineno-13-6)    (event) => {
[](#%5F%5Fcodelineno-13-7)      console.log("Characteristic write request", event);
[](#%5F%5Fcodelineno-13-8)      // Respond to the write request
[](#%5F%5Fcodelineno-13-9)      void BluetoothLowEnergy.setCharacteristicValue({
[](#%5F%5Fcodelineno-13-10)        characteristicId: event.characteristicId,
[](#%5F%5Fcodelineno-13-11)        serviceId: event.serviceId,
[](#%5F%5Fcodelineno-13-12)        value: event.value,
[](#%5F%5Fcodelineno-13-13)      });
[](#%5F%5Fcodelineno-13-14)    }
[](#%5F%5Fcodelineno-13-15)  );
[](#%5F%5Fcodelineno-13-16)};
`

## FAQ[¶](#faq "Permanent link")

### Which platforms does the Capacitor Bluetooth Low Energy plugin support?[¶](#which-platforms-does-the-capacitor-bluetooth-low-energy-plugin-support "Permanent link")

The plugin supports Android and iOS in both the central and peripheral role.

### Can my app act as a BLE peripheral, not just a central?[¶](#can-my-app-act-as-a-ble-peripheral-not-just-a-central "Permanent link")

Yes. In the **central** role your app scans for and connects to other BLE devices; in the **peripheral** role your app advertises its own services and accepts connections from central devices. Both roles are supported on Android and iOS.

### How do I read and write characteristic values?[¶](#how-do-i-read-and-write-characteristic-values "Permanent link")

After connecting to a device and calling `discoverServices()`, use `readCharacteristic` and `writeCharacteristic`, and subscribe to updates with `startCharacteristicNotifications`. Values are exchanged as byte arrays, which you can convert to a hex string with `convertBytesToHex`.

### Do I need to scan for a device every time I connect?[¶](#do-i-need-to-scan-for-a-device-every-time-i-connect "Permanent link")

No. Once you know a device's `deviceId`, you can save it and reconnect later with `connect({ deviceId })` without scanning again.

## Closing Thoughts[¶](#closing-thoughts "Permanent link")

The [Capacitor Bluetooth Low Energy plugin](/docs/sdks/capacitor/bluetooth-low-energy/) supports the full BLE workflow in both roles — scanning, connecting, discovering services, and reading, writing, and subscribing to characteristics — across Android and iOS.

**Related reading:**

* [API Reference](/docs/sdks/capacitor/bluetooth-low-energy/#api) — the full method and event reference
* [Capacitor NFC plugin: read and write NFC tags](/blog/announcing-the-capacitor-nfc-plugin/) — another Capawesome plugin for device communication

**Missing a feature?** [Create a feature request](https://github.com/capawesome-team/capacitor-plugins/issues/new/choose) in our [GitHub repository](https://github.com/capawesome-team/capacitor-plugins).

Join the Capawesome [Discord](https://discord.gg/VCXxSVjefW) server for questions and subscribe to the Capawesome [newsletter](https://capawesome.io/newsletter/) to stay updated.

July 16, 2026 

Back to top

```json
{
      "@context": "https://schema.org",
      "@type": "BlogPosting",
      "headline": "Capacitor BLE Plugin: Bluetooth Low Energy",
      "description": "The Capacitor Bluetooth Low Energy plugin enables interaction with Bluetooth Low Energy (BLE) devices in the central and peripheral role.",
      "image": "https://capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.png",
      "datePublished": "2024-05-20T00:00:00+00:00",
      "dateModified": "2026-07-10T00:00:00+00:00",
      "author": [
        {
          "@type": "Person",
          "name": "Robin Genz",
          "url": "https://github.com/robingenz"
        }
      ],
      "publisher": {
        "@type": "Organization",
        "name": "Capawesome",
        "url": "https://capawesome.io",
        "logo": {
          "@type": "ImageObject",
          "url": "https://capawesome.io/assets/images/logo.svg"
        }
      },
      "articleSection": "Announcements",
      "keywords": ["Announcements", "Capacitor", "SDKs"],
      "isPartOf": {
        "@type": "Blog",
        "@id": "https://capawesome.io/blog/#blog"
      },
      "mainEntityOfPage": "https://capawesome.io/blog/announcing-the-capacitor-bluetooth-low-energy-plugin/",
      "url": "https://capawesome.io/blog/announcing-the-capacitor-bluetooth-low-energy-plugin/"
    }
{
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://capawesome.io/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Blog",
          "item": "https://capawesome.io/blog/"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "Capacitor BLE Plugin: Bluetooth Low Energy",
          "item": "https://capawesome.io/blog/announcing-the-capacitor-bluetooth-low-energy-plugin/"
        }
      ]
    }
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Which platforms does the Capacitor Bluetooth Low Energy plugin support?", "acceptedAnswer": {"@type": "Answer", "text": "The plugin supports Android and iOS in both the central and peripheral role."}}, {"@type": "Question", "name": "Can my app act as a BLE peripheral, not just a central?", "acceptedAnswer": {"@type": "Answer", "text": "Yes. In the central role your app scans for and connects to other BLE devices; in the peripheral role your app advertises its own services and accepts connections from central devices. Both roles are supported on Android and iOS."}}, {"@type": "Question", "name": "How do I read and write characteristic values?", "acceptedAnswer": {"@type": "Answer", "text": "After connecting to a device and calling discoverServices(), use readCharacteristic and writeCharacteristic, and subscribe to updates with startCharacteristicNotifications. Values are exchanged as byte arrays, which you can convert to a hex string with convertBytesToHex."}}, {"@type": "Question", "name": "Do I need to scan for a device every time I connect?", "acceptedAnswer": {"@type": "Answer", "text": "No. Once you know a device's deviceId, you can save it and reconnect later with connect({ deviceId }) without scanning again."}}], "url": "https://capawesome.io/blog/announcing-the-capacitor-bluetooth-low-energy-plugin/"}
```
