read from serial port in c

R

Robert Ngo

how to read from serial port with c on a linux server, the serail port is
connect to a card reader. The information will then be save in a postgre
database.

Thanks and regards

Robert Ngo
 
J

Jens.Toerring

Robert Ngo said:
how to read from serial port with c on a linux server, the serail port is
connect to a card reader. The information will then be save in a postgre
database.

Unless you treat the device file for the serial port like a normal file
you can't use the standard C functions like fopen(), fread() etc. -
and since they don't allow the fine grained control over what is going
on you will usually need Linux specific, nonstandard functions. But
these aren't discussed here but in e.g. comp.os.linux.development.apps
(but if you ask there it would probably be prudent to ask a question
and not only more or less state your intentions because otherwise your
chances of getting helpful relies won't be that good). Moreover, how to
deal with databases is also something for which no standard C functions
exist, again you will need some extensions which also are off-topic
here. Since I don't know about any newsgroup dealing with Postgresql
I guess reading a bit in

http://www.physiol.ox.ac.uk/Computing/Online_Documentation/postgresql/programmer.html

(which was the first hit Google turned up for "postgres C library) might
get you started. As far as I can see there also seems to be a mailing
list devoted to the topic.
Regards, Jens
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top