Please note: Although this question mentions Java and even a specific Java library, it really has nothing to do with Java and is really more about serial communication and device drivers. As such, I think this can be answered by anybody with experience in those fields.
I've been in "Enterprise Java Land" for a while now, and am trying to make my way to the lower levels and understand the stuff closer to bare metal. I'm trying to understand serial ports and device drivers, and how they relate to each other, and I'm just not seeing the forest through the trees on a few things.
I thought long and hard about how to ask a succinct question on here that would address my main mental blockers, and I think the best way to do so is to ask using a specific example, and then try to generalize the solution(s).
Take the following example:
There is a Java library for reading/writing data to/from serial ports called JSerialComm. If I wanted my Java app to communicate directly with a serial port, I can use JSerialComm to get the job done.
Say I'm an electronics guy and I built a really impressive circuit on a breadboard. Doesn't matter what this circuit does, other than it has lots of IO components (LEDs, maybe a few motors, etc.). I want to connect this circuit to my laptop via the serial port, and then control it from my app via JSerialComm (or some comparable/alternative lib):
- Would this circuit need to conform to RS232? Why/why not? And if so, how?
- Would this circuit need its own native device driver? Why/why not? If yes, then why would I need a driver when I can communicate to the port through JSerialComm? And if no, then what dictates whether you can talk to an external device directly via the port (JSerialComm) vs. when you need to use a native device driver?
Again, I don't think it should matter what language we're talking about (Java, C++, Python, etc.). Thanks in advance!