bluetooth enimeration issue (windows) wip

This commit is contained in:
Sebastian Hildebrandt 2025-12-31 13:45:46 +01:00
parent 66b37b7a3c
commit 022e9b93b5

View File

@ -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));
}
});
}