bluetooth() improved parsing, macOS Sonoma detection

This commit is contained in:
Sebastian Hildebrandt
2023-08-04 07:16:26 +02:00
parent 7c0c245a88
commit 83c01d2cac
6 changed files with 12 additions and 4 deletions
+2
View File
@@ -34,6 +34,7 @@ function parseBluetoothType(str) {
if (str.indexOf('keyboard') >= 0) { result = 'Keyboard'; }
if (str.indexOf('mouse') >= 0) { result = 'Mouse'; }
if (str.indexOf('trackpad') >= 0) { result = 'Trackpad'; }
if (str.indexOf('speaker') >= 0) { result = 'Speaker'; }
if (str.indexOf('headset') >= 0) { result = 'Headset'; }
if (str.indexOf('phone') >= 0) { result = 'Phone'; }
@@ -55,6 +56,7 @@ function parseBluetoothManufacturer(str) {
if (str.indexOf('imac') >= 0) { result = 'Apple'; }
if (str.indexOf('iphone') >= 0) { result = 'Apple'; }
if (str.indexOf('magic mouse') >= 0) { result = 'Apple'; }
if (str.indexOf('magic track') >= 0) { result = 'Apple'; }
if (str.indexOf('macbook') >= 0) { result = 'Apple'; }
// to be continued ...
+1 -1
View File
@@ -271,7 +271,7 @@ function osInfo(callback) {
exec('sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml', function (error, stdout) {
let lines = stdout.toString().split('\n');
const distro = util.getValue(lines, 'kern.ostype');
const logofile = util.getValue(lines, 'kern.ostype');
const logofile = util.getLogoFile(distro);
const release = util.getValue(lines, 'kern.osrelease').split('-')[0];
const serial = util.getValue(lines, 'kern.uuid');
const bootmethod = util.getValue(lines, 'machdep.bootmethod');