Hey guys....Namastey!!
Am here for your suggestions. I am right now working on a software project which needs to communicate with an custom ECU(Engine/Electronic Control Unit) of a car via a USB-TO-RS232 cable. Before moving ahead i want to be sure, do you think Java is appropriate for such kind of Serial Communication??

A lot of data will be flowing in both the directions. And the main concern is about communication errors. Is java stable enough to provide a proper and accurate way to handle such kind of communication??

Recommended Answers

All 2 Replies

IMHO Java itself is more solid than the OS it runs on, but Java's support for serial comms is very old, and was never very solid in the first place. I did a project years ago to interface with a serial hardware control device (multiple digital I/O lines) and found that establishing communication was a 90% affair, and that it often hung up, requiring a restart, if there were any problems. To be fair, that may have just been my fault, but I don't think my code was that bad.
I would never get in a car that depended on Java serial comms to keep the engine working safely!
Personally I would build a small C DLL to handle the comms protocols and hardware interface, and call that via JNI or whatever. If you design it with that use in mind it should be pretty easy.

C DLL,JNI....fair enough...thnks a lot!!!!
btw you are right...java took off the serial comm support from the windows platform in 2005. after some googleING i came through a package called RXTX.. well it seems like this package might be a good option for me, but i havent tested this package on a large scale so m not completely sure on the reliability of RXTX. Anyways i'll surely take a look at your idea!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.