> ## 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.getBluetoothDevices

> Get all discovered Bluetooth devices.

Use this API to get all Bluetooth devices discovered during the current session, including devices that are no longer in range.

## Parameters

| Property | Type     | Required | Description                   |
| -------- | -------- | -------- | ----------------------------- |
| success  | Function | No       | Callback on success           |
| fail     | Function | No       | Callback on failure           |
| complete | Function | No       | Callback that always executes |

## Success Callback Parameters

| Property | Type  | Description                |
| -------- | ----- | -------------------------- |
| devices  | Array | List of discovered devices |

## Device Object Properties

| Property         | Type       | Description                                                     |
| ---------------- | ---------- | --------------------------------------------------------------- |
| deviceId         | String     | Device ID                                                       |
| name             | String     | Name of the Bluetooth device (some devices may not have a name) |
| deviceName       | String     | Name of the Bluetooth device                                    |
| localName        | String     | Name of the local device                                        |
| RSSI             | Number     | Received Signal Strength Indicator                              |
| advertisData     | Hex String | Advertisement data of the device                                |
| manufacturerData | Hex String | Manufacturer data of the device                                 |

## Code Example

### Basic Usage

```javascript theme={null}
my.getBluetoothDevices({
  success(res) {
    console.log('Found devices:', res.devices);
  }
});
```

### Display Device List

```javascript theme={null}
Page({
  data: {
    devices: []
  },

  refreshDeviceList() {
    my.getBluetoothDevices({
      success: (res) => {
        // Filter devices with names
        const namedDevices = res.devices.filter(d => d.name);
        this.setData({ devices: namedDevices });
      }
    });
  }
});
```

### Sort by Signal Strength

```javascript theme={null}
Page({
  getDevicesBySignal() {
    my.getBluetoothDevices({
      success: (res) => {
        // Sort by RSSI (closer devices first)
        const sorted = res.devices.sort((a, b) => b.RSSI - a.RSSI);
        this.setData({ devices: sorted });
      }
    });
  }
});
```

<Tip>
  This returns all devices found since discovery started. For real-time updates, use `my.onBluetoothDeviceFound` instead.
</Tip>

## Related APIs

<CardGroup cols={2}>
  <Card title="my.onBluetoothDeviceFound" icon="magnifying-glass" href="/jsapi/device/bluetooth/my.onBluetoothDeviceFound">
    Listen for new devices
  </Card>

  <Card title="my.getConnectedBluetoothDevices" icon="link" href="/jsapi/device/bluetooth/my.getConnectedBluetoothDevices">
    Get connected devices
  </Card>
</CardGroup>
