tsc_IRs232StreamMonitor

 

You can use this monitor to handle asynchronous events on a tsc_Rs232Stream object.  It is useful to monitor what other code may be doing to your stream or to listen for incoming serial data.  Implement a monitor by inheriting from the interface and overriding the event handlers - for more information see Event Handling.

Constructor

tsc_IRs232StreamMonitor();

Methods

Starts receiving events on this monitor about this stream.

Always qualify calls to this function, as in tsc_IRs232StreamMonitor::Start()

void Start(tsc_Rs232Stream& stream);

Stops receiving events on this monitor.

Always qualify calls to this function, as in tsc_IRs232StreamMonitor::Stop()

Stop(tsc_Rs232Stream& stream);

The connection has successfully opened.

virtual void OnPortOpened();

The connection has been lost.

virtual void OnPortClosed();

The stream has howMany bytes of data buffered ready for reading.  Note: if your stream is operating in WriteOnly mode then this event will not be called.  Also be aware that data remains buffered until read and can accumulate.

virtual void OnDataReceived(long howMany);