[prev in list] [next in list] [prev in thread] [next in thread]
List: rxtx
Subject: Re: [Rxtx] RS-485 echo processing
From: John Charlton <j.d.charlton () ieee ! org>
Date: 2004-09-15 15:50:26
Message-ID: 200409151150.26175.j.d.charlton () ieee ! org
[Download RAW message or body]
Trent and all:
I did some more experimenting with enableReceiveThreshold() and
enableReceiveTimeout() and have a combination that works now to consistently
read the RS-485 echo without missing transmitted packets. Just setting
enableReceiveTimeout() alone does not seem to work because the read(buf, 0,
len) returns before the timeout set in enableReceiveTimeout(). I tried
various timeout settings up to 10000 ms and read(buf, 0, len) still returns
prematurely before timeout is reached and before len characters are received.
The code in the attached tgz file works consistently. If I use both
enableReceiveThreshold(len) and enableReceiveTimout(500), no packets are
lost.
With a bit more testing, I am able to pickup the echo with timeout setting
down to enableReceiveTimeout(10). It does timeout with
enableReceiveTimeout(1) which in encouraging since I am transmitting at 9600
baud for this test and it should timeout at 1msec.
Thanks for the help,
--John
["echotest.tgz" (application/x-tgz)]
_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://mailman.linuxgrrls.org/mailman/listinfo/rxtx
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic