Implementation of the LedDevice interface for sending to Nanoleaf devices via network by using the 'external control' protocol.
More...
#include <LedDeviceNanoleaf.h>
|
| | LedDeviceNanoleaf (const QJsonObject &deviceConfig) |
| | Constructs the LedDevice for Nanoleaf LightPanels (aka Aurora) or Canvas. More...
|
| |
|
virtual | ~LedDeviceNanoleaf () |
| | Destructor of the LedDevice; closes the tcp client.
|
| |
|
virtual int | switchOn () |
| | Switch the leds on.
|
| |
|
virtual int | switchOff () |
| | Switch the leds off.
|
| |
|
| ProviderUdp () |
| | Constructs specific LedDevice.
|
| |
|
virtual | ~ProviderUdp () |
| | Destructor of the LedDevice; closes the output device if it is open.
|
| |
| int | open () |
| | Opens and configures the output device. More...
|
| |
|
| LedDevice (const QJsonObject &config=QJsonObject(), QObject *parent=nullptr) |
| |
|
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) |
| | Writes the led color values to the led-device. More...
|
| |
| bool | init (const QJsonObject &deviceConfig) |
| | Identifies a Nanoleaf device's panel configuration, sets device into External Control (UDP) mode. More...
|
| |
| int | writeBytes (const unsigned size, const uint8_t *data) |
| | Writes the given bytes/bits to the UDP-device and sleeps the latch time to ensure that the values are latched. More...
|
| |
|
|
virtual void | start () |
| | Is called on thread start, all construction tasks and init should run here.
|
| |
| 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...
|
| |
|
int | rewriteLeds () |
| | Write the last data to the leds again.
|
| |
|
QUdpSocket * | _udpSocket |
| |
|
QHostAddress | _address |
| |
|
quint16 | _port |
| |
|
QString | _defaultHost |
| |
|
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 |
| |
Implementation of the LedDevice interface for sending to Nanoleaf devices via network by using the 'external control' protocol.
§ LedDeviceNanoleaf()
| LedDeviceNanoleaf::LedDeviceNanoleaf |
( |
const QJsonObject & |
deviceConfig | ) |
|
Constructs the LedDevice for Nanoleaf LightPanels (aka Aurora) or Canvas.
following code shows all config options
"device" :
{
"type" : "nanoleaf"
"output" : "hostname or IP",
"token" : "Authentication Token",
},
- Parameters
-
| deviceConfig | json config for nanoleaf |
§ init()
| bool LedDeviceNanoleaf::init |
( |
const QJsonObject & |
deviceConfig | ) |
|
|
protectedvirtual |
Identifies a Nanoleaf device's panel configuration, sets device into External Control (UDP) mode.
- Parameters
-
| deviceConfig | the json device config |
- Returns
- true if success
- Exceptions
-
| runtime_error | in case device cannot be initialised e.g. more LEDs configured than device has panels or network problems |
Reimplemented from ProviderUdp.
§ write()
| int LedDeviceNanoleaf::write |
( |
const std::vector< ColorRgb > & |
ledValues | ) |
|
|
protectedvirtual |
Writes the led color values to the led-device.
- Parameters
-
| ledValues | The color-value per led |
- Returns
- Zero on succes else negative
Implements LedDevice.
The documentation for this class was generated from the following files: