--- In ts-7000%40yahoogroups.com,
"Jon L" <> wrote:
>
>
>
> --- In ts-7000%40yahoogroups.com,
"Jon L" <jleslie48@> wrote:
> >
> > Ok, I finally got an RS232 uart to work properly on the TS-7500 (the
fpga program needed to be upgraded to revision x03)
> >
> > but whats interesting is the RX buffer of the uart fills so long as
data is coming in and queues up.
> >
> > So what is the best way to dump this data for the freshest? For
example say I have a GPS hooked up to a uart, and its constantly spewing data
which I don't care about. Now say all of a sudden I want the next gps data; I
don't want wade through the entire /dev/gpsuart file to get to the last data; I
want to be able to reset /dev/gpsuart, and have it fill fresh when I want it.
> >
> > Any ideas?
> >
> >
> >
> > Also what happens if I ignore the Gps data for a loooong time, what
is the buffer limit on the /dev/gpsuart as set up by
> >
> > xuartctl ???
> >
>
>
> ok, I hooked up my GPS to the /dev/gpsuart and it receives the data just
fine, but the problem is the queueing of the data.
>
> If I ignore the RX for minutes, the buffer fills to around 12,285 bytes
(any Idea the significance of this amount?) That is fine but if I dump the
buffer with say "cat /dev/gpsuart >/dev/null" It seems that I just
get the next section of gps data. There is still a hidden queue of the data
somewhere queuing up rather than dumping on the floor.
>
> I tried "tail /dev/gpsuart" but that only gives me the
"tail" of the 12,285 section. I was hoping that tail would move the
pointer to the end of everything. The only thing I've gotten to work so far is
if I:
>
> "tail -f /dev/gpsuart" then wait xxx seconds until I see the
data streaming (much slower than the regular tail to screen) and I know I'm
tailing the current data coming in.
>
> This is not a good way to do this as that "wait xxx seconds" is
not guaranteed to empty and I don't know how to even calculate the xxx, or how
to program "wait until I seed the data streaming"
>
> I'm also concerned about where all this data is being stored, I mean what
if I don't get to tail -f for days? is this going to grow forever?
>
>
>
> any ideas?
>
Ok, so re-issuing the xuartctl --port 0 --server command resets the buffer.
That's all that I need. there is some cleanup to be done, as when you re-issue
the xuartctl command, the old one still remains, but that not too hard to
handle here is the script I use to restart the UART0 port:
ts7500:/home/jon/programs/sjinn# cat uart_setup.sh
#!/bin/sh
XUARTID=`pgrep -f "xuartctl --port 0"`
kill $XUARTID
PAR1=`xuartctl --port 0 --server --speed 4800 2>&1 |cut -d= -f2`
echo $PAR1
ln -sf $PAR1 /dev/testuart
XUARTID=`pgrep -f "xuartctl --port 0"`
echo $XUARTID
ts7500:/home/jon/programs/sjinn#