serialport / node-serialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!

Home Page:https://serialport.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add product property to PortInfo

jasoneer opened this issue · comments

💥 Proposal

What feature you'd like to see

I would like to add a product property to PortInfo to provide the USB device's product/model string.

Motivation

I would like to get this value separately instead of parsing it out of pnpId on Mac/Linux.

Pitch

I created the following PRs to implement this change:
Typings: serialport/bindings-interface#43
Implementation: serialport/bindings-cpp#138

The PRs have been tested on both Mac and Linux with a few USB serial devices. Was unsure about Windows so left its implementation alone. Also on Linux, I used ID_MODEL instead of ID_MODEL_ENC as the escaped characters were getting in the way of parsing/display.