read from serial port in c

Discussion in 'C Programming' started by Robert Ngo, Aug 10, 2004.

  1. Robert Ngo

    Robert Ngo Guest

    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
    Robert Ngo, Aug 10, 2004
    #1
    1. Advertising

  2. Robert Ngo

    -berlin.de Guest

    Robert Ngo <> wrote:
    > 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
    --
    \ Jens Thoms Toerring ___ -berlin.de
    \__________________________ http://www.toerring.de
    -berlin.de, Aug 10, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raine Wang
    Replies:
    0
    Views:
    789
    Raine Wang
    Nov 2, 2004
  2. Casey Bralla

    Read from Serial Port

    Casey Bralla, Jan 21, 2006, in forum: Python
    Replies:
    6
    Views:
    590
    Neil Benn
    Jan 23, 2006
  3. Pom
    Replies:
    2
    Views:
    1,636
    Bas-i
    Jan 31, 2007
  4. collinm

    Read Write serial port

    collinm, Mar 21, 2005, in forum: C Programming
    Replies:
    0
    Views:
    636
    collinm
    Mar 21, 2005
  5. msalerno
    Replies:
    3
    Views:
    407
    Ilmari Karonen
    Jul 14, 2005
Loading...

Share This Page