Pleora Technologies Inc. eBUS SDK v7.0.1.7536 API



PvDeviceSerialPortEchoSink Class Reference

Receives serial port echo notifications for transmitted and received data. More...

#include <PvDeviceSerialPortEchoSink.h>

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)
 Notification that bytes were transmitted on a serial port. More...
 
virtual void OnRead (const PvString &aDeviceID, PvDeviceSerial aPort, const uint8_t *aBytes, uint32_t aByteCount, uint64_t aTimestamp)
 Notification that bytes were read from a serial port. More...
 
virtual void OnReadComplete (const PvString &aDeviceID, PvDeviceSerial aPort, uint64_t aTimestamp)
 Notification that a read operation completed on a serial port. More...
 

Detailed Description

Receives serial port echo notifications for transmitted and received data.

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

Notification that bytes were read from a serial port.

Called when bytes are received from a device serial port.

Parameters
[in]aDeviceIDIdentifier of the originating device.
[in]aPortSerial port on which data was read.
[in]aBytesPointer to the received bytes.
[in]aByteCountNumber of bytes received.
[in]aTimestampTimestamp associated with the read.

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

Notification that a read operation completed on a serial port.

Optional notification that a receive operation was completed.

Parameters
[in]aDeviceIDIdentifier of the originating device.
[in]aPortSerial port on which the read completed.
[in]aTimestampTimestamp associated with the completion.

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

Notification that bytes were transmitted on a serial port.

Called when bytes are transmitted on a device serial port.

Parameters
[in]aDeviceIDIdentifier of the originating device.
[in]aPortSerial port on which data was transmitted.
[in]aBytesPointer to the transmitted bytes.
[in]aByteCountNumber of bytes transmitted.
[in]aTimestampTimestamp associated with the transmission.

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-2026 Pleora Technologies Inc.
www.pleora.com