From a9dc13b04216a7ffa90038b0be621e9ff1c251b1 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Mon, 2 Dec 2024 14:05:31 +0000 Subject: [PATCH 1/3] show USB PID/VID in hex for serial devices; include driver name where available --- lib/core/device.js | 10 ++++++++++ lib/core/driverManifests.js | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/core/device.js b/lib/core/device.js index 1c44bd59f..3503db9bb 100644 --- a/lib/core/device.js +++ b/lib/core/device.js @@ -383,6 +383,16 @@ device.detect = (driverId, options, cb) => { productId: usbProductId, }; + device.log(`USB Vendor ID: 0x${usbVendorId.toString(16).toUpperCase().padStart(4, '0')}, USB Product ID: 0x${usbProductId.toString(16).toUpperCase().padStart(4, '0')}`); + + for (let j = 0; j < driverManifest.usb.length; j++) { + if (driverManifest.usb[j].vendorId === usbVendorId + && driverManifest.usb[j].productId === usbProductId + && driverManifest.usb[j].driver != null) { + device.log('USB Driver:', driverManifest.usb[j].driver.toUpperCase()); + } + } + if (driverId === 'Dexcom' && devdata.vendorId === 8867 && devdata.productId === 72) { // This is an attempt to upload a Dexcom G7, which is not yet supported return cb('E_G7_UNSUPPORTED'); diff --git a/lib/core/driverManifests.js b/lib/core/driverManifests.js index ac9dab9bf..be7128c7a 100644 --- a/lib/core/driverManifests.js +++ b/lib/core/driverManifests.js @@ -47,7 +47,7 @@ const driverManifests = { bitrate: 19200, usb: [ { vendorId: 6753, productId: 13328, driver: 'tusb3410' }, // Abbott cable - { vendorId: 1027, productId: 24577 }, // FTDI cable + { vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable ], }, AbbottFreeStyleLibre: { @@ -126,7 +126,7 @@ const driverManifests = { usb: [ { vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable { vendorId: 1659, productId: 8963, driver: 'pl2303' }, - { vendorId: 6790, productId: 29987 }, // CH340 cable + { vendorId: 6790, productId: 29987, driver: 'ch340' }, // CH340 cable ], }, OneTouchUltra2: { @@ -137,7 +137,7 @@ const driverManifests = { usb: [ { vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable { vendorId: 1659, productId: 8963, driver: 'pl2303' }, - { vendorId: 6790, productId: 29987 }, // CH340 cable + { vendorId: 6790, productId: 29987, driver: 'ch340' }, // CH340 cable ], }, TrueMetrix: { @@ -185,7 +185,7 @@ const driverManifests = { stopBits: 2, usb: [ { vendorId: 3835, productId: 17, driver: 'cp2102' }, // Arkray cable - { vendorId: 1027, productId: 24577 }, // FTDI cable + { vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable ], }, GlucocardShine: { @@ -215,7 +215,7 @@ const driverManifests = { stopBits: 2, usb: [ { vendorId: 3835, productId: 17, driver: 'cp2102' }, // Arkray cable - { vendorId: 1027, productId: 24577 }, // FTDI cable + { vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable ], }, AbbottLibreView: { From 2259e947d0d3d4517eb2187cf728492e9bf52946 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 3 Dec 2024 11:55:10 +0000 Subject: [PATCH 2/3] log device names and USB PID/VIDs for WebUSB and WebHID devices too --- lib/core/device.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/core/device.js b/lib/core/device.js index 3503db9bb..403576f56 100644 --- a/lib/core/device.js +++ b/lib/core/device.js @@ -277,6 +277,9 @@ device.detect = (driverId, options, cb) => { hidDevice: options.hidDevice, }; + device.log(`Found ${devdata.hidDevice.productName}`); + device.log(`USB Vendor ID: 0x${devdata.hidDevice.vendorId.toString(16).toUpperCase().padStart(4, '0')}, USB Product ID: 0x${devdata.hidDevice.productId.toString(16).toUpperCase().padStart(4, '0')}`); + if ((driverId === 'AbbottFreeStyleLibre') && devdata.hidDevice.vendorId === 6753 && devdata.hidDevice.productId === 14672) { // This is an attempt to upload a Libre 2, which is not yet supported @@ -327,6 +330,9 @@ device.detect = (driverId, options, cb) => { throw new Error('No device was selected.'); } + device.log(`Found ${webUSBDevice.manufacturerName} ${webUSBDevice.productName}`); + device.log(`USB Vendor ID: 0x${webUSBDevice.vendorId.toString(16).toUpperCase().padStart(4, '0')}, USB Product ID: 0x${webUSBDevice.productId.toString(16).toUpperCase().padStart(4, '0')}`); + devdata.usbDevice = webUSBDevice; device.deviceInfoCache[driverId] = _.cloneDeep(devdata); From 4532e47f62ed4499f841a0ac907e989e7be9d330 Mon Sep 17 00:00:00 2001 From: Gerrit Niezen Date: Tue, 3 Dec 2024 11:55:43 +0000 Subject: [PATCH 3/3] v2.60.0-usb-log-id.1 --- app/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 27a93079e..e179e3f90 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "tidepool-uploader", "productName": "tidepool-uploader", - "version": "2.60.0", + "version": "2.60.0-usb-log-id.1", "description": "Tidepool Project Universal Uploader", "main": "./main.prod.js", "author": { diff --git a/package.json b/package.json index 356ceac61..764062066 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidepool-uploader", - "version": "2.60.0", + "version": "2.60.0-usb-log-id.1", "description": "Tidepool Project Universal Uploader", "private": true, "main": "main.prod.js",