> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.offBluetoothAdapterStateChange

> Stop listening for Bluetooth adapter state changes.

Use this API to stop listening for Bluetooth adapter state changes that were registered with `my.onBluetoothAdapterStateChange()`.

## Parameters

| Property | Type     | Required | Description                                                             |
| -------- | -------- | -------- | ----------------------------------------------------------------------- |
| callback | Function | No       | The specific callback to remove. If omitted, all listeners are removed. |

## Code Example

### Remove All Listeners

```javascript theme={null}
my.offBluetoothAdapterStateChange();
```

### Remove Specific Listener

```javascript theme={null}
Page({
  onLoad() {
    my.onBluetoothAdapterStateChange(this.handleStateChange);
  },

  handleStateChange(res) {
    console.log('State changed:', res.available);
  },

  onUnload() {
    my.offBluetoothAdapterStateChange(this.handleStateChange);
  }
});
```

### Complete Bluetooth Cleanup

```javascript theme={null}
function cleanupBluetooth() {
  // Remove all listeners
  my.offBluetoothAdapterStateChange();
  my.offBluetoothDeviceFound();

  // Stop discovery and close adapter
  my.stopBluetoothDevicesDiscovery();
  my.closeBluetoothAdapter();
}
```

## Related APIs

<CardGroup cols={2}>
  <Card title="my.onBluetoothAdapterStateChange" icon="rotate" href="/jsapi/device/bluetooth/my.onBluetoothAdapterStateChange">
    Listen for state changes
  </Card>

  <Card title="my.closeBluetoothAdapter" icon="xmark" href="/jsapi/device/bluetooth/my.closeBluetoothAdapter">
    Close adapter
  </Card>
</CardGroup>
