usb: added serialNumber (linux)

This commit is contained in:
Sebastian Hildebrandt 2024-07-31 05:50:42 +02:00
parent bb006e4ae2
commit 7131f5ae08
6 changed files with 15 additions and 4 deletions

View File

@ -83,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.23.0 | 2024-07-31 | `usb()` added serialNumber (linux) |
| 5.22.11 | 2024-06-10 | `osInfo()` added macOS Sequoia |
| 5.22.10 | 2024-05-31 | `powerShellStart()` fixed kill issue |
| 5.22.9 | 2024-05-13 | `memLayout()` fixed typo manufacturer |

View File

@ -545,7 +545,7 @@ Full function reference with examples can be found at [https://systeminformation
| | [0].manufacturer | X | | X | X | | manufacturer |
| | [0].maxPower | X | | | | | max power |
| | [0].default | X | | X | X | | is default printer |
| | [0].serialNumber | | | X | | | serial number |
| | [0].serialNumber | X | | X | | | serial number |
#### 11. Printer

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.23.0</th>
<td>2024-07-31</td>
<td><span class="code">usb()</span> added serialNumber linux</td>
</tr>
<tr>
<th scope="row">5.22.11</th>
<td>2024-06-10</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.22.11</span></div>
<div class="version">New Version: <span id="version">5.23.0</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">

View File

@ -170,7 +170,7 @@
<tr>
<td></td>
<td>[0].serialNumber</td>
<td></td>
<td>X</td>
<td></td>
<td>X</td>
<td></td>

View File

@ -77,6 +77,11 @@ function parseLinuxUsb(usb) {
iManufacturerParts.shift();
const manufacturer = iManufacturerParts.join(' ');
const iSerial = util.getValue(lines, 'iSerial', ' ', true).trim();
let iSerialParts = iSerial.split(' ');
iSerialParts.shift();
const serial = iSerialParts.join(' ');
result.id = (idVendor.startsWith('0x') ? idVendor.split(' ')[0].substr(2, 10) : '') + ':' + (idProduct.startsWith('0x') ? idProduct.split(' ')[0].substr(2, 10) : '');
result.name = product;
result.type = getLinuxUsbType(usbType, product);
@ -84,7 +89,7 @@ function parseLinuxUsb(usb) {
result.vendor = vendor;
result.manufacturer = manufacturer;
result.maxPower = util.getValue(lines, 'MaxPower', ' ', true);
result.serialNumber = null;
result.serialNumber = serial;
return result;
}