Re: detection of events from the serial port [message #42758] |
Fri, 25 February 2005 08:57 |
b_gom
Messages: 105 Registered: April 2003
|
Senior Member |
|
|
Michele,
michele wrote:
> i was looking for something that detects an event when a signal is
> sent to the serial port but i couldn't find it.
I don't think you will find it, unless maybe if you write a DLM with a
widget stub or something.
> another solution could be this: being the gps reader something that
> should always be on (it must always run) i wanted to nest it in the
> main event loop of my widget application but i don't know how to do
> it... do i have to modify xmanager? i don't think this is a nice
> solution....
If you are just picking off locations from the NMEA stream from your
GPS, then all you have to do is set up the buffer on the serial port to
a big enough size, then add a widget with a timer event to your
application. When the timer event occurs, check the serial port buffer
for the latest data (there is a serial port DLM on the RSI site). Skip
it if there is no data, read the last value and purge the buffer is
there is data.
Brad
|
|
|
Re: detection of events from the serial port [message #42759 is a reply to message #42758] |
Fri, 25 February 2005 08:53  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
michele wrote:
> i was looking for something that detects an event when a signal is
> sent to the serial port but i couldn't find it.
> another solution could be this: being the gps reader something that
> should always be on (it must always run) i wanted to nest it in the
> main event loop of my widget application but i don't know how to do
> it... do i have to modify xmanager? i don't think this is a nice
> solution....
Set a timer event on one of your widgets of a reasonable length, say 1
or 2 seconds. In your event handler for that widget, poll the serial
port when the timer event fires, update your application data structure
and draw. IDL timers are single shot so remember to set another timer
event at the bottom of your polling routine.
-Rick
|
|
|