简体   繁体   中英

Sending data over usb/RS232 converter using java

I want to send data over a usb port where it's pluged in a converter from USB to RS232 using a java application. After one day searching I found 3 solution :

1.use an api : which is hard cause every api have it's limitation or not updated or died years ago or not cross platform and that's what i need.

2.identify the usb connector as a RS232 connector by an OS : well this I want to know more about cause it seems a better solution.

3.make my own usb/java api : I don't even know where to start ! .

update 1 : I'm currently using the library JSSC to control the flux on a serial Port.

update 2 :

well while I'm at it, if there's a solution using C++ and if there is, how to make C++ code work under a java Application.

So if there's any help with this would be welcome and sorry for making it too long.

  1. The only way to interact with the USB/RS232 device is via the OS and its representation of a COM port. You cannot control the USB device directly.
  2. Java does not provide a means to control a COM/RS232/serial port off the shelf.
  3. This functionality can be added to Java by leveraging native code (eg in C or C++) and the Java Native Interface (JNI) .
  4. This has been done before, see for example: Stable alternative to RXTX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM