read from serial port in c

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Ngo

    #1

    read from serial port in c

    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


  • Jens.Toerring@physik.fu-berlin.de

    #2
    Re: read from serial port in c

    Robert Ngo <robertngo@163. com> wrote:[color=blue]
    > 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.[/color]

    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.d evelopment.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



    (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 ___ Jens.Toerring@p hysik.fu-berlin.de
    \______________ ____________ http://www.toerring.de

    Comment

    Working...