[Feature Request]: Renderer SerialPort.getInfo() return full SerialPortObject
- Dominant language
- C++
- Stars
- 123k
- Forks
- 17.5k
- Avg merge
- 14h 31m
- Merged PRs (30d)
- 858
Description
### Preflight Checklist
- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
### Problem Description
On the renderer process, `SerialPort.getInfo()` returns `{usbProductId: 32798, usbVendorId: 9114}`.
Separately, on the main process, `setDevicePermissionHandler` callback receives:
```
device: {
name: 'Trinket M0',
product_id: 32798,
serial_number: 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF',
usb_driver: 'com.apple.driver.usb.cdc.acm',
vendor_id: 9114
}
```
It's not possible to correlate this data, since multiple devices can have the same vendor and product IDs. (There's not much stopping devices in the wild even having identical serial numbers, so realistically the comPath is the only way to differentiate between different devices plugged in at the same time.)
It's difficult to produce a UI on the renderer process without this information. The Chrome default UI uses this information to present the device names to the user.

### Proposed Solution
`SerialPort.getInfo()` on the renderer process returns this additional information.
### Alternatives Considered
User-space libraries for serialport interaction do exist (it's what we're using now).
### Additional Information
Interestingly the Chrome UI displays the comPath in the UI, I can't seem to find that information anywhere in these calls. It would be good to also supply that information.
Contributor guide
Assessment
This issue has not been assessed yet.