ts-7000
[Top] [All Lists]

Re: [ts-7000] TS7260-Reading from /dev/ttyUSB0

To:
Subject: Re: [ts-7000] TS7260-Reading from /dev/ttyUSB0
From: Petr Štetiar <>
Date: Thu, 4 Mar 2010 10:38:09 +0100
tsao.terence <> [2010-03-04 08:44:03]:

> I had success reading from ttyUSB0 with 9600 and 38400 baudrate, but when I
> jump to 57600 baud, the program just hangs.  I think there might be
> something wrong as I open the USB port, or my receive function has too much
> software overhead.  Anyone here had success reading from the ttyUSB0 port?

Hi, take a look at my librs232 here http://github.com/ynezz/librs232.
Using it is easy:

#define BUF_SIZE 20
usigned char buf[BUF_SIZE] = {0};

struct rs232_port_t *p = rs232_init();
rs232_set_device(p, "/dev/ttyUSB0");
rs232_open(p);
rs232_set_baud(p, RS232_BAUD_57600);
rs232_read(p, buf, BUF_SIZE, &len_read);
if (len_read > 0)
        fprintf(stdout, "read: '%s' len: %d\n", (char *) buf, len_read);
else
        fprintf(stdout, "read nothing...\n");
rs232_close(p);

-- ynezz


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU