<br />

> [!NOTE]
> **Important:** This API works **only on ChromeOS**.

<br />

<br />

## Description

The `chrome.bluetoothLowEnergy` API is used to communicate with Bluetooth Smart (Low Energy) devices using the [Generic Attribute Profile (GATT)](https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx).

<br />

<br />

<br />

## Availability

ChromeOS only

<br />

<br />

## Manifest

The following keys must be declared [in the manifest](https://developer.chrome.com/docs/extensions/mv3/manifest) to use this API.
`"bluetooth"`  

<br />

<br />

## Types

### Advertisement

Chrome 47+

#### Properties

- manufacturerData [ManufacturerData](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-ManufacturerData)\[\] optional

  List of manufacturer specific data to be included in "Manufacturer Specific Data" fields of the advertising data.
- serviceData [ServiceData](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-ServiceData)\[\] optional

  List of service data to be included in "Service Data" fields of the advertising data.
- serviceUuids string\[\] optional

  List of UUIDs to include in the "Service UUIDs" field of the Advertising Data. These UUIDs can be of the 16bit, 32bit or 128 formats.
- solicitUuids string\[\] optional

  List of UUIDs to include in the "Solicit UUIDs" field of the Advertising Data. These UUIDs can be of the 16bit, 32bit or 128 formats.
- type [AdvertisementType](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-AdvertisementType)

  Type of advertisement.

### AdvertisementType

Chrome 47+

Type of advertisement. If 'broadcast' is chosen, the sent advertisement type will be ADV_NONCONN_IND and the device will broadcast with a random MAC Address. If set to 'peripheral', the advertisement type will be ADV_IND or ADV_SCAN_IND and the device will broadcast with real Bluetooth Adapter's MAC Address.

#### Enum

"broadcast"   
"peripheral"   

<br />

### Characteristic

#### Properties

- instanceId string optional

  Returns the identifier assigned to this characteristic. Use the instance ID to distinguish between characteristics from a peripheral with the same UUID and to make function calls that take in a characteristic identifier. Present, if this instance represents a remote characteristic.
- properties [CharacteristicProperty](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-CharacteristicProperty)\[\]

  The properties of this characteristic.
- service [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service) optional

  The GATT service this characteristic belongs to.
- uuid string

  The UUID of the characteristic, e.g. 00002a37-0000-1000-8000-00805f9b34fb.
- value ArrayBuffer optional

  The currently cached characteristic value. This value gets updated when the value of the characteristic is read or updated via a notification or indication.

### CharacteristicProperty

Values representing the possible properties of a characteristic. Characteristic permissions are inferred from these properties. Please see the Bluetooth 4.x spec to see the meaning of each individual property.

#### Enum

"broadcast"   
"read"   
"writeWithoutResponse"   
"write"   
"notify"   
"indicate"   
"authenticatedSignedWrites"   
"extendedProperties"   
"reliableWrite"   
"writableAuxiliaries"   
"encryptRead"   
"encryptWrite"   
"encryptAuthenticatedRead"   
"encryptAuthenticatedWrite"   

<br />

### ConnectProperties

#### Properties

- persistent boolean

  Flag indicating whether a connection to the device is left open when the event page of the application is unloaded (see [Manage App Lifecycle](https://developer.chrome.com/docs/apps/app_lifecycle)). The default value is `false.`

### Descriptor

#### Properties

- characteristic [Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic) optional

  The GATT characteristic this descriptor belongs to.
- instanceId string optional

  Returns the identifier assigned to this descriptor. Use the instance ID to distinguish between descriptors from a peripheral with the same UUID and to make function calls that take in a descriptor identifier. Present, if this instance represents a remote characteristic.
- permissions [DescriptorPermission](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-DescriptorPermission)\[\]
  Chrome 52+

  The permissions of this descriptor.
- uuid string

  The UUID of the characteristic descriptor, e.g. 00002902-0000-1000-8000-00805f9b34fb.
- value ArrayBuffer optional

  The currently cached descriptor value. This value gets updated when the value of the descriptor is read.

### DescriptorPermission

Chrome 52+

Values representing possible permissions for a descriptor. Please see the Bluetooth 4.x spec to see the meaning of each individual permission.

#### Enum

"read"   
"write"   
"encryptedRead"   
"encryptedWrite"   
"encryptedAuthenticatedRead"   
"encryptedAuthenticatedWrite"   

<br />

### Device

Chrome 52+

#### Properties

- address string

  The address of the device, in the format 'XX:XX:XX:XX:XX:XX'.
- deviceClass number optional

  The class of the device, a bit-field defined by http://www.bluetooth.org/en-us/specification/assigned-numbers/baseband.
- name string optional

  The human-readable name of the device.

### ManufacturerData

Chrome 47+

#### Properties

- data number\[\]
- id number

### Notification

Chrome 52+

#### Properties

- shouldIndicate boolean optional

  Optional flag for sending an indication instead of a notification.
- value ArrayBuffer

  New value of the characteristic.

### NotificationProperties

#### Properties

- persistent boolean

  Flag indicating whether the app should receive notifications when the event page of the application is unloaded (see [Manage App Lifecycle](https://developer.chrome.com/docs/apps/app_lifecycle)). The default value is `false`.

### Request

Chrome 52+

#### Properties

- device [Device](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Device)

  Device that send this request.
- requestId number

  Unique ID for this request. Use this ID when responding to this request.
- value ArrayBuffer optional

  Value to write (if this is a write request).

### Response

Chrome 52+

#### Properties

- isError boolean

  If this is an error response, this should be true.
- requestId number

  Id of the request this is a response to.
- value ArrayBuffer optional

  Response value. Write requests and error responses will ignore this parameter.

### Service

#### Properties

- deviceAddress string optional

  The device address of the remote peripheral that the GATT service belongs to. Present, if this instance represents a remote service.
- instanceId string optional

  Returns the identifier assigned to this service. Use the instance ID to distinguish between services from a peripheral with the same UUID and to make function calls that take in a service identifier. Present, if this instance represents a remote service.
- isPrimary boolean

  Indicates whether the type of this service is primary or secondary.
- uuid string

  The UUID of the service, e.g. 0000180d-0000-1000-8000-00805f9b34fb.

### ServiceData

Chrome 47+

#### Properties

- data number\[\]
- uuid string

## Methods

### connect()

Promise

```typescript
chrome.bluetoothLowEnergy.connect(
  deviceAddress: string,
  properties?: ConnectProperties,
  callback?: function,
): Promise<void>
```

Establishes a connection between the application and the device with the given address. A device may be already connected and its GATT services available without calling `connect`, however, an app that wants to access GATT services of a device should call this function to make sure that a connection to the device is maintained. If the device is not connected, all GATT services of the device will be discovered after a successful call to `connect`.

#### Parameters

- deviceAddress string

  The Bluetooth address of the remote device to which a GATT connection should be opened.
- properties [ConnectProperties](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-ConnectProperties) optional

  Connection properties (optional).
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### createCharacteristic()

Promise Chrome 52+

```typescript
chrome.bluetoothLowEnergy.createCharacteristic(
  characteristic: Characteristic,
  serviceId: string,
  callback?: function,
): Promise<string>
```

Create a locally hosted GATT characteristic. This characteristic must be hosted under a valid service. If the service ID is not valid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- characteristic [Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)

  The characteristic to create.
- serviceId string

  ID of the service to create this characteristic for.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (characteristicId: string) => void
  ```

  <br />

  - characteristicId string

#### Returns

- Promise\<string\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### createDescriptor()

Promise Chrome 52+

```typescript
chrome.bluetoothLowEnergy.createDescriptor(
  descriptor: Descriptor,
  characteristicId: string,
  callback?: function,
): Promise<string>
```

Create a locally hosted GATT descriptor. This descriptor must be hosted under a valid characteristic. If the characteristic ID is not valid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- descriptor [Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)

  The descriptor to create.
- characteristicId string

  ID of the characteristic to create this descriptor for.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (descriptorId: string) => void
  ```

  <br />

  - descriptorId string

#### Returns

- Promise\<string\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### createService()

Promise Chrome 52+

```typescript
chrome.bluetoothLowEnergy.createService(
  service: Service,
  callback?: function,
): Promise<string>
```

Create a locally hosted GATT service. This service can be registered to be available on a local GATT server. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- service [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)

  The service to create.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (serviceId: string) => void
  ```

  <br />

  - serviceId string

#### Returns

- Promise\<string\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### disconnect()

Promise

```typescript
chrome.bluetoothLowEnergy.disconnect(
  deviceAddress: string,
  callback?: function,
): Promise<void>
```

Closes the app's connection to the device with the given address. Note that this will not always destroy the physical link itself, since there may be other apps with open connections.

#### Parameters

- deviceAddress string

  The Bluetooth address of the remote device.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getCharacteristic()

Promise

```typescript
chrome.bluetoothLowEnergy.getCharacteristic(
  characteristicId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic>
```

Get the GATT characteristic with the given instance ID that belongs to the given GATT service, if the characteristic exists.

#### Parameters

- characteristicId string

  The instance ID of the requested GATT characteristic.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Characteristic) => void
  ```

  <br />

  - result [Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)

#### Returns

- Promise\<[Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getCharacteristics()

Promise

```typescript
chrome.bluetoothLowEnergy.getCharacteristics(
  serviceId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic[]>
```

Get a list of all discovered GATT characteristics that belong to the given service.

#### Parameters

- serviceId string

  The instance ID of the GATT service whose characteristics should be returned.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Characteristic[]) => void
  ```

  <br />

  - result [Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)\[\]

#### Returns

- Promise\<[Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)\[\]\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getDescriptor()

Promise

```typescript
chrome.bluetoothLowEnergy.getDescriptor(
  descriptorId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor>
```

Get the GATT characteristic descriptor with the given instance ID.

#### Parameters

- descriptorId string

  The instance ID of the requested GATT characteristic descriptor.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Descriptor) => void
  ```

  <br />

  - result [Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)

#### Returns

- Promise\<[Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getDescriptors()

Promise

```typescript
chrome.bluetoothLowEnergy.getDescriptors(
  characteristicId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor[]>
```

Get a list of GATT characteristic descriptors that belong to the given characteristic.

#### Parameters

- characteristicId string

  The instance ID of the GATT characteristic whose descriptors should be returned.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Descriptor[]) => void
  ```

  <br />

  - result [Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)\[\]

#### Returns

- Promise\<[Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)\[\]\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getIncludedServices()

Promise

```typescript
chrome.bluetoothLowEnergy.getIncludedServices(
  serviceId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service[]>
```

Get a list of GATT services that are included by the given service.

#### Parameters

- serviceId string

  The instance ID of the GATT service whose included services should be returned.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Service[]) => void
  ```

  <br />

  - result [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)\[\]

#### Returns

- Promise\<[Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)\[\]\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getService()

Promise

```typescript
chrome.bluetoothLowEnergy.getService(
  serviceId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service>
```

Get the GATT service with the given instance ID.

#### Parameters

- serviceId string

  The instance ID of the requested GATT service.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Service) => void
  ```

  <br />

  - result [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)

#### Returns

- Promise\<[Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getServices()

Promise

```typescript
chrome.bluetoothLowEnergy.getServices(
  deviceAddress: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service[]>
```

Get all the GATT services that were discovered on the remote device with the given device address.

*Note:* If service discovery is not yet complete on the device, this API will return a subset (possibly empty) of services. A work around is to add a time based delay and/or call repeatedly until the expected number of services is returned.

#### Parameters

- deviceAddress string

  The Bluetooth address of the remote device whose GATT services should be returned.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Service[]) => void
  ```

  <br />

  - result [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)\[\]

#### Returns

- Promise\<[Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)\[\]\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### notifyCharacteristicValueChanged()

Promise Chrome 52+

```typescript
chrome.bluetoothLowEnergy.notifyCharacteristicValueChanged(
  characteristicId: string,
  notification: Notification,
  callback?: function,
): Promise<void>
```

Notify a remote device of a new value for a characteristic. If the shouldIndicate flag in the notification object is true, an indication will be sent instead of a notification. Note, the characteristic needs to correctly set the 'notify' or 'indicate' property during creation for this call to succeed. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- characteristicId string

  The characteristic to send the notication for.
- notification [Notification](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Notification)
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### readCharacteristicValue()

Promise

```typescript
chrome.bluetoothLowEnergy.readCharacteristicValue(
  characteristicId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic>
```

Retrieve the value of a specified characteristic from a remote peripheral.

#### Parameters

- characteristicId string

  The instance ID of the GATT characteristic whose value should be read from the remote device.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Characteristic) => void
  ```

  <br />

  - result [Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)

#### Returns

- Promise\<[Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### readDescriptorValue()

Promise

```typescript
chrome.bluetoothLowEnergy.readDescriptorValue(
  descriptorId: string,
  callback?: function,
): Promise<https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor>
```

Retrieve the value of a specified characteristic descriptor from a remote peripheral.

#### Parameters

- descriptorId string

  The instance ID of the GATT characteristic descriptor whose value should be read from the remote device.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (result: Descriptor) => void
  ```

  <br />

  - result [Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)

#### Returns

- Promise\<[Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### registerAdvertisement()

Promise Chrome 47+

```typescript
chrome.bluetoothLowEnergy.registerAdvertisement(
  advertisement: Advertisement,
  callback?: function,
): Promise<number>
```

Create an advertisement and register it for advertising. To call this function, the app must have the bluetooth:low_energy and bluetooth:peripheral permissions set to true. Additionally this API is only available to auto launched apps in Kiosk Mode or by setting the '--enable-ble-advertising-in-apps' command-line switch. See https://developer.chrome.com/apps/manifest/bluetooth Note: On some hardware, central and peripheral modes at the same time is supported but on hardware that doesn't support this, making this call will switch the device to peripheral mode. In the case of hardware which does not support both central and peripheral mode, attempting to use the device in both modes will lead to undefined behavior or prevent other central-role applications from behaving correctly (including the discovery of Bluetooth Low Energy devices).

#### Parameters

- advertisement [Advertisement](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Advertisement)

  The advertisement to advertise.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (advertisementId: number) => void
  ```

  <br />

  - advertisementId number

#### Returns

- Promise\<number\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### registerService()

Promise Chrome 52+

```typescript
chrome.bluetoothLowEnergy.registerService(
  serviceId: string,
  callback?: function,
): Promise<void>
```

Register the given service with the local GATT server. If the service ID is invalid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- serviceId string

  Unique ID of a created service.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### removeService()

Promise Chrome 52+

```typescript
chrome.bluetoothLowEnergy.removeService(
  serviceId: string,
  callback?: function,
): Promise<void>
```

Remove the specified service, unregistering it if it was registered. If the service ID is invalid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- serviceId string

  Unique ID of a current registered service.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### resetAdvertising()

Promise Chrome 61+

```typescript
chrome.bluetoothLowEnergy.resetAdvertising(
  callback?: function,
): Promise<void>
```

Resets advertising on the current device. It will unregister and stop all existing advertisements.

#### Parameters

- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### sendRequestResponse()

Chrome 52+

```typescript
chrome.bluetoothLowEnergy.sendRequestResponse(
  response: Response,
): void
```

Sends a response for a characteristic or descriptor read/write request. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- response [Response](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Response)

  The response to the request.

### setAdvertisingInterval()

Promise Chrome 55+

```typescript
chrome.bluetoothLowEnergy.setAdvertisingInterval(
  minInterval: number,
  maxInterval: number,
  callback?: function,
): Promise<void>
```

Set's the interval betweeen two consecutive advertisements. Note: This is a best effort. The actual interval may vary non-trivially from the requested intervals. On some hardware, there is a minimum interval of 100ms. The minimum and maximum values cannot exceed the the range allowed by the Bluetooth 4.2 specification.

#### Parameters

- minInterval number

  Minimum interval between advertisments (in milliseconds). This cannot be lower than 20ms (as per the spec).
- maxInterval number

  Maximum interval between advertisments (in milliseconds). This cannot be more than 10240ms (as per the spec).
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### startCharacteristicNotifications()

Promise

```typescript
chrome.bluetoothLowEnergy.startCharacteristicNotifications(
  characteristicId: string,
  properties?: NotificationProperties,
  callback?: function,
): Promise<void>
```

Enable value notifications/indications from the specified characteristic. Once enabled, an application can listen to notifications using the [`onCharacteristicValueChanged`](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#event-onCharacteristicValueChanged) event.

#### Parameters

- characteristicId string

  The instance ID of the GATT characteristic that notifications should be enabled on.
- properties [NotificationProperties](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-NotificationProperties) optional

  Notification session properties (optional).
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### stopCharacteristicNotifications()

Promise

```typescript
chrome.bluetoothLowEnergy.stopCharacteristicNotifications(
  characteristicId: string,
  callback?: function,
): Promise<void>
```

Disable value notifications/indications from the specified characteristic. After a successful call, the application will stop receiving notifications/indications from this characteristic.

#### Parameters

- characteristicId string

  The instance ID of the GATT characteristic on which this app's notification session should be stopped.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### unregisterAdvertisement()

Promise Chrome 47+

```typescript
chrome.bluetoothLowEnergy.unregisterAdvertisement(
  advertisementId: number,
  callback?: function,
): Promise<void>
```

Unregisters an advertisement and stops its advertising. If the advertisement fails to unregister the only way to stop advertising might be to restart the device.

#### Parameters

- advertisementId number

  Id of the advertisement to unregister.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### unregisterService()

Promise Chrome 52+

```typescript
chrome.bluetoothLowEnergy.unregisterService(
  serviceId: string,
  callback?: function,
): Promise<void>
```

Unregister the given service with the local GATT server. If the service ID is invalid, the lastError will be set. This function is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- serviceId string

  Unique ID of a current registered service.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### writeCharacteristicValue()

Promise

```typescript
chrome.bluetoothLowEnergy.writeCharacteristicValue(
  characteristicId: string,
  value: ArrayBuffer,
  callback?: function,
): Promise<void>
```

Write the value of a specified characteristic from a remote peripheral.

#### Parameters

- characteristicId string

  The instance ID of the GATT characteristic whose value should be written to.
- value ArrayBuffer

  The value that should be sent to the remote characteristic as part of the write request.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### writeDescriptorValue()

Promise

```typescript
chrome.bluetoothLowEnergy.writeDescriptorValue(
  descriptorId: string,
  value: ArrayBuffer,
  callback?: function,
): Promise<void>
```

Write the value of a specified characteristic descriptor from a remote peripheral.

#### Parameters

- descriptorId string

  The instance ID of the GATT characteristic descriptor whose value should be written to.
- value ArrayBuffer

  The value that should be sent to the remote descriptor as part of the write request.
- callback function optional


  The `callback` parameter looks like:

  ```typescript
  () => void
  ```

  <br />

#### Returns

- Promise\<void\>
  Chrome 91+


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

## Events

### onCharacteristicReadRequest

Chrome 52+

```typescript
chrome.bluetoothLowEnergy.onCharacteristicReadRequest.addListener(
  callback: function,
)
```

Fired when a connected central device requests to read the value of a characteristic registered on the local GATT server. Not responding to this request for a long time may lead to a disconnection. This event is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (request: Request, characteristicId: string) => void
  ```

  <br />

  - request [Request](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Request)
  - characteristicId string

### onCharacteristicValueChanged

```typescript
chrome.bluetoothLowEnergy.onCharacteristicValueChanged.addListener(
  callback: function,
)
```

Fired when the value of a remote GATT characteristic changes, either as a result of a read request, or a value change notification/indication This event will only be sent if the app has enabled notifications by calling [`startCharacteristicNotifications`](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#method-startCharacteristicNotifications).

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (characteristic: Characteristic) => void
  ```

  <br />

  - characteristic [Characteristic](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Characteristic)

### onCharacteristicWriteRequest

Chrome 52+

```typescript
chrome.bluetoothLowEnergy.onCharacteristicWriteRequest.addListener(
  callback: function,
)
```

Fired when a connected central device requests to write the value of a characteristic registered on the local GATT server. Not responding to this request for a long time may lead to a disconnection. This event is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (request: Request, characteristicId: string) => void
  ```

  <br />

  - request [Request](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Request)
  - characteristicId string

### onDescriptorReadRequest

Chrome 52+

```typescript
chrome.bluetoothLowEnergy.onDescriptorReadRequest.addListener(
  callback: function,
)
```

Fired when a connected central device requests to read the value of a descriptor registered on the local GATT server. Not responding to this request for a long time may lead to a disconnection. This event is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (request: Request, descriptorId: string) => void
  ```

  <br />

  - request [Request](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Request)
  - descriptorId string

### onDescriptorValueChanged

```typescript
chrome.bluetoothLowEnergy.onDescriptorValueChanged.addListener(
  callback: function,
)
```

Fired when the value of a remote GATT characteristic descriptor changes, usually as a result of a read request. This event exists mostly for convenience and will always be sent after a successful call to [`readDescriptorValue`](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#method-readDescriptorValue).

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (descriptor: Descriptor) => void
  ```

  <br />

  - descriptor [Descriptor](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Descriptor)

### onDescriptorWriteRequest

Chrome 52+

```typescript
chrome.bluetoothLowEnergy.onDescriptorWriteRequest.addListener(
  callback: function,
)
```

Fired when a connected central device requests to write the value of a descriptor registered on the local GATT server. Not responding to this request for a long time may lead to a disconnection. This event is only available if the app has both the bluetooth:low_energy and the bluetooth:peripheral permissions set to true. The peripheral permission may not be available to all apps.

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (request: Request, descriptorId: string) => void
  ```

  <br />

  - request [Request](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Request)
  - descriptorId string

### onServiceAdded

```typescript
chrome.bluetoothLowEnergy.onServiceAdded.addListener(
  callback: function,
)
```

Fired whan a new GATT service has been discovered on a remote device.

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (service: Service) => void
  ```

  <br />

  - service [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)

### onServiceChanged

```typescript
chrome.bluetoothLowEnergy.onServiceChanged.addListener(
  callback: function,
)
```

Fired when the state of a remote GATT service changes. This involves any characteristics and/or descriptors that get added or removed from the service, as well as "ServiceChanged" notifications from the remote device.

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (service: Service) => void
  ```

  <br />

  - service [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)

### onServiceRemoved

```typescript
chrome.bluetoothLowEnergy.onServiceRemoved.addListener(
  callback: function,
)
```

Fired when a GATT service that was previously discovered on a remote device has been removed.

#### Parameters

- callback function


  The `callback` parameter looks like:

  ```typescript
  (service: Service) => void
  ```

  <br />

  - service [Service](https://developer.chrome.com/docs/apps/reference/bluetoothLowEnergy#type-Service)

<br />