systeminformation
Advanced tools
Comparing version 5.21.12 to 5.21.13
@@ -762,3 +762,3 @@ 'use strict'; | ||
vendor: 'Broadcom', | ||
model: 'VideoCore IV', | ||
model: util.getRpiGpu(), | ||
bus: '', | ||
@@ -765,0 +765,0 @@ vram: util.getValue(lines, 'gpu', '=').replace('M', ''), |
@@ -36,2 +36,3 @@ 'use strict'; | ||
let _smartMonToolsInstalled = null; | ||
let _rpi_cpuinfo = null; | ||
@@ -606,2 +607,3 @@ const WINDIR = process.env.WINDIR || 'C:\\Windows'; | ||
'BCM2711', | ||
'BCM2712', | ||
'BCM2835', | ||
@@ -613,7 +615,14 @@ 'BCM2836', | ||
let cpuinfo = []; | ||
try { | ||
cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\n'); | ||
} catch (e) { | ||
return false; | ||
if (_rpi_cpuinfo !== null) { | ||
cpuinfo = _rpi_cpuinfo; | ||
} else { | ||
try { | ||
cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\n'); | ||
_rpi_cpuinfo = cpuinfo; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
const hardware = getValue(cpuinfo, 'hardware'); | ||
@@ -825,2 +834,6 @@ return (hardware && PI_MODEL_NO.indexOf(hardware) > -1); | ||
if (_rpi_cpuinfo === null) { | ||
_rpi_cpuinfo = lines; | ||
} | ||
// https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md | ||
@@ -955,2 +968,3 @@ | ||
'BCM2711', | ||
'BCM2712', | ||
]; | ||
@@ -985,3 +999,4 @@ const manufacturerList = [ | ||
'14': 'CM4', | ||
'15': 'CM4S' | ||
'15': 'CM4S', | ||
'17': '5B', | ||
}; | ||
@@ -1030,2 +1045,21 @@ | ||
function getRpiGpu() { | ||
let cpuinfo = null; | ||
if (_rpi_cpuinfo !== null) { | ||
cpuinfo = _rpi_cpuinfo; | ||
} else { | ||
try { | ||
cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\n'); | ||
_rpi_cpuinfo = cpuinfo; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
const rpi = decodePiCpuinfo(cpuinfo); | ||
if (rpi.type === '4B' || rpi.type === 'CM4' || rpi.type === 'CM4S' || rpi.type === '400') { return 'VideoCore VI'; } | ||
if (rpi.type === '5B') { return 'VideoCore VII'; } | ||
return 'VideoCore IV'; | ||
} | ||
function promiseAll(promises) { | ||
@@ -1301,2 +1335,3 @@ const resolvingPromises = promises.map(function (promise) { | ||
exports.decodePiCpuinfo = decodePiCpuinfo; | ||
exports.getRpiGpu = getRpiGpu; | ||
exports.promiseAll = promiseAll; | ||
@@ -1303,0 +1338,0 @@ exports.promisify = promisify; |
{ | ||
"name": "systeminformation", | ||
"version": "5.21.12", | ||
"version": "5.21.13", | ||
"description": "Advanced, lightweight system and OS information library", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
741299
15725