hyperion.ng
Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ProviderRs232 Class Reference

The ProviderRs232 implements an abstract base-class for LedDevices using a RS232-device. More...

#include <ProviderRs232.h>

Inheritance diagram for ProviderRs232:
LedDevice LedDeviceAdalight LedDeviceAtmo LedDeviceDMX LedDeviceKarate LedDeviceSedu LedDeviceTpm2

Signals

void receivedData (QByteArray data)
 
- Signals inherited from LedDevice
void enableStateChanged (bool newState)
 Emits whenever the led device switches between on/off. More...
 
void visiblePriorityChanged (const quint8 &priority)
 PIPER signal for Priority Muxer -> LedDevice. More...
 

Public Member Functions

 ProviderRs232 ()
 Constructs specific LedDevice.
 
virtual bool init (const QJsonObject &deviceConfig)
 Sets configuration. More...
 
virtual ~ProviderRs232 ()
 Destructor of the LedDevice; closes the output device if it is open.
 
int open ()
 Opens and configures the output device. More...
 
- Public Member Functions inherited from LedDevice
 LedDevice (const QJsonObject &config=QJsonObject(), QObject *parent=nullptr)
 
virtual int switchOff ()
 Switch the leds off (led hardware disable)
 
virtual int switchOn ()
 Switch the leds on (led hardware enable), used if reinitialization is required for the device implementation.
 
virtual int setLedValues (const std::vector< ColorRgb > &ledValues)
 
const QString & getColorOrder ()
 Get color order of device. More...
 
void setActiveDevice (QString dev)
 
const QString & getActiveDevice ()
 
void setLedCount (int ledCount)
 
int getLedCount ()
 
void setEnable (bool enable)
 
bool enabled ()
 
int getLatchTime ()
 
bool componentState ()
 
virtual int write (const std::vector< ColorRgb > &ledValues)=0
 Writes the RGB-Color values to the leds. More...
 

Protected Member Functions

int writeBytes (const qint64 size, const uint8_t *data)
 Writes the given bytes to the RS232-device and. More...
 
void closeDevice ()
 
QString findSerialDevice ()
 
bool tryOpen (const int delayAfterConnect_ms)
 

Protected Attributes

QString _deviceName
 The name of the output device.
 
qint32 _baudRate_Hz
 The used baudrate of the output device.
 
int _delayAfterConnect_ms
 Sleep after the connect before continuing.
 
QSerialPort _rs232Port
 The RS232 serial-device.
 
bool _blockedForDelay
 
bool _stateChanged
 
qint64 _bytesToWrite
 
qint64 _bytesWritten
 
qint64 _frameDropCounter
 
QSerialPort::SerialPortError _lastError
 
qint64 _preOpenDelayTimeOut
 
int _preOpenDelay
 
bool _enableAutoDeviceName
 
- Protected Attributes inherited from LedDevice
QJsonObject _devConfig
 
Logger_log
 The common Logger instance for all LedDevices.
 
std::vector< uint8_t > _ledBuffer
 The buffer containing the packed RGB values.
 
bool _deviceReady
 
QString _activeDevice
 
int _ledCount
 
int _ledRGBCount
 
int _ledRGBWCount
 
QTimer _refresh_timer
 Timer object which makes sure that led data is written at a minimum rate e.g. More...
 
unsigned int _refresh_timer_interval
 
qint64 _last_write_time
 
unsigned int _latchTime_ms
 

Additional Inherited Members

- Public Slots inherited from LedDevice
virtual void start ()
 Is called on thread start, all construction tasks and init should run here.
 
- Protected Slots inherited from LedDevice
int rewriteLeds ()
 Write the last data to the leds again.
 

Detailed Description

The ProviderRs232 implements an abstract base-class for LedDevices using a RS232-device.

Member Function Documentation

§ init()

bool ProviderRs232::init ( const QJsonObject &  deviceConfig)
virtual

Sets configuration.

Parameters
deviceConfigthe json device config
Returns
true if success

Reimplemented from LedDevice.

Reimplemented in LedDeviceAdalight, LedDeviceKarate, LedDeviceAtmo, LedDeviceDMX, LedDeviceSedu, and LedDeviceTpm2.

§ open()

int ProviderRs232::open ( )
virtual

Opens and configures the output device.

Returns
Zero on succes else negative

Reimplemented from LedDevice.

§ writeBytes()

int ProviderRs232::writeBytes ( const qint64  size,
const uint8_t *  data 
)
protected

Writes the given bytes to the RS232-device and.

Parameters

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