@capacitor-community/bluetooth-le
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -86,3 +86,3 @@ import type { DisplayStrings } from './config'; | ||
* On Android, you can directly connect to the device with the deviceId. | ||
* @param deviceIds List of device IDs, e.g. saved from a previous app run. No used on **web**. | ||
* @param deviceIds List of device IDs, e.g. saved from a previous app run. | ||
*/ | ||
@@ -89,0 +89,0 @@ getDevices(deviceIds: string[]): Promise<BleDevice[]>; |
@@ -25,3 +25,3 @@ import { WebPlugin } from '@capacitor/core'; | ||
stopLEScan(): Promise<void>; | ||
getDevices(_options: GetDevicesOptions): Promise<GetDevicesResult>; | ||
getDevices(options: GetDevicesOptions): Promise<GetDevicesResult>; | ||
getConnectedDevices(_options: GetConnectedDevicesOptions): Promise<GetDevicesResult>; | ||
@@ -28,0 +28,0 @@ connect(options: DeviceIdOptions & TimeoutOptions): Promise<void>; |
@@ -106,5 +106,7 @@ import { WebPlugin } from '@capacitor/core'; | ||
} | ||
async getDevices(_options) { | ||
async getDevices(options) { | ||
const devices = await navigator.bluetooth.getDevices(); | ||
const bleDevices = devices.map((device) => { | ||
const bleDevices = devices | ||
.filter((device) => options.deviceIds.includes(device.id)) | ||
.map((device) => { | ||
this.deviceMap.set(device.id, device); | ||
@@ -111,0 +113,0 @@ const bleDevice = this.getBleDevice(device); |
@@ -604,5 +604,7 @@ 'use strict'; | ||
} | ||
async getDevices(_options) { | ||
async getDevices(options) { | ||
const devices = await navigator.bluetooth.getDevices(); | ||
const bleDevices = devices.map((device) => { | ||
const bleDevices = devices | ||
.filter((device) => options.deviceIds.includes(device.id)) | ||
.map((device) => { | ||
this.deviceMap.set(device.id, device); | ||
@@ -609,0 +611,0 @@ const bleDevice = this.getBleDevice(device); |
@@ -600,5 +600,7 @@ var capacitorCommunityBluetoothLe = (function (exports, core, throat) { | ||
} | ||
async getDevices(_options) { | ||
async getDevices(options) { | ||
const devices = await navigator.bluetooth.getDevices(); | ||
const bleDevices = devices.map((device) => { | ||
const bleDevices = devices | ||
.filter((device) => options.deviceIds.includes(device.id)) | ||
.map((device) => { | ||
this.deviceMap.set(device.id, device); | ||
@@ -605,0 +607,0 @@ const bleDevice = this.getBleDevice(device); |
{ | ||
"name": "@capacitor-community/bluetooth-le", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Capacitor plugin for Bluetooth Low Energy ", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
614829
5180