Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvDeviceSerialPortEchoSink Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

◆ OnRead()

void PvDeviceSerialPortEchoSink::OnRead ( const PvString aDeviceID,
PvDeviceSerial  aPort,
const uint8_t *  aBytes,
uint32_t  aBytesCount,
uint64_t  aTimestamp 
)
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.

Parameters
[in]aDeviceIDString uniquely identifying a device.
[in]aPortSerial port of the device.
[in]aBytesPointer to the bytes received from the device serial port.
[in]aBytesCountCount of bytes received from the device serial port.
[in]aTimestampRelative imestamp of the event in ms.

◆ OnReadComplete()

void PvDeviceSerialPortEchoSink::OnReadComplete ( const PvString aDeviceID,
PvDeviceSerial  aPort,
uint64_t  aTimestamp 
)
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.

Parameters
[in]aDeviceIDString uniquely identifying a device.
[in]aPortSerial port of the device.
[in]aTimestampRelative imestamp of the event in ms.

◆ OnTransmitted()

void PvDeviceSerialPortEchoSink::OnTransmitted ( const PvString aDeviceID,
PvDeviceSerial  aPort,
const uint8_t *  aBytes,
uint32_t  aBytesCount,
uint64_t  aTimestamp 
)
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.

Parameters
[in]aDeviceIDString uniquely identifying a device.
[in]aPortSerial port of the device.
[in]aBytesPointer to the bytes transmitted on the device serial port.
[in]aBytesCountCount of bytes transmitted to the device serial port.
[in]aTimestampRelative imestamp of the event in ms.

The documentation for this class was generated from the following files:

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com