What hardware are you using?<div><br clear="all">Karl Wilbur<br><a href="mailto:karl@karlwilbur.net">karl@karlwilbur.net</a><br>
<br><br><div class="gmail_quote">On Tue, Aug 31, 2010 at 3:35 PM, Martin McCormick <span dir="ltr"><<a href="mailto:martin@x.it.okstate.edu">martin@x.it.okstate.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

        I am writing some C code to manage the operation of a<br>
new scanner radio and it is mostly coming along well but I have<br>
run in to some odd behavior from a RS-232 port routine I stole<br>
from a Linux HowTo on serial communications.<br>
<br>
        One calls the routine and it stores characters in to a<br>
buffer or transmits data from a buffer. Receiving 50 or 60<br>
characters is a piece of cake. Everything works as expected but<br>
receiving a longer string such as 60 to 70 or more characters,<br>
the first read brings back some of the chars from the previous<br>
read even though the buffer was zero'd out. A second read gets<br>
all the character that should have been there in the first read.<br>
<br>
        Needless to say, this is not good but I discovered I can<br>
put a 1-second sleep before the next read and then it always<br>
gives the correct data.<br>
<br>
        When I get through, the radio will be totally accessible<br>
thanks to its serial control capabilities and to Linux, in this<br>
case, Vinux.<br>
<br>
        Are there any Linux discussion groups that would be<br>
really good for this question?<br>
<br>
        The receiver control program really creeps along with<br>
those forced 1-second pauses before every serial read.<br>
Interestingly enough, I wouldn't call it flaky because it does<br>
exactly the same wrong thing every time and it is always on a<br>
longer receive string. The buffer is set for 1024 characters and<br>
none of the reads have even come close to overflowing it so<br>
that's not the problem. Also, if the sleep is even slightly less<br>
than 1 full second, such as .75 seconds, I still get the bogus<br>
read.<br>
<br>
        Again, any ideas as to where to take this question are<br>
appreciated.<br>
<br>
Martin<br>
<br>
_______________________________________________<br>
Blinux-list mailing list<br>
<a href="mailto:Blinux-list@redhat.com">Blinux-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/blinux-list" target="_blank">https://www.redhat.com/mailman/listinfo/blinux-list</a><br>
</blockquote></div><br></div>