From 022e9b93b58fc3d6c95590e5c2f218194378e2fa Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 31 Dec 2025 13:45:46 +0100 Subject: [PATCH] bluetooth enimeration issue (windows) wip --- lib/bluetooth.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/bluetooth.js b/lib/bluetooth.js index c6db539..4e65511 100644 --- a/lib/bluetooth.js +++ b/lib/bluetooth.js @@ -265,7 +265,7 @@ function bluetoothDevices(callback) { } }); } - } catch (e) { + } catch { util.noop(); } } @@ -276,16 +276,16 @@ function bluetoothDevices(callback) { }); } if (_windows) { - util.powerShell('Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer, Status, Service, CinfigManagerErrorCode, Present | fl').then((stdout, error) => { + util.powerShell('Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer, Status, Service, ConfigManagerErrorCode, Present | fl').then((stdout, error) => { if (!error) { const parts = stdout.toString().split(/\n\s*\n/); parts.forEach((part) => { const lines = part.split('\n'); const service = util.getValue(lines, 'Service', ':'); - const errorCode = util.getValue(lines, 'CinfigManagerErrorCode', ':'); + const errorCode = util.getValue(lines, 'ConfigManagerErrorCode', ':'); const pnpClass = util.getValue(lines, 'PNPClass', ':').toLowerCase(); - if (pnpClass === 'Bluetooth' && errorCode === '0' && service === '') { - result.push(parseWindowsBluetooth(part.split('\n'))); + if (pnpClass === 'bluetooth' && errorCode === '0' && service === '') { + result.push(parseWindowsBluetooth(lines)); } }); }