bluetooth enimeration issue (windows) wip
This commit is contained in:
parent
66b37b7a3c
commit
022e9b93b5
@ -265,7 +265,7 @@ function bluetoothDevices(callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
util.noop();
|
util.noop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,16 +276,16 @@ function bluetoothDevices(callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_windows) {
|
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) {
|
if (!error) {
|
||||||
const parts = stdout.toString().split(/\n\s*\n/);
|
const parts = stdout.toString().split(/\n\s*\n/);
|
||||||
parts.forEach((part) => {
|
parts.forEach((part) => {
|
||||||
const lines = part.split('\n');
|
const lines = part.split('\n');
|
||||||
const service = util.getValue(lines, 'Service', ':');
|
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();
|
const pnpClass = util.getValue(lines, 'PNPClass', ':').toLowerCase();
|
||||||
if (pnpClass === 'Bluetooth' && errorCode === '0' && service === '') {
|
if (pnpClass === 'bluetooth' && errorCode === '0' && service === '') {
|
||||||
result.push(parseWindowsBluetooth(part.split('\n')));
|
result.push(parseWindowsBluetooth(lines));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user