Skip to content

idProduct and idVendor in Windows OS  #69

Open

Description

@Ivra23

Hello,

For begin thank you for library, i have question can you get the Port Properties in Windows and linux OS with jssc, like idProduct and idVendor.
and you're now in jssc 2.9 but in maven it's 2.8.0 ? exactly
thank you.

Activity

  1. pietrygamat commented on Jul 31, 2020

    @pietrygamat
    Collaborator

    This fork has just been published to maven central minutes ago under

    <dependency>
        <groupId>io.github.java-native</groupId>
        <artifactId>jssc</artifactId>
        <version>2.9.2</version>
    </dependency>
    

    As to requested feature, I'd love to see it too.

  2. tresf commented on Jul 31, 2020

    @tresf

    idProduct and idVendor

    Last I checked, serial was anonymous. For example, on windows, a COM port would simply be a physical port, or if emulated, an emulated port. What is this in regards to? Can you link an example, perhaps in another language?

  3. pietrygamat commented on Jul 31, 2020

    @pietrygamat
    Collaborator

    I'd hate to take over the thread, but I guess my problem is very similar to @Ivra23 's. Windows does expose a bunch of information about the devices listed as COM ports - among others its HardwareID with VID and PID. Having these information provided with the port name would help a lot in autodetecting correct COM port and take the burden of finding one off of user.

    Capture

    Similarly, on Linux the ports listed by jssc are only those under /dev/tty*, but searching under /dev/serial/by-id gives a lot more information about the device connected:

    $ ls -al /dev/serial/by-id/
    total 0
    drwxr-xr-x 2 root root 100 Aug  1 00:16 .
    drwxr-xr-x 4 root root  80 Jul 31 23:32 ..
    lrwxrwxrwx 1 root root  13 Aug  1 00:12 usb-FTDI_USB__-__Serial-if00-port0 -> ../../ttyUSB1
    lrwxrwxrwx 1 root root  13 Jul 31 23:32 usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 -> ../../ttyUSB0
    lrwxrwxrwx 1 root root  13 Aug  1 00:16 usb-STMicroelectronics_STM32_Virtual_COM_Port_6D7218725156-if00 -> ../../ttyACM0
    

    Since the developer may expect to talk only to certain types of devices in their app, they'd want to have more information about each available port.

    Since the VID and PID are mentioned, the requirement may very well only apply to USB-to-Serial converters, and the most popular java libs for USB device management are awfully unhelpfull in any attempts to match serial port name with USB device. Approaching from the serial side may be a better idea.

  4. tresf commented on Jul 31, 2020

    @tresf

    I believe you're taking about the USB protocol of it all, no? What would be the vendor of an on-board serial port? What's being requested may be more of a USB API. A code snippet should be provided as a proof of concept. If other OSs expose this information, that would be nice.

    Last I checked most COM ports where embedded FTDI controllers, so having a device example, code to grab it would be a great use-case to start with.

    Edit: I see you've provided some examples. Thanks

  5. pietrygamat commented on Aug 1, 2020

    @pietrygamat
    Collaborator

    This work seems to crack it:
    scream3r#113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions