COM Port Discovery (on 64bit RaspberryPi 4)

37 views
Skip to first unread message

Joerg

unread,
Jul 27, 2020, 12:37:01 PM7/27/20
to SerialPundit
Hi,
I have 3 questions:

1. how to do automatic COM Port Discovery when USB is connected?
I tested following code to retrieve the name of the virtual COM port:

                        SerialComUSB scu = new SerialComUSB(null, null);

                       final int usbVidToMatch = 0x0483;

                       final int usbPidToMatch = 0x5740;

                        final String serialNumber = "002b00355741570c20373135";

                       String[] discoverdComPorts = scu.findComPortFromUSBAttributes(usbVidToMatch, usbPidToMatch, serialNumber);

                       for (int i = 0; i < discoverdComPorts.length; i++) {

                                System.out.println(discoverdComPorts[i]);

                       }

Is it possible to retrieve an event, when a USB device is being connected/disconnected, or do I have to run this code periodically in a background thread to dynamical discover connected devices?

2. Is it possible to also discover virtual COM Ports using findComPortFromUSBAttributes and USB devices descriptor's "iManufacturer" as attribute?

3. is the native code part of the repository? 
I writing an application for the RaspberryPi 3/4 (Cortex-A53/Cortex-A72), ARMv8-A, Raspbian (32 and 64-bit) Platform.
Included in the sp-usb.jar is the "spusblnxarmv7hf.so". Will this native lib work for RaspberryPi 3/4 and Raspbian 32/64?
If not, can I build the libs myself? I did not find any native code though. Is the JNI code not part of the repo?

Thanks

rishi gupta

unread,
Jul 27, 2020, 12:42:57 PM7/27/20
to Joerg, SerialPundit
Does this helps:  https://github.com/RishiGupta12/SerialPundit/tree/master/applications

Native code is not part of repository.

--
You received this message because you are subscribed to the Google Groups "SerialPundit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to SerialPundit...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/SerialPundit/ad62d957-e3db-4d66-9f4c-84149c4927cao%40googlegroups.com.

Joerg

unread,
Jul 27, 2020, 3:38:33 PM7/27/20
to SerialPundit
For 1. 
Are you suggesting the example application "HotPlugRecoveryApplication.java"?
This looks ok to do it that way.

For 2.
I did not see any example application which makes use of USB devices descriptor's "iManufacturer" as attribute?

For 3.
Native code is not part of repository.
Ok, I have all understanding for closed source software and I see that you have written, that your project is DUAL LICENSED.
But I find it kind of irritating, if you use AGPL-3.0 License and do not put in the whole code, imho strange decision.

Anyway, since the project I am doing is commercial, I was going to contact you anyway for license costs.
How is the usage being billed and what would be the total cost for a single engineer and a single application?
And does the commercial license include the native code? (Or is the Raspberry Pi 4 / 64bit being supported?)

Best regards!
To unsubscribe from this group and stop receiving emails from it, send an email to Serial...@googlegroups.com.

rishi gupta

unread,
Jul 28, 2020, 1:59:18 PM7/28/20
to Joerg, SerialPundit
 "iManufacturer" as attribute is not supported as every manufacturer will customize it.

To unsubscribe from this group and stop receiving emails from it, send an email to SerialPundit...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/SerialPundit/42b37d46-4430-41e4-8152-05dde0a4f564o%40googlegroups.com.

Joerg

unread,
Jul 28, 2020, 6:47:57 PM7/28/20
to SerialPundit
Questions 1. and 2. are solved.
My bad, your examples actually show the usage of "ManufacturerString". (I was grepping for wrong String.)

For 3. I will check to run on Raspbi 3 with 32bit-Raspbian first. If this works, I will try Raspbi 4 and 64bit-Raspbian.
Reply all
Reply to author
Forward
0 new messages