Re: Events on Serial port



On 3 Jul, 12:38, Rolf Schroedter <m...@xxxxxxxxxxx> wrote:
If you prefer polling, you may retrieve the number of received bytes using
fconfigure $chan -queue

Otherwise you may use fileevents, see
http://wiki.tcl.tk/1108

Regards, Rolf.

Derek wrote, On 03.07.2008 11:40:

Hi All

I have a tcl script that polls the serial port DSR line with the

fconfigure command every 3 - 8 ms, selectable by the user. I then know
I have data waiting on the embbeded device and can query it. The
processing of the data is plenty fast enough but getting it off the
remote device is a bit time consuming, I have little control over
that, I would prefer to know the data is available more precisley
with out putting load on the main CPU at the script level.

Is there any way to be more efficient, i.e. get an event/interrupt
perhaps with the new channel setup in 8.5, or am I overstepping the
domain of dynamic languages.

Thanks

Derek

I could combine the two I suppose, poll until I get DSr = 1 , then
send the UartToI2C chip a command to send data, using a file event to
read it in.
I have to wait around a little though as the data may not all come at
once checking the queue may be better than what I'm doing now


Derek
.