Xeli
March 28th, 2009, 11:05 AM
Hello!
I'm quite new to Linux and programming as a whole so please bear with me ;)
For a school project (noooo don't run away just yet i'm not asking you to make my homework :P) i need to send and recive bytes to a cardreader connected to a serialport (well actually usb port, with usb-to-serial connector)
Since we're writing it in JAVA we've been advised to use javax.comm from sun, well that's all good and fun, but sun seems to have abandoned it, plus never really had good support for linux anyway. I've also tried rxtx, but that doesn't really do well with x86-64 systems, so i've decided to write a JAVA or C program (i'd prefer C cause I'm worse at C than JAVA :))
So the question arrises: How to write to a serial port in Linux?
I've heard that everything in linux is a file, so the 'devices' in /dev/ are also files then? And could i just write to them as if it were files?
Any help would be greatly appreciated, thanks! :)
-Richard
I'm quite new to Linux and programming as a whole so please bear with me ;)
For a school project (noooo don't run away just yet i'm not asking you to make my homework :P) i need to send and recive bytes to a cardreader connected to a serialport (well actually usb port, with usb-to-serial connector)
Since we're writing it in JAVA we've been advised to use javax.comm from sun, well that's all good and fun, but sun seems to have abandoned it, plus never really had good support for linux anyway. I've also tried rxtx, but that doesn't really do well with x86-64 systems, so i've decided to write a JAVA or C program (i'd prefer C cause I'm worse at C than JAVA :))
So the question arrises: How to write to a serial port in Linux?
I've heard that everything in linux is a file, so the 'devices' in /dev/ are also files then? And could i just write to them as if it were files?
Any help would be greatly appreciated, thanks! :)
-Richard