Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get all discovered Bluetooth devices.
my.getBluetoothDevices({ success(res) { console.log('Found devices:', res.devices); } });
Page({ data: { devices: [] }, refreshDeviceList() { my.getBluetoothDevices({ success: (res) => { // Filter devices with names const namedDevices = res.devices.filter(d => d.name); this.setData({ devices: namedDevices }); } }); } });
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 }); } }); } });
my.onBluetoothDeviceFound