diff --git a/src/devdisco.js b/src/devdisco.js index 5fe4c85..1a98c66 100644 --- a/src/devdisco.js +++ b/src/devdisco.js @@ -153,9 +153,9 @@ var onDeviceDiscovered = function(record) { break; case 'usb-uart': console.log( - rpad(record.com_name, 22), + rpad(record.com_name, 28), rpad(record.device_name_or_manufacturer, 40), - rpad(deviceInfoStr || '?', 48) + rpad(deviceInfoStr || '?', 46) ); break; default: @@ -194,7 +194,7 @@ function cmd_list_usb_uart() { console.log(''); console.log('USB Devices:'); console.log(''); - console.log(rpad('COM Port', 22), rpad('Device Name\\Manufacturer', 40), rpad('Device Type (Friendly Name)', 48)); + console.log(rpad('COM Port', 28), rpad('Device Name\\Manufacturer', 40), rpad('Device Type (Friendly Name)', 46)); console.log(''); UsbUartTransport.beginDiscovery(onDeviceDiscovered); } diff --git a/src/lib/usb-mapping.csv b/src/lib/usb-mapping.csv index e6557d1..5939692 100644 --- a/src/lib/usb-mapping.csv +++ b/src/lib/usb-mapping.csv @@ -4,6 +4,7 @@ # for Intel Edison USB\VID_8087&PID_0A9E&MI_02\ Intel Edison Virtual Com Port edison USB\VID_8087&PID_0A9E\ Intel Edison USB Composite Device edison +FTDIBUS\VID_0403+PID_6001+ USB Serial Port edison # for Huzzah Feather ESP8266 USB\VID_10C4&PID_EA60\ Silicon Labs CP210x USB to UART Bridge huzzah # for Adafruit Feather M0 @@ -21,3 +22,14 @@ usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_ Silicon Labs CP210x USB t usb-Adafruit_Feather_ USB Serial Device adafruit_feather_m0_usb # for SparkFun ESP8266 Thing usb-FTDI_FT231X_USB_UART_ USB Serial Port thingdev + +# for Mac +# for Intel Edison +usb-VID_8087&PID_0a9e Intel Edison Virtual Com Port edison +usb-VID_0403&PID_6001 USB Serial Port edison +# for Huzzah Feather ESP8266 +usb-VID_10c4&PID_ea60 Silicon Labs CP210x USB to UART Bridge huzzah +# for Adafruit Feather M0 +usb-VID_239a&PID_800b USB Serial Device adafruit_feather_m0_usb +# for SparkFun ESP8266 Thing +usb-VID_0403&PID_6015 USB Serial Port thingdev diff --git a/src/lib/usb-uart-transport.js b/src/lib/usb-uart-transport.js index d0f9316..5e20a6d 100644 --- a/src/lib/usb-uart-transport.js +++ b/src/lib/usb-uart-transport.js @@ -9,9 +9,13 @@ exports.beginDiscovery = function beginDiscovery(callback) { return; } ports.forEach(function(port) { - var deviceName = UsbLookup.resolveUsbName(port.pnpId); + var pnpId = port.pnpId; + if(!pnpId && port.vendorId && port.productId){ + pnpId = 'usb-VID_' + port.vendorId.split('0x')[1] + '&PID_' + port.productId.split('0x')[1]; + } + var deviceName = UsbLookup.resolveUsbName(pnpId); + var deviceType = UsbLookup.resolveDeviceType(pnpId); var deviceNameOrManufacturer = deviceName ? deviceName : port.manufacturer; - var deviceType = UsbLookup.resolveDeviceType(port.pnpId); (function(com_name, device_name_or_manufacturer, device_type) { if(com_name && device_name_or_manufacturer) { var record = {