Event sink that can registered to PvDeviceSerialPort to be notified of serial communication events. More...
Public Member Functions | |
PvDeviceSerialPortEchoSink () | |
Constructor. | |
virtual | ~PvDeviceSerialPortEchoSink () |
Destructor. | |
virtual void | OnTransmitted (const PvString &aDeviceID, PvDeviceSerial aPort, const uint8_t *aBytes, uint32_t aByteCount, uint64_t aTimestamp) |
Called when bytes are transmitted on a device serial port. More... | |
virtual void | OnRead (const PvString &aDeviceID, PvDeviceSerial aPort, const uint8_t *aBytes, uint32_t aByteCount, uint64_t aTimestamp) |
Called when bytes are received from a device serial port. More... | |
virtual void | OnReadComplete (const PvString &aDeviceID, PvDeviceSerial aPort, uint64_t aTimestamp) |
Optional notification that a receive operation was completed. More... | |
Event sink that can registered to PvDeviceSerialPort to be notified of serial communication events.
Inherit one of your classes from this class and override the OnTransmitted and OnReceived methods to be notified of any activity on the device serial ports used in a process.
|
virtual |
Called when bytes are received from a device serial port.
Override this method in your own class inheriting from PvDeviceSerialPortEchoSink to monitor the transmission over a device serial port.
To preserve the message notion of serial transmission, this method is not invoked when the bytes are received from the device but when the bytes are unqueued from PvDeviceSerialPort with PvDeviceSerialPort::Read.
[in] | aDeviceID | String uniquely identifying a device. |
[in] | aPort | Serial port of the device. |
[in] | aBytes | Pointer to the bytes received from the device serial port. |
[in] | aBytesCount | Count of bytes received from the device serial port. |
[in] | aTimestamp | Relative imestamp of the event in ms. |
|
virtual |
Optional notification that a receive operation was completed.
Can be used to flush the receive buffer to a log. Triggered when calling the PvDeviceSerialPort::ReceiveComplete() method.
[in] | aDeviceID | String uniquely identifying a device. |
[in] | aPort | Serial port of the device. |
[in] | aTimestamp | Relative imestamp of the event in ms. |
|
virtual |
Called when bytes are transmitted on a device serial port.
Override this method in your own class inheriting from PvDeviceSerialPortEchoSink to monitor the transmission over a device serial port.
[in] | aDeviceID | String uniquely identifying a device. |
[in] | aPort | Serial port of the device. |
[in] | aBytes | Pointer to the bytes transmitted on the device serial port. |
[in] | aBytesCount | Count of bytes transmitted to the device serial port. |
[in] | aTimestamp | Relative imestamp of the event in ms. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com