mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Const correctness, override keyword, a bunch of stuff..
This commit is contained in:
@@ -494,7 +494,7 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
|
||||
#if defined(ENABLE_V4L2)
|
||||
|
||||
QJsonArray availableV4L2devices;
|
||||
for (auto devicePath : GrabberWrapper::getInstance()->getV4L2devices())
|
||||
for (const auto& devicePath : GrabberWrapper::getInstance()->getV4L2devices())
|
||||
{
|
||||
QJsonObject device;
|
||||
device["device"] = devicePath;
|
||||
|
@@ -89,8 +89,8 @@ void BlackBorderProcessor::handleCompStateChangeRequest(hyperion::Components com
|
||||
}
|
||||
}
|
||||
|
||||
void BlackBorderProcessor::setHardDisable(bool disable) {
|
||||
|
||||
void BlackBorderProcessor::setHardDisable(bool disable)
|
||||
{
|
||||
if (disable)
|
||||
{
|
||||
_enabled = false;
|
||||
|
@@ -67,7 +67,7 @@ void BoblightServer::stop()
|
||||
_hyperion->setNewComponentState(COMP_BOBLIGHTSERVER, _server->isListening());
|
||||
}
|
||||
|
||||
bool BoblightServer::active()
|
||||
bool BoblightServer::active() const
|
||||
{
|
||||
return _server->isListening();
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ void BonjourServiceRegister::registerService(const QString& service, int port)
|
||||
);
|
||||
}
|
||||
|
||||
void BonjourServiceRegister::registerService(const BonjourRecord &record, quint16 servicePort, std::vector<std::pair<std::string, std::string>> txt)
|
||||
void BonjourServiceRegister::registerService(const BonjourRecord &record, quint16 servicePort, const std::vector<std::pair<std::string, std::string>>& txt)
|
||||
{
|
||||
if (dnssref)
|
||||
{
|
||||
|
@@ -11,7 +11,6 @@ Option::Option(const QStringList &names, const QString &description, const QStri
|
||||
: QCommandLineOption(names, description, valueName, defaultValue)
|
||||
{}
|
||||
|
||||
|
||||
bool Option::validate(Parser & parser, QString &value)
|
||||
{
|
||||
/* By default everything is accepted */
|
||||
@@ -22,22 +21,22 @@ Option::Option(const QCommandLineOption &other)
|
||||
: QCommandLineOption(other)
|
||||
{}
|
||||
|
||||
QString Option::value(Parser &parser)
|
||||
QString Option::value(Parser &parser) const
|
||||
{
|
||||
return parser.value(*this);
|
||||
}
|
||||
|
||||
QString Option::name()
|
||||
QString Option::name() const
|
||||
{
|
||||
return this->names().last();
|
||||
}
|
||||
|
||||
QString Option::getError()
|
||||
QString Option::getError() const
|
||||
{
|
||||
return this->_error;
|
||||
}
|
||||
|
||||
const char* Option::getCString(Parser &parser)
|
||||
const char* Option::getCString(Parser &parser) const
|
||||
{
|
||||
return value(parser).toLocal8Bit().constData();
|
||||
}
|
||||
|
@@ -61,9 +61,9 @@ QString EffectEngine::deleteEffect(const QString& effectName)
|
||||
return _effectFileHandler->deleteEffect(effectName);
|
||||
}
|
||||
|
||||
const std::list<ActiveEffectDefinition> &EffectEngine::getActiveEffects()
|
||||
std::list<ActiveEffectDefinition> EffectEngine::getActiveEffects() const
|
||||
{
|
||||
_availableActiveEffects.clear();
|
||||
std::list<ActiveEffectDefinition> availableActiveEffects;
|
||||
|
||||
for (Effect * effect : _activeEffects)
|
||||
{
|
||||
@@ -73,13 +73,13 @@ const std::list<ActiveEffectDefinition> &EffectEngine::getActiveEffects()
|
||||
activeEffectDefinition.priority = effect->getPriority();
|
||||
activeEffectDefinition.timeout = effect->getTimeout();
|
||||
activeEffectDefinition.args = effect->getArgs();
|
||||
_availableActiveEffects.push_back(activeEffectDefinition);
|
||||
availableActiveEffects.push_back(activeEffectDefinition);
|
||||
}
|
||||
|
||||
return _availableActiveEffects;
|
||||
return availableActiveEffects;
|
||||
}
|
||||
|
||||
const std::list<EffectSchema> & EffectEngine::getEffectSchemas()
|
||||
std::list<EffectSchema> EffectEngine::getEffectSchemas() const
|
||||
{
|
||||
return _effectFileHandler->getEffectSchemas();
|
||||
}
|
||||
|
@@ -65,8 +65,6 @@ public:
|
||||
return physicalAddress;
|
||||
}
|
||||
|
||||
|
||||
|
||||
IonBuffer(size_t bufferSize)
|
||||
: bufferSize(bufferSize)
|
||||
{
|
||||
|
@@ -30,7 +30,7 @@ int vc_dispmanx_display_get_info(int, DISPMANX_MODEINFO_T *vc_info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DISPMANX_RESOURCE_HANDLE_T vc_dispmanx_resource_create(int,int width,int height, uint32_t *)
|
||||
DISPMANX_RESOURCE_HANDLE_T vc_dispmanx_resource_create(int, int width, int height, uint32_t *)
|
||||
{
|
||||
return new DISPMANX_RESOURCE(width,height);
|
||||
}
|
||||
@@ -61,12 +61,12 @@ int vc_dispmanx_snapshot(int, DISPMANX_RESOURCE_HANDLE_T resource, int vc_flags)
|
||||
{
|
||||
__bcm_frame_counter = 0;
|
||||
}
|
||||
|
||||
|
||||
ColorRgba color[4] = {ColorRgba::RED, ColorRgba::BLUE, ColorRgba::GREEN, ColorRgba::WHITE};
|
||||
if (__bcm_frame_counter < 25)
|
||||
{
|
||||
color[0] = ColorRgba::WHITE;
|
||||
color[1] = ColorRgba::RED;
|
||||
0 color[1] = ColorRgba::RED;
|
||||
color[2] = ColorRgba::BLUE;
|
||||
color[3] = ColorRgba::GREEN;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ int vc_dispmanx_snapshot(int, DISPMANX_RESOURCE_HANDLE_T resource, int vc_flags)
|
||||
if (x < w/2 && y < h/2) id = 1;
|
||||
if (x < w/2 && y >= h/2) id = 2;
|
||||
if (x >= w/2 && y < h/2) id = 3;
|
||||
|
||||
|
||||
resource->memptr()[y*w + x] = color[id];
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ CGImageRef CGImageGetDataProvider(CGImageRef image)
|
||||
{
|
||||
__osx_frame_counter = 0;
|
||||
}
|
||||
|
||||
|
||||
ColorRgb color[4] = {ColorRgb::RED, ColorRgb::BLUE, ColorRgb::GREEN, ColorRgb::WHITE};
|
||||
if (__osx_frame_counter < 25)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ CGImageRef CGImageGetDataProvider(CGImageRef image)
|
||||
}
|
||||
unsigned w = image->width();
|
||||
unsigned h = image->height();
|
||||
|
||||
|
||||
for (unsigned y=0; y<h; y++)
|
||||
{
|
||||
for (unsigned x=0; x<w; x++)
|
||||
@@ -64,11 +64,11 @@ CGImageRef CGImageGetDataProvider(CGImageRef image)
|
||||
if (x < w/2 && y < h/2) id = 1;
|
||||
if (x < w/2 && y >= h/2) id = 2;
|
||||
if (x >= w/2 && y < h/2) id = 3;
|
||||
|
||||
|
||||
image->memptr()[y*w + x] = color[id];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
@@ -31,10 +31,10 @@
|
||||
#endif
|
||||
|
||||
V4L2Grabber::V4L2Grabber(const QString & device
|
||||
, const unsigned width
|
||||
, const unsigned height
|
||||
, const unsigned fps
|
||||
, const unsigned input
|
||||
, unsigned width
|
||||
, unsigned height
|
||||
, unsigned fps
|
||||
, unsigned input
|
||||
, VideoStandard videoStandard
|
||||
, PixelFormat pixelFormat
|
||||
, int pixelDecimation
|
||||
@@ -1368,7 +1368,7 @@ bool V4L2Grabber::setFramerate(int fps)
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList V4L2Grabber::getV4L2devices()
|
||||
QStringList V4L2Grabber::getV4L2devices() const
|
||||
{
|
||||
QStringList result = QStringList();
|
||||
for (auto it = _deviceProperties.begin(); it != _deviceProperties.end(); ++it)
|
||||
@@ -1378,22 +1378,22 @@ QStringList V4L2Grabber::getV4L2devices()
|
||||
return result;
|
||||
}
|
||||
|
||||
QString V4L2Grabber::getV4L2deviceName(QString devicePath)
|
||||
QString V4L2Grabber::getV4L2deviceName(const QString& devicePath) const
|
||||
{
|
||||
return _deviceProperties.value(devicePath).name;
|
||||
}
|
||||
|
||||
QMultiMap<QString, int> V4L2Grabber::getV4L2deviceInputs(QString devicePath)
|
||||
QMultiMap<QString, int> V4L2Grabber::getV4L2deviceInputs(const QString& devicePath) const
|
||||
{
|
||||
return _deviceProperties.value(devicePath).inputs;
|
||||
}
|
||||
|
||||
QStringList V4L2Grabber::getResolutions(QString devicePath)
|
||||
QStringList V4L2Grabber::getResolutions(const QString& devicePath) const
|
||||
{
|
||||
return _deviceProperties.value(devicePath).resolutions;
|
||||
}
|
||||
|
||||
QStringList V4L2Grabber::getFramerates(QString devicePath)
|
||||
QStringList V4L2Grabber::getFramerates(const QString& devicePath) const
|
||||
{
|
||||
return _deviceProperties.value(devicePath).framerates;
|
||||
}
|
||||
|
@@ -6,10 +6,10 @@
|
||||
#include <QTimer>
|
||||
|
||||
V4L2Wrapper::V4L2Wrapper(const QString &device,
|
||||
const unsigned grabWidth,
|
||||
const unsigned grabHeight,
|
||||
const unsigned fps,
|
||||
const unsigned input,
|
||||
unsigned grabWidth,
|
||||
unsigned grabHeight,
|
||||
unsigned fps,
|
||||
unsigned input,
|
||||
VideoStandard videoStandard,
|
||||
PixelFormat pixelFormat,
|
||||
int pixelDecimation )
|
||||
@@ -85,7 +85,7 @@ void V4L2Wrapper::setSignalDetectionEnable(bool enable)
|
||||
_grabber.setSignalDetectionEnable(enable);
|
||||
}
|
||||
|
||||
bool V4L2Wrapper::getSignalDetectionEnable()
|
||||
bool V4L2Wrapper::getSignalDetectionEnable() const
|
||||
{
|
||||
return _grabber.getSignalDetectionEnabled();
|
||||
}
|
||||
@@ -95,12 +95,12 @@ void V4L2Wrapper::setCecDetectionEnable(bool enable)
|
||||
_grabber.setCecDetectionEnable(enable);
|
||||
}
|
||||
|
||||
bool V4L2Wrapper::getCecDetectionEnable()
|
||||
bool V4L2Wrapper::getCecDetectionEnable() const
|
||||
{
|
||||
return _grabber.getCecDetectionEnabled();
|
||||
}
|
||||
|
||||
void V4L2Wrapper::setDeviceVideoStandard(QString device, VideoStandard videoStandard)
|
||||
void V4L2Wrapper::setDeviceVideoStandard(const QString& device, VideoStandard videoStandard)
|
||||
{
|
||||
_grabber.setDeviceVideoStandard(device, videoStandard);
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ AuthManager::AuthDefinition AuthManager::createToken(const QString &comment)
|
||||
return def;
|
||||
}
|
||||
|
||||
QVector<AuthManager::AuthDefinition> AuthManager::getTokenList()
|
||||
QVector<AuthManager::AuthDefinition> AuthManager::getTokenList() const
|
||||
{
|
||||
QVector<QVariantMap> vector = _authTable->getTokenList();
|
||||
QVector<AuthManager::AuthDefinition> finalVec;
|
||||
@@ -79,7 +79,7 @@ QVector<AuthManager::AuthDefinition> AuthManager::getTokenList()
|
||||
return finalVec;
|
||||
}
|
||||
|
||||
const QString AuthManager::getUserToken(const QString &usr)
|
||||
QString AuthManager::getUserToken(const QString &usr) const
|
||||
{
|
||||
QString tok = _authTable->getUserToken(usr);
|
||||
return QString(_authTable->getUserToken(usr));
|
||||
@@ -192,7 +192,7 @@ void AuthManager::handlePendingTokenRequest(const QString &id, bool accept)
|
||||
}
|
||||
}
|
||||
|
||||
QVector<AuthManager::AuthDefinition> AuthManager::getPendingRequests()
|
||||
QVector<AuthManager::AuthDefinition> AuthManager::getPendingRequests() const
|
||||
{
|
||||
QVector<AuthManager::AuthDefinition> finalVec;
|
||||
for (const auto &entry : _pendingRequests)
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#include <hyperion/Grabber.h>
|
||||
|
||||
|
||||
Grabber::Grabber(QString grabberName, int width, int height, int cropLeft, int cropRight, int cropTop, int cropBottom)
|
||||
Grabber::Grabber(const QString& grabberName, int width, int height, int cropLeft, int cropRight, int cropTop, int cropBottom)
|
||||
: _imageResampler()
|
||||
, _useImageResampler(true)
|
||||
, _videoMode(VideoMode::VIDEO_2D)
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
GrabberWrapper* GrabberWrapper::instance = nullptr;
|
||||
|
||||
GrabberWrapper::GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, unsigned updateRate_Hz)
|
||||
GrabberWrapper::GrabberWrapper(const QString& grabberName, Grabber * ggrabber, unsigned width, unsigned height, unsigned updateRate_Hz)
|
||||
: _grabberName(grabberName)
|
||||
, _timer(new QTimer(this))
|
||||
, _updateInterval_ms(1000/updateRate_Hz)
|
||||
@@ -201,7 +201,7 @@ void GrabberWrapper::tryStart()
|
||||
}
|
||||
}
|
||||
|
||||
QStringList GrabberWrapper::getV4L2devices()
|
||||
QStringList GrabberWrapper::getV4L2devices() const
|
||||
{
|
||||
if(_grabberName.startsWith("V4L"))
|
||||
return _ggrabber->getV4L2devices();
|
||||
@@ -209,7 +209,7 @@ QStringList GrabberWrapper::getV4L2devices()
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QString GrabberWrapper::getV4L2deviceName(QString devicePath)
|
||||
QString GrabberWrapper::getV4L2deviceName(const QString& devicePath) const
|
||||
{
|
||||
if(_grabberName.startsWith("V4L"))
|
||||
return _ggrabber->getV4L2deviceName(devicePath);
|
||||
@@ -217,7 +217,7 @@ QString GrabberWrapper::getV4L2deviceName(QString devicePath)
|
||||
return QString();
|
||||
}
|
||||
|
||||
QMultiMap<QString, int> GrabberWrapper::getV4L2deviceInputs(QString devicePath)
|
||||
QMultiMap<QString, int> GrabberWrapper::getV4L2deviceInputs(const QString& devicePath) const
|
||||
{
|
||||
if(_grabberName.startsWith("V4L"))
|
||||
return _ggrabber->getV4L2deviceInputs(devicePath);
|
||||
@@ -225,7 +225,7 @@ QMultiMap<QString, int> GrabberWrapper::getV4L2deviceInputs(QString devicePath)
|
||||
return QMultiMap<QString, int>();
|
||||
}
|
||||
|
||||
QStringList GrabberWrapper::getResolutions(QString devicePath)
|
||||
QStringList GrabberWrapper::getResolutions(const QString& devicePath) const
|
||||
{
|
||||
if(_grabberName.startsWith("V4L"))
|
||||
return _ggrabber->getResolutions(devicePath);
|
||||
@@ -233,7 +233,7 @@ QStringList GrabberWrapper::getResolutions(QString devicePath)
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList GrabberWrapper::getFramerates(QString devicePath)
|
||||
QStringList GrabberWrapper::getFramerates(const QString& devicePath) const
|
||||
{
|
||||
if(_grabberName.startsWith("V4L"))
|
||||
return _ggrabber->getFramerates(devicePath);
|
||||
|
@@ -255,7 +255,7 @@ QJsonDocument Hyperion::getSetting(settings::type type) const
|
||||
return _settingsManager->getSetting(type);
|
||||
}
|
||||
|
||||
bool Hyperion::saveSettings(QJsonObject config, bool correct)
|
||||
bool Hyperion::saveSettings(const QJsonObject& config, bool correct)
|
||||
{
|
||||
return _settingsManager->saveSettings(config, correct);
|
||||
}
|
||||
@@ -290,7 +290,7 @@ bool Hyperion::setVisiblePriority(int priority)
|
||||
return _muxer.setPriority(priority);
|
||||
}
|
||||
|
||||
bool Hyperion::sourceAutoSelectEnabled()
|
||||
bool Hyperion::sourceAutoSelectEnabled() const
|
||||
{
|
||||
return _muxer.isSourceAutoSelectEnabled();
|
||||
}
|
||||
@@ -305,7 +305,7 @@ std::map<hyperion::Components, bool> Hyperion::getAllComponents() const
|
||||
return _componentRegister.getRegister();
|
||||
}
|
||||
|
||||
int Hyperion::isComponentEnabled(hyperion::Components comp)
|
||||
int Hyperion::isComponentEnabled(hyperion::Components comp) const
|
||||
{
|
||||
return _componentRegister.isComponentEnabled(comp);
|
||||
}
|
||||
@@ -396,7 +396,7 @@ end:
|
||||
_muxer.queuePush();
|
||||
}
|
||||
|
||||
const QStringList & Hyperion::getAdjustmentIds() const
|
||||
QStringList Hyperion::getAdjustmentIds() const
|
||||
{
|
||||
return _raw2ledAdjustment->getAdjustmentIds();
|
||||
}
|
||||
@@ -464,22 +464,22 @@ QString Hyperion::deleteEffect(const QString& effectName)
|
||||
return _effectEngine->deleteEffect(effectName);
|
||||
}
|
||||
|
||||
const std::list<EffectDefinition> & Hyperion::getEffects() const
|
||||
std::list<EffectDefinition> Hyperion::getEffects() const
|
||||
{
|
||||
return _effectEngine->getEffects();
|
||||
}
|
||||
|
||||
const std::list<ActiveEffectDefinition> & Hyperion::getActiveEffects() const
|
||||
std::list<ActiveEffectDefinition> Hyperion::getActiveEffects() const
|
||||
{
|
||||
return _effectEngine->getActiveEffects();
|
||||
}
|
||||
|
||||
const std::list<EffectSchema> & Hyperion::getEffectSchemas() const
|
||||
std::list<EffectSchema> Hyperion::getEffectSchemas() const
|
||||
{
|
||||
return _effectEngine->getEffectSchemas();
|
||||
}
|
||||
|
||||
const QJsonObject& Hyperion::getQJsonConfig() const
|
||||
QJsonObject Hyperion::getQJsonConfig() const
|
||||
{
|
||||
return _settingsManager->getSettings();
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ Hyperion* HyperionIManager::getHyperionInstance(quint8 instance)
|
||||
return _runningInstances.value(0);
|
||||
}
|
||||
|
||||
const QVector<QVariantMap> HyperionIManager::getInstanceData()
|
||||
QVector<QVariantMap> HyperionIManager::getInstanceData() const
|
||||
{
|
||||
QVector<QVariantMap> instances = _instanceTable->getAllInstances();
|
||||
for( auto & entry : instances)
|
||||
|
@@ -10,7 +10,7 @@
|
||||
using namespace hyperion;
|
||||
|
||||
// global transform method
|
||||
int ImageProcessor::mappingTypeToInt(QString mappingType)
|
||||
int ImageProcessor::mappingTypeToInt(const QString& mappingType)
|
||||
{
|
||||
if (mappingType == "unicolor_mean" )
|
||||
return 1;
|
||||
@@ -99,7 +99,7 @@ void ImageProcessor::setBlackbarDetectDisable(bool enable)
|
||||
_borderProcessor->setHardDisable(enable);
|
||||
}
|
||||
|
||||
bool ImageProcessor::blackBorderDetectorEnabled()
|
||||
bool ImageProcessor::blackBorderDetectorEnabled() const
|
||||
{
|
||||
return _borderProcessor->enabled();
|
||||
}
|
||||
|
@@ -156,7 +156,7 @@ void MessageForwarder::handlePriorityChanges(quint8 priority)
|
||||
}
|
||||
}
|
||||
|
||||
void MessageForwarder::addJsonSlave(QString slave)
|
||||
void MessageForwarder::addJsonSlave(const QString& slave)
|
||||
{
|
||||
QStringList parts = slave.split(":");
|
||||
if (parts.size() != 2)
|
||||
@@ -185,7 +185,7 @@ void MessageForwarder::addJsonSlave(QString slave)
|
||||
_jsonSlaves << slave;
|
||||
}
|
||||
|
||||
void MessageForwarder::addFlatbufferSlave(QString slave)
|
||||
void MessageForwarder::addFlatbufferSlave(const QString& slave)
|
||||
{
|
||||
QStringList parts = slave.split(":");
|
||||
if (parts.size() != 2)
|
||||
|
@@ -67,7 +67,7 @@ bool MultiColorAdjustment::verifyAdjustments() const
|
||||
return ok;
|
||||
}
|
||||
|
||||
const QStringList & MultiColorAdjustment::getAdjustmentIds()
|
||||
QStringList MultiColorAdjustment::getAdjustmentIds() const
|
||||
{
|
||||
return _adjustmentIds;
|
||||
}
|
||||
|
@@ -133,7 +133,7 @@ PriorityMuxer::InputInfo PriorityMuxer::getInputInfo(int priority) const
|
||||
return elemIt.value();
|
||||
}
|
||||
|
||||
hyperion::Components PriorityMuxer::getComponentOfPriority(int priority)
|
||||
hyperion::Components PriorityMuxer::getComponentOfPriority(int priority) const
|
||||
{
|
||||
return _activeInputs[priority].componentId;
|
||||
}
|
||||
|
@@ -130,7 +130,7 @@ bool SettingsManager::saveSettings(QJsonObject config, bool correct)
|
||||
Warning(_log,"Fixing json data!");
|
||||
config = schemaChecker.getAutoCorrectedConfig(config);
|
||||
|
||||
for (auto & schemaError : schemaChecker.getMessages())
|
||||
for (const auto & schemaError : schemaChecker.getMessages())
|
||||
Warning(_log, "Config Fix: %s", QSTRING_CSTR(schemaError));
|
||||
}
|
||||
|
||||
|
@@ -35,21 +35,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -57,7 +57,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -67,7 +67,7 @@ void LedDeviceWrapper::createLedDevice(const QJsonObject& config)
|
||||
thread->start();
|
||||
}
|
||||
|
||||
const QJsonObject LedDeviceWrapper::getLedDeviceSchemas()
|
||||
QJsonObject LedDeviceWrapper::getLedDeviceSchemas()
|
||||
{
|
||||
// make sure the resources are loaded (they may be left out after static linking)
|
||||
Q_INIT_RESOURCE(LedDeviceSchemas);
|
||||
@@ -118,21 +118,21 @@ const LedDeviceRegistry& LedDeviceWrapper::getDeviceMap()
|
||||
return _ledDeviceMap;
|
||||
}
|
||||
|
||||
int LedDeviceWrapper::getLatchTime()
|
||||
int LedDeviceWrapper::getLatchTime() const
|
||||
{
|
||||
int value = 0;
|
||||
QMetaObject::invokeMethod(_ledDevice, "getLatchTime", Qt::BlockingQueuedConnection, Q_RETURN_ARG(int, value));
|
||||
return value;
|
||||
}
|
||||
|
||||
QString LedDeviceWrapper::getActiveDeviceType()
|
||||
QString LedDeviceWrapper::getActiveDeviceType() const
|
||||
{
|
||||
QString value = 0;
|
||||
QMetaObject::invokeMethod(_ledDevice, "getActiveDeviceType", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QString, value));
|
||||
return value;
|
||||
}
|
||||
|
||||
QString LedDeviceWrapper::getColorOrder()
|
||||
QString LedDeviceWrapper::getColorOrder() const
|
||||
{
|
||||
QString value;
|
||||
QMetaObject::invokeMethod(_ledDevice, "getColorOrder", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QString, value));
|
||||
@@ -146,7 +146,7 @@ unsigned int LedDeviceWrapper::getLedCount() const
|
||||
return value;
|
||||
}
|
||||
|
||||
bool LedDeviceWrapper::enabled()
|
||||
bool LedDeviceWrapper::enabled() const
|
||||
{
|
||||
return _enabled;
|
||||
}
|
||||
|
@@ -43,14 +43,14 @@ public:
|
||||
///
|
||||
/// Destructor of the LedDevice; closes the output device if it is open
|
||||
///
|
||||
virtual ~LedDeviceHyperionUsbasp() override;
|
||||
~LedDeviceHyperionUsbasp() override;
|
||||
|
||||
public slots:
|
||||
///
|
||||
/// Closes the output device.
|
||||
/// Includes switching-off the device and stopping refreshes
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
protected:
|
||||
///
|
||||
@@ -67,7 +67,7 @@ protected:
|
||||
///
|
||||
/// @return Zero on success else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb>& ledValues) override;
|
||||
int write(const std::vector<ColorRgb>& ledValues) override;
|
||||
|
||||
///
|
||||
/// Test if the device is a Hyperion Usbasp device
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~LedDeviceLightpack() override;
|
||||
~LedDeviceLightpack() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -50,28 +50,28 @@ public:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn off the Nanoleaf device.
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
virtual bool powerOff() override;
|
||||
bool powerOff() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -100,7 +100,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -31,7 +31,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~LedDeviceMultiLightpack() override;
|
||||
~LedDeviceMultiLightpack() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -49,28 +49,28 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn off the Nanoleaf device.
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
virtual bool powerOff() override;
|
||||
bool powerOff() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
|
@@ -34,7 +34,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICEPAINTTPACK_H
|
||||
|
@@ -37,7 +37,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICERAWHID_H
|
||||
|
@@ -156,28 +156,30 @@ int ProviderHID::writeBytes(unsigned size, const uint8_t * data)
|
||||
else{
|
||||
ret = hid_write(_deviceHandle, ledData, size + 1);
|
||||
}
|
||||
|
||||
|
||||
// Handle first error
|
||||
if(ret < 0){
|
||||
if(ret < 0)
|
||||
{
|
||||
Error(_log,"Failed to write to HID device.");
|
||||
|
||||
// Try again
|
||||
if(_useFeature){
|
||||
if(_useFeature)
|
||||
{
|
||||
ret = hid_send_feature_report(_deviceHandle, ledData, size + 1);
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
ret = hid_write(_deviceHandle, ledData, size + 1);
|
||||
}
|
||||
|
||||
// Writing failed again, device might have disconnected
|
||||
if(ret < 0){
|
||||
Error(_log,"Failed to write to HID device.");
|
||||
|
||||
|
||||
hid_close(_deviceHandle);
|
||||
_deviceHandle = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -26,14 +26,14 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~ProviderHID() override;
|
||||
~ProviderHID() override;
|
||||
|
||||
///
|
||||
/// @brief Discover HIB (USB) devices available (for configuration).
|
||||
///
|
||||
/// @return A JSON structure holding a list of devices found
|
||||
///
|
||||
virtual QJsonObject discover() override;
|
||||
QJsonObject discover() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -43,21 +43,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Write the given bytes to the HID-device
|
||||
|
@@ -33,7 +33,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~LedDeviceAtmoOrb() override;
|
||||
~LedDeviceAtmoOrb() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -51,21 +51,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -73,7 +73,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -151,7 +151,7 @@ int LedDeviceFadeCandy::close()
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool LedDeviceFadeCandy::isConnected()
|
||||
bool LedDeviceFadeCandy::isConnected() const
|
||||
{
|
||||
bool connected = false;
|
||||
if ( _client != nullptr )
|
||||
@@ -204,7 +204,7 @@ int LedDeviceFadeCandy::transferData()
|
||||
return -2;
|
||||
}
|
||||
|
||||
int LedDeviceFadeCandy::sendSysEx(uint8_t systemId, uint8_t commandId, QByteArray msg)
|
||||
int LedDeviceFadeCandy::sendSysEx(uint8_t systemId, uint8_t commandId, const QByteArray& msg)
|
||||
{
|
||||
if ( isConnected() )
|
||||
{
|
||||
|
@@ -62,21 +62,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -84,7 +84,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -106,7 +106,7 @@ private:
|
||||
///
|
||||
/// @return True, if connection established
|
||||
///
|
||||
bool isConnected();
|
||||
bool isConnected() const;
|
||||
|
||||
///
|
||||
/// @brief Transfer current opc_data buffer to opc server
|
||||
@@ -114,7 +114,7 @@ private:
|
||||
/// @return amount of transferred bytes. -1 error while transferring, -2 error while connecting
|
||||
///
|
||||
int transferData();
|
||||
|
||||
|
||||
///
|
||||
/// @brief Send system exclusive commands
|
||||
///
|
||||
@@ -122,7 +122,7 @@ private:
|
||||
/// @param[in] commandId id of command
|
||||
/// @param[in] msg the sysEx message
|
||||
/// @return amount bytes written, -1 if failed
|
||||
int sendSysEx(uint8_t systemId, uint8_t commandId, QByteArray msg);
|
||||
int sendSysEx(uint8_t systemId, uint8_t commandId, const QByteArray& msg);
|
||||
|
||||
///
|
||||
/// @brief Sends the configuration to fadecandy cserver
|
||||
|
@@ -513,7 +513,7 @@ bool LedDeviceNanoleaf::powerOff()
|
||||
return true;
|
||||
}
|
||||
|
||||
QString LedDeviceNanoleaf::getOnOffRequest (bool isOn ) const
|
||||
QString LedDeviceNanoleaf::getOnOffRequest(bool isOn) const
|
||||
{
|
||||
QString state = isOn ? STATE_VALUE_TRUE : STATE_VALUE_FALSE;
|
||||
return QString( "{\"%1\":{\"%2\":%3}}" ).arg(STATE_ON, STATE_ONOFF_VALUE, state);
|
||||
@@ -614,7 +614,7 @@ int LedDeviceNanoleaf::write(const std::vector<ColorRgb> & ledValues)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
std::string LedDeviceNanoleaf:: uint8_vector_to_hex_string( const std::vector<uint8_t>& buffer ) const
|
||||
std::string LedDeviceNanoleaf::uint8_vector_to_hex_string(const std::vector<uint8_t>& buffer) const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << std::hex << std::setfill('0');
|
||||
|
@@ -37,7 +37,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LED-device
|
||||
///
|
||||
virtual ~LedDeviceNanoleaf() override;
|
||||
~LedDeviceNanoleaf() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
///
|
||||
/// @return A JSON structure holding a list of devices found
|
||||
///
|
||||
virtual QJsonObject discover() override;
|
||||
QJsonObject discover() override;
|
||||
|
||||
///
|
||||
/// @brief Get the Nanoleaf device's resource properties
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
/// @param[in] params Parameters to query device
|
||||
/// @return A JSON structure holding the device's properties
|
||||
///
|
||||
virtual QJsonObject getProperties(const QJsonObject& params) override;
|
||||
QJsonObject getProperties(const QJsonObject& params) override;
|
||||
|
||||
///
|
||||
/// @brief Send an update to the Nanoleaf device to identify it.
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
///
|
||||
/// @param[in] params Parameters to address device
|
||||
///
|
||||
virtual void identify(const QJsonObject& params) override;
|
||||
void identify(const QJsonObject& params) override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -100,7 +100,7 @@ protected:
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -108,21 +108,21 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
//////
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn on the Nanoleaf device.
|
||||
///
|
||||
/// @brief Store the device's original state.
|
||||
///
|
||||
virtual bool powerOn() override;
|
||||
bool powerOn() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn off the Nanoleaf device.
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
virtual bool powerOff() override;
|
||||
bool powerOff() override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -347,7 +347,7 @@ bool LedDevicePhilipsHueBridge::init(const QJsonObject &deviceConfig)
|
||||
return isInitOK;
|
||||
}
|
||||
|
||||
bool LedDevicePhilipsHueBridge::initRestAPI(const QString &hostname, int port, const QString &token )
|
||||
bool LedDevicePhilipsHueBridge::initRestAPI(const QString &hostname, int port, const QString &token)
|
||||
{
|
||||
bool isInitOK = false;
|
||||
|
||||
@@ -403,12 +403,12 @@ int LedDevicePhilipsHueBridge::close()
|
||||
return retval;
|
||||
}
|
||||
|
||||
const int *LedDevicePhilipsHueBridge::getCiphersuites()
|
||||
const int *LedDevicePhilipsHueBridge::getCiphersuites() const
|
||||
{
|
||||
return SSL_CIPHERSUITES;
|
||||
}
|
||||
|
||||
void LedDevicePhilipsHueBridge::log(const char* msg, const char* type, ...)
|
||||
void LedDevicePhilipsHueBridge::log(const char* msg, const char* type, ...) const
|
||||
{
|
||||
const size_t max_val_length = 1024;
|
||||
char val[max_val_length];
|
||||
@@ -544,17 +544,17 @@ void LedDevicePhilipsHueBridge::setGroupMap(const QJsonDocument &doc)
|
||||
}
|
||||
}
|
||||
|
||||
const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getLightMap()
|
||||
QMap<quint16,QJsonObject> LedDevicePhilipsHueBridge::getLightMap() const
|
||||
{
|
||||
return _lightsMap;
|
||||
}
|
||||
|
||||
const QMap<quint16,QJsonObject>& LedDevicePhilipsHueBridge::getGroupMap()
|
||||
QMap<quint16,QJsonObject> LedDevicePhilipsHueBridge::getGroupMap() const
|
||||
{
|
||||
return _groupsMap;
|
||||
}
|
||||
|
||||
QString LedDevicePhilipsHueBridge::getGroupName(quint16 groupId)
|
||||
QString LedDevicePhilipsHueBridge::getGroupName(quint16 groupId) const
|
||||
{
|
||||
QString groupName;
|
||||
if( _groupsMap.contains( groupId ) )
|
||||
@@ -569,7 +569,7 @@ QString LedDevicePhilipsHueBridge::getGroupName(quint16 groupId)
|
||||
return groupName;
|
||||
}
|
||||
|
||||
QJsonArray LedDevicePhilipsHueBridge::getGroupLights(quint16 groupId)
|
||||
QJsonArray LedDevicePhilipsHueBridge::getGroupLights(quint16 groupId) const
|
||||
{
|
||||
QJsonArray groupLights;
|
||||
// search user groupid inside _groupsMap and create light if found
|
||||
@@ -599,13 +599,13 @@ QJsonArray LedDevicePhilipsHueBridge::getGroupLights(quint16 groupId)
|
||||
return groupLights;
|
||||
}
|
||||
|
||||
bool LedDevicePhilipsHueBridge::checkApiError(const QJsonDocument &response )
|
||||
bool LedDevicePhilipsHueBridge::checkApiError(const QJsonDocument &response)
|
||||
{
|
||||
bool apiError = false;
|
||||
QString errorReason;
|
||||
|
||||
QString strJson(response.toJson(QJsonDocument::Compact));
|
||||
DebugIf(verbose, _log, "Reply: [%s]", strJson.toUtf8().constData() );
|
||||
DebugIf(verbose, _log, "Reply: [%s]", strJson.toUtf8().constData());
|
||||
|
||||
QVariantList rspList = response.toVariant().toList();
|
||||
if ( !rspList.isEmpty() )
|
||||
@@ -662,7 +662,7 @@ QJsonDocument LedDevicePhilipsHueBridge::setGroupState(unsigned int groupId, boo
|
||||
return post( QString("%1/%2").arg( API_GROUPS ).arg( groupId ), QString("{\"%1\":{\"%2\":%3}}").arg( API_STREAM, API_STREAM_ACTIVE, active ) );
|
||||
}
|
||||
|
||||
bool LedDevicePhilipsHueBridge::isStreamOwner(const QString &streamOwner)
|
||||
bool LedDevicePhilipsHueBridge::isStreamOwner(const QString &streamOwner) const
|
||||
{
|
||||
return ( streamOwner != "" && streamOwner == _username );
|
||||
}
|
||||
@@ -1254,13 +1254,13 @@ bool LedDevicePhilipsHue::setStreamGroupState(bool state)
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray LedDevicePhilipsHue::prepareStreamData()
|
||||
QByteArray LedDevicePhilipsHue::prepareStreamData() const
|
||||
{
|
||||
QByteArray msg;
|
||||
msg.reserve(static_cast<int>(sizeof(HEADER) + sizeof(PAYLOAD_PER_LIGHT) * _lights.size()));
|
||||
msg.append((const char*)HEADER, sizeof(HEADER));
|
||||
|
||||
for (PhilipsHueLight& light : _lights)
|
||||
for (const PhilipsHueLight& light : _lights)
|
||||
{
|
||||
CiColor lightC = light.getColor();
|
||||
quint64 R = lightC.x * 0xffff;
|
||||
|
@@ -208,13 +208,13 @@ public:
|
||||
|
||||
void setLightState(unsigned int lightId = 0, const QString &state = "");
|
||||
|
||||
const QMap<quint16,QJsonObject>& getLightMap();
|
||||
QMap<quint16,QJsonObject> getLightMap() const;
|
||||
|
||||
const QMap<quint16,QJsonObject>& getGroupMap();
|
||||
QMap<quint16,QJsonObject> getGroupMap() const;
|
||||
|
||||
QString getGroupName(quint16 groupId = 0);
|
||||
QString getGroupName(quint16 groupId = 0) const;
|
||||
|
||||
QJsonArray getGroupLights(quint16 groupId = 0);
|
||||
QJsonArray getGroupLights(quint16 groupId = 0) const;
|
||||
|
||||
|
||||
|
||||
@@ -226,21 +226,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the Hue-Bridge device and its SSL-connection
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the Hue-Bridge device and its SSL-connection
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Check, if Hue API response indicate error
|
||||
@@ -264,12 +264,12 @@ protected:
|
||||
QJsonDocument getGroupState( unsigned int groupId );
|
||||
QJsonDocument setGroupState( unsigned int groupId, bool state);
|
||||
|
||||
bool isStreamOwner(const QString &streamOwner);
|
||||
bool isStreamOwner(const QString &streamOwner) const;
|
||||
bool initMaps();
|
||||
|
||||
void log(const char* msg, const char* type, ...);
|
||||
void log(const char* msg, const char* type, ...) const;
|
||||
|
||||
const int * getCiphersuites() override;
|
||||
const int * getCiphersuites() const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LED-device
|
||||
///
|
||||
virtual ~LedDevicePhilipsHue();
|
||||
~LedDevicePhilipsHue();
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -331,7 +331,7 @@ public:
|
||||
///
|
||||
/// @return A JSON structure holding a list of devices found
|
||||
///
|
||||
virtual QJsonObject discover() override;
|
||||
QJsonObject discover() override;
|
||||
|
||||
///
|
||||
/// @brief Get the Hue Bridge device's resource properties
|
||||
@@ -348,7 +348,7 @@ public:
|
||||
/// @param[in] params Parameters to query device
|
||||
/// @return A JSON structure holding the device's properties
|
||||
///
|
||||
virtual QJsonObject getProperties(const QJsonObject& params) override;
|
||||
QJsonObject getProperties(const QJsonObject& params) override;
|
||||
|
||||
///
|
||||
/// @brief Send an update to the device to identify it.
|
||||
@@ -357,7 +357,7 @@ public:
|
||||
///
|
||||
/// @param[in] params Parameters to address device
|
||||
///
|
||||
virtual void identify(const QJsonObject& params) override;
|
||||
void identify(const QJsonObject& params) override;
|
||||
|
||||
///
|
||||
/// @brief Get the number of LEDs supported by the device.
|
||||
@@ -378,7 +378,7 @@ public slots:
|
||||
///
|
||||
/// Includes switching-off the device and stopping refreshes.
|
||||
///
|
||||
virtual void stop() override;
|
||||
void stop() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -388,21 +388,21 @@ protected:
|
||||
/// @param deviceConfig Device's configuration in JSON
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -410,7 +410,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb>& ledValues) override;
|
||||
int write(const std::vector<ColorRgb>& ledValues) override;
|
||||
|
||||
///
|
||||
/// @brief Switch the LEDs on.
|
||||
@@ -421,7 +421,7 @@ protected:
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
//virtual bool switchOn() override;
|
||||
//bool switchOn() override;
|
||||
|
||||
///
|
||||
/// @brief Switch the LEDs off.
|
||||
@@ -432,7 +432,7 @@ protected:
|
||||
///
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool switchOff() override;
|
||||
bool switchOff() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn on the LED-device.
|
||||
@@ -441,7 +441,7 @@ protected:
|
||||
///
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool powerOn() override;
|
||||
bool powerOn() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn off the LED-device.
|
||||
@@ -451,7 +451,7 @@ protected:
|
||||
///
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool powerOff() override;
|
||||
bool powerOff() override;
|
||||
|
||||
///
|
||||
/// @brief Store the device's original state.
|
||||
@@ -460,7 +460,7 @@ protected:
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
virtual bool storeState() override;
|
||||
bool storeState() override;
|
||||
|
||||
///
|
||||
/// @brief Restore the device's original state.
|
||||
@@ -470,7 +470,7 @@ protected:
|
||||
///
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool restoreState() override;
|
||||
bool restoreState() override;
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -515,7 +515,7 @@ private:
|
||||
|
||||
void stopBlackTimeoutTimer();
|
||||
|
||||
QByteArray prepareStreamData();
|
||||
QByteArray prepareStreamData() const;
|
||||
|
||||
///
|
||||
bool _switchOffOnBlack;
|
||||
|
@@ -34,7 +34,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
int _tpm2_max;
|
||||
int _tpm2ByteCount;
|
||||
|
@@ -67,7 +67,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
///
|
||||
/// @brief Generate Art-Net communication header
|
||||
|
@@ -112,7 +112,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
///
|
||||
/// @brief Generate E1.31 communication header
|
||||
|
@@ -35,7 +35,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
QList<int> _ids;
|
||||
QByteArray _message;
|
||||
|
@@ -34,7 +34,7 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -42,7 +42,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICEUDPRAW_H
|
||||
|
@@ -111,7 +111,7 @@ bool LedDeviceWled::init(const QJsonObject &deviceConfig)
|
||||
return isInitOK;
|
||||
}
|
||||
|
||||
bool LedDeviceWled::initRestAPI(const QString &hostname, int port )
|
||||
bool LedDeviceWled::initRestAPI(const QString &hostname, int port)
|
||||
{
|
||||
Debug(_log, "");
|
||||
bool isInitOK = false;
|
||||
@@ -128,7 +128,7 @@ bool LedDeviceWled::initRestAPI(const QString &hostname, int port )
|
||||
return isInitOK;
|
||||
}
|
||||
|
||||
QString LedDeviceWled::getOnOffRequest (bool isOn ) const
|
||||
QString LedDeviceWled::getOnOffRequest(bool isOn) const
|
||||
{
|
||||
QString state = isOn ? STATE_VALUE_TRUE : STATE_VALUE_FALSE;
|
||||
return QString( "{\"%1\":%2}" ).arg( STATE_ON, state);
|
||||
|
@@ -25,7 +25,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the WLED-device
|
||||
///
|
||||
virtual ~LedDeviceWled() override;
|
||||
~LedDeviceWled() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the WLED-device
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
///
|
||||
/// @return A JSON structure holding a list of devices found
|
||||
///
|
||||
virtual QJsonObject discover() override;
|
||||
QJsonObject discover() override;
|
||||
|
||||
///
|
||||
/// @brief Get the WLED device's resource properties
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
/// @param[in] params Parameters to query device
|
||||
/// @return A JSON structure holding the device's properties
|
||||
///
|
||||
virtual QJsonObject getProperties(const QJsonObject& params) override;
|
||||
QJsonObject getProperties(const QJsonObject& params) override;
|
||||
|
||||
///
|
||||
/// @brief Send an update to the WLED device to identify it.
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
///
|
||||
/// @param[in] params Parameters to address device
|
||||
///
|
||||
virtual void identify(const QJsonObject& params) override;
|
||||
void identify(const QJsonObject& params) override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -79,7 +79,7 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -87,21 +87,21 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn on the WLED device.
|
||||
///
|
||||
/// @brief Store the device's original state.
|
||||
///
|
||||
virtual bool powerOn() override;
|
||||
bool powerOn() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn off the WLED device.
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
virtual bool powerOff() override;
|
||||
bool powerOff() override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -575,7 +575,7 @@ bool YeelightLight::identify()
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool YeelightLight::isInMusicMode( bool deviceCheck)
|
||||
bool YeelightLight::isInMusicMode(bool deviceCheck)
|
||||
{
|
||||
bool inMusicMode = false;
|
||||
|
||||
@@ -899,7 +899,7 @@ bool YeelightLight::setColorHSV(const ColorRgb &colorRGB)
|
||||
}
|
||||
|
||||
|
||||
void YeelightLight::setTransitionEffect ( YeelightLight::API_EFFECT effect ,int duration )
|
||||
void YeelightLight::setTransitionEffect(YeelightLight::API_EFFECT effect, int duration)
|
||||
{
|
||||
if( effect != _transitionEffect )
|
||||
{
|
||||
@@ -914,7 +914,7 @@ void YeelightLight::setTransitionEffect ( YeelightLight::API_EFFECT effect ,int
|
||||
|
||||
}
|
||||
|
||||
void YeelightLight::setBrightnessConfig (int min, int max, bool switchoff, int extraTime, double factor )
|
||||
void YeelightLight::setBrightnessConfig(int min, int max, bool switchoff, int extraTime, double factor)
|
||||
{
|
||||
_brightnessMin = min;
|
||||
_isBrightnessSwitchOffMinimum = switchoff;
|
||||
|
@@ -49,8 +49,6 @@ public:
|
||||
API_NOTIFICATION,
|
||||
};
|
||||
|
||||
explicit YeelightResponse() {}
|
||||
|
||||
API_REPLY error() const { return _error;}
|
||||
void setError(const YeelightResponse::API_REPLY replyType) { _error = replyType; }
|
||||
|
||||
@@ -79,7 +77,6 @@ class YeelightLight
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
enum API_EFFECT{
|
||||
API_EFFECT_SMOOTH,
|
||||
API_EFFECT_SUDDEN
|
||||
@@ -281,7 +278,7 @@ public:
|
||||
///
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool restoreState();
|
||||
bool restoreState();
|
||||
|
||||
///
|
||||
/// @brief Check, if light was originally powered on before hyperion color streaming started..
|
||||
@@ -428,7 +425,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~LedDeviceYeelight() override;
|
||||
~LedDeviceYeelight() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -443,7 +440,7 @@ public:
|
||||
///
|
||||
/// @return A JSON structure holding a list of devices found
|
||||
///
|
||||
virtual QJsonObject discover() override;
|
||||
QJsonObject discover() override;
|
||||
|
||||
///
|
||||
/// @brief Get a Yeelight device's resource properties
|
||||
@@ -459,7 +456,7 @@ public:
|
||||
/// @param[in] params Parameters to query device
|
||||
/// @return A JSON structure holding the device's properties
|
||||
///
|
||||
virtual QJsonObject getProperties(const QJsonObject& params) override;
|
||||
QJsonObject getProperties(const QJsonObject& params) override;
|
||||
|
||||
///
|
||||
/// @brief Send an update to the Yeelight device to identify it.
|
||||
@@ -474,7 +471,7 @@ public:
|
||||
///
|
||||
/// @param[in] params Parameters to address device
|
||||
///
|
||||
virtual void identify(const QJsonObject& params) override;
|
||||
void identify(const QJsonObject& params) override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -484,21 +481,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -506,21 +503,21 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn on the Nanoleaf device.
|
||||
///
|
||||
/// @brief Store the device's original state.
|
||||
///
|
||||
virtual bool powerOn() override;
|
||||
bool powerOn() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn off the Nanoleaf device.
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
virtual bool powerOff() override;
|
||||
bool powerOff() override;
|
||||
|
||||
///
|
||||
/// @brief Store the device's original state.
|
||||
@@ -529,7 +526,7 @@ protected:
|
||||
///
|
||||
/// @return True if success
|
||||
///
|
||||
virtual bool storeState() override;
|
||||
bool storeState() override;
|
||||
|
||||
///
|
||||
/// @brief Restore the device's original state.
|
||||
@@ -539,7 +536,7 @@ protected:
|
||||
///
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool restoreState() override;
|
||||
bool restoreState() override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -16,8 +16,7 @@
|
||||
class httpResponse
|
||||
{
|
||||
public:
|
||||
|
||||
explicit httpResponse() {}
|
||||
httpResponse() {}
|
||||
|
||||
bool error() const { return _hasError;}
|
||||
void setError(bool hasError) { _hasError = hasError; }
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the UDP LED-device
|
||||
///
|
||||
virtual ~ProviderUdp() override;
|
||||
~ProviderUdp() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -36,21 +36,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the UDP device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the given bytes/bits to the UDP-device and sleeps the latch time to ensure that the
|
||||
|
@@ -182,7 +182,7 @@ void ProviderUdpSSL::closeSSLConnection()
|
||||
}
|
||||
}
|
||||
|
||||
const int *ProviderUdpSSL::getCiphersuites()
|
||||
const int *ProviderUdpSSL::getCiphersuites() const
|
||||
{
|
||||
return mbedtls_ssl_list_ciphersuites();
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LED-device
|
||||
///
|
||||
virtual ~ProviderUdpSSL() override;
|
||||
~ProviderUdpSSL() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -76,21 +76,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success#endif // PROVIDERUDP_H
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Initialise device's network details
|
||||
@@ -113,7 +113,7 @@ protected:
|
||||
///
|
||||
/// @return const int * array
|
||||
///
|
||||
virtual const int * getCiphersuites();
|
||||
virtual const int * getCiphersuites() const;
|
||||
|
||||
void sslLog(const QString &msg, const char* errorType = "debug");
|
||||
void sslLog(const char* msg, const char* errorType = "debug");
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~LedDeviceFile() override;
|
||||
~LedDeviceFile() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -43,21 +43,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -65,7 +65,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
/// The outputstream
|
||||
QFile* _file;
|
||||
|
@@ -20,7 +20,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~LedDevicePiBlaster() override;
|
||||
~LedDevicePiBlaster() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -43,14 +43,14 @@ protected:
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -131,7 +131,7 @@ int LedDeviceWS281x::write(const std::vector<ColorRgb> &ledValues)
|
||||
Rgb_to_Rgbw(color, &_temp_rgbw, _whiteAlgorithm);
|
||||
}
|
||||
|
||||
_led_string.channel[_channel].leds[idx++] =
|
||||
_led_string.channel[_channel].leds[idx++] =
|
||||
((uint32_t)_temp_rgbw.white << 24) + ((uint32_t)_temp_rgbw.red << 16) + ((uint32_t)_temp_rgbw.green << 8) + _temp_rgbw.blue;
|
||||
|
||||
}
|
||||
@@ -139,6 +139,6 @@ int LedDeviceWS281x::write(const std::vector<ColorRgb> &ledValues)
|
||||
{
|
||||
_led_string.channel[_channel].leds[idx++] = 0;
|
||||
}
|
||||
|
||||
|
||||
return ws2811_render(&_led_string) ? -1 : 0;
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
///
|
||||
virtual ~LedDeviceWS281x() override;
|
||||
~LedDeviceWS281x() override;
|
||||
|
||||
///
|
||||
/// @brief Destructor of the LedDevice
|
||||
@@ -37,21 +37,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -59,7 +59,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -35,7 +35,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
const short _headerSize;
|
||||
bool _ligthBerryAPA102Mode;
|
||||
|
@@ -30,7 +30,7 @@ private:
|
||||
///
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -38,7 +38,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICEATMO_H
|
||||
|
@@ -24,7 +24,7 @@ public:
|
||||
/// @param[in] deviceConfig Device's configuration as JSON-Object
|
||||
/// @return LedDevice constructed
|
||||
static LedDevice* construct(const QJsonObject &deviceConfig);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
///
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
|
||||
int _dmxDeviceType = 0;
|
||||
int _dmxStart = 1;
|
||||
|
@@ -34,14 +34,14 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
///
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICEKARATE_H
|
||||
|
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICESEDU_H
|
||||
|
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
int write(const std::vector<ColorRgb> &ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICETPM2_H
|
||||
|
@@ -24,7 +24,7 @@ public:
|
||||
///
|
||||
/// @brief Destructor of the UDP LED-device
|
||||
///
|
||||
virtual ~ProviderRs232() override;
|
||||
~ProviderRs232() override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -34,21 +34,21 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens the output device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Closes the UDP device.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is closed), else negative
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
///
|
||||
/// @brief Power-/turn off a RS232-device
|
||||
@@ -57,21 +57,21 @@ protected:
|
||||
///
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool powerOff() override;
|
||||
bool powerOff() override;
|
||||
|
||||
///
|
||||
/// @brief Discover first devices of a serial device available (for configuration)
|
||||
///
|
||||
/// @return A string of the device found
|
||||
///
|
||||
virtual QString discoverFirst() override;
|
||||
QString discoverFirst() override;
|
||||
|
||||
///
|
||||
/// @brief Discover RS232 serial devices available (for configuration).
|
||||
///
|
||||
/// @return A JSON structure holding a list of devices found
|
||||
///
|
||||
virtual QJsonObject discover() override;
|
||||
QJsonObject discover() override;
|
||||
|
||||
///
|
||||
/// @brief Write the given bytes to the RS232-device
|
||||
@@ -96,7 +96,7 @@ protected slots:
|
||||
///
|
||||
/// @param errorMsg The error message to be logged
|
||||
///
|
||||
virtual void setInError( const QString& errorMsg) override;
|
||||
void setInError( const QString& errorMsg) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
///
|
||||
/// @return True,if on success
|
||||
///
|
||||
bool tryOpen(const int delayAfterConnect_ms);
|
||||
bool tryOpen(int delayAfterConnect_ms);
|
||||
|
||||
/// Try to auto-discover device name?
|
||||
bool _isAutoDeviceName;
|
||||
|
@@ -34,7 +34,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICEAPA102_H
|
||||
|
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
const int SPI_BYTES_PER_COLOUR;
|
||||
const int SPI_FRAME_END_LATCH_BYTES;
|
||||
|
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -49,7 +49,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICELPD6803_H
|
||||
|
@@ -103,7 +103,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICELPD8806_H
|
||||
|
@@ -32,7 +32,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -40,7 +40,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
///
|
||||
/// Calculates the required checksum for one LED
|
||||
|
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
RGBW::WhiteAlgorithm _whiteAlgorithm;
|
||||
|
||||
|
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
const int SPI_BYTES_PER_COLOUR;
|
||||
const int SPI_BYTES_WAIT_TIME;
|
||||
|
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
};
|
||||
|
||||
#endif // LEDEVICEWS2801_H
|
||||
|
@@ -33,7 +33,7 @@ private:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -41,7 +41,7 @@ private:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
const int SPI_BYTES_PER_COLOUR;
|
||||
const int SPI_FRAME_END_LATCH_BYTES;
|
||||
|
@@ -22,26 +22,26 @@ public:
|
||||
///
|
||||
/// @param deviceConfig the json device config
|
||||
/// @return true if success
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// Destructor of the LedDevice; closes the output device if it is open
|
||||
///
|
||||
virtual ~ProviderSpi() override;
|
||||
~ProviderSpi() override;
|
||||
|
||||
///
|
||||
/// Opens and configures the output device
|
||||
///
|
||||
/// @return Zero on succes else negative
|
||||
///
|
||||
int open() override;
|
||||
int open() override;
|
||||
|
||||
public slots:
|
||||
///
|
||||
/// Closes the output device.
|
||||
/// Includes switching-off the device and stopping refreshes
|
||||
///
|
||||
virtual int close() override;
|
||||
int close() override;
|
||||
|
||||
protected:
|
||||
///
|
||||
|
@@ -23,7 +23,7 @@ public:
|
||||
///
|
||||
explicit LedDeviceTinkerforge(const QJsonObject &deviceConfig);
|
||||
|
||||
virtual ~LedDeviceTinkerforge() override;
|
||||
~LedDeviceTinkerforge() override;
|
||||
|
||||
///
|
||||
/// @brief Constructs the LED-device
|
||||
@@ -40,14 +40,14 @@ protected:
|
||||
/// @param[in] deviceConfig the JSON device configuration
|
||||
/// @return True, if success
|
||||
///
|
||||
virtual bool init(const QJsonObject &deviceConfig) override;
|
||||
bool init(const QJsonObject &deviceConfig) override;
|
||||
|
||||
///
|
||||
/// @brief Opens a connection to the master bricklet and the led strip bricklet.
|
||||
///
|
||||
/// @return Zero on success (i.e. device is ready), else negative
|
||||
///
|
||||
virtual int open() override;
|
||||
int open() override;
|
||||
|
||||
///
|
||||
/// @brief Writes the RGB-Color values to the LEDs.
|
||||
@@ -55,7 +55,7 @@ protected:
|
||||
/// @param[in] ledValues The RGB-color per LED
|
||||
/// @return Zero on success, else negative
|
||||
///
|
||||
virtual int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
int write(const std::vector<ColorRgb> & ledValues) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -49,7 +49,7 @@ void SSDPDiscover::searchForService(const QString& st)
|
||||
sendSearch(st);
|
||||
}
|
||||
|
||||
const QString SSDPDiscover::getFirstService(const searchType& type, const QString& st, int timeout_ms)
|
||||
QString SSDPDiscover::getFirstService(const searchType& type, const QString& st, int timeout_ms)
|
||||
{
|
||||
_searchTarget = st;
|
||||
_services.clear();
|
||||
@@ -296,11 +296,11 @@ int SSDPDiscover::discoverServices(const QString& searchTarget, const QString& k
|
||||
return rc;
|
||||
}
|
||||
|
||||
QJsonArray SSDPDiscover::getServicesDiscoveredJson()
|
||||
QJsonArray SSDPDiscover::getServicesDiscoveredJson() const
|
||||
{
|
||||
QJsonArray result;
|
||||
|
||||
QMap<QString, SSDPService>::iterator i;
|
||||
QMap<QString, SSDPService>::const_iterator i;
|
||||
for (i = _services.begin(); i != _services.end(); ++i)
|
||||
{
|
||||
//Debug(_log, "Device discovered at [%s]", QSTRING_CSTR( i.key() ));
|
||||
@@ -338,7 +338,7 @@ QJsonArray SSDPDiscover::getServicesDiscoveredJson()
|
||||
}
|
||||
|
||||
QJsonObject objOther;
|
||||
QMap <QString,QString>::iterator o;
|
||||
QMap <QString,QString>::const_iterator o;
|
||||
for (o = i.value().otherHeaders.begin(); o != i.value().otherHeaders.end(); ++o)
|
||||
{
|
||||
objOther.insert(o.key().toLower(), o.value());
|
||||
|
@@ -10,13 +10,13 @@
|
||||
|
||||
namespace FileUtils {
|
||||
|
||||
QString getBaseName(QString sourceFile)
|
||||
QString getBaseName(const QString& sourceFile)
|
||||
{
|
||||
QFileInfo fi(sourceFile);
|
||||
return fi.fileName();
|
||||
}
|
||||
|
||||
QString getDirName(QString sourceFile)
|
||||
QString getDirName(const QString& sourceFile)
|
||||
{
|
||||
QFileInfo fi(sourceFile);
|
||||
return fi.path();
|
||||
|
@@ -114,7 +114,7 @@ Logger::LogLevel Logger::getLogLevel(const QString & name)
|
||||
return static_cast<Logger::LogLevel>(int(GLOBAL_MIN_LOG_LEVEL));
|
||||
}
|
||||
|
||||
Logger* log = Logger::getInstance(name);
|
||||
const Logger* log = Logger::getInstance(name);
|
||||
return log->getMinLevel();
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,7 @@ NetOrigin::NetOrigin(QObject* parent, Logger* log)
|
||||
NetOrigin::instance = this;
|
||||
}
|
||||
|
||||
bool NetOrigin::accessAllowed(const QHostAddress& address, const QHostAddress& local)
|
||||
bool NetOrigin::accessAllowed(const QHostAddress& address, const QHostAddress& local) const
|
||||
{
|
||||
if(_internetAccessAllowed)
|
||||
return true;
|
||||
@@ -29,7 +29,7 @@ bool NetOrigin::accessAllowed(const QHostAddress& address, const QHostAddress& l
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetOrigin::isLocalAddress(const QHostAddress& address, const QHostAddress& local)
|
||||
bool NetOrigin::isLocalAddress(const QHostAddress& address, const QHostAddress& local) const
|
||||
{
|
||||
if(address.protocol() == QAbstractSocket::IPv4Protocol)
|
||||
{
|
||||
|
@@ -6,7 +6,7 @@ namespace Process {
|
||||
|
||||
void restartHyperion(bool asNewProcess){}
|
||||
|
||||
QByteArray command_exec(QString /*cmd*/, QByteArray /*data*/)
|
||||
QByteArray command_exec(const QString& /*cmd*/, const QByteArray& /*data*/)
|
||||
{
|
||||
return QSTRING_CSTR(QString());
|
||||
}
|
||||
@@ -48,7 +48,7 @@ void restartHyperion(bool asNewProcess)
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
|
||||
QByteArray command_exec(QString cmd, QByteArray data)
|
||||
QByteArray command_exec(const QString& cmd, const QByteArray& data)
|
||||
{
|
||||
char buffer[128];
|
||||
QString result;
|
||||
|
@@ -43,7 +43,7 @@ void Profiler::initLogger()
|
||||
_logger = Logger::getInstance("PROFILER", Logger::DEBUG);
|
||||
}
|
||||
|
||||
void Profiler::TimerStart(const QString timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
void Profiler::TimerStart(const QString& timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
{
|
||||
std::pair<std::map<QString,StopWatchItem>::iterator,bool> ret;
|
||||
Profiler::initLogger();
|
||||
@@ -71,7 +71,7 @@ void Profiler::TimerStart(const QString timerName, const char* sourceFile, const
|
||||
}
|
||||
|
||||
|
||||
void Profiler::TimerGetTime(const QString timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
void Profiler::TimerGetTime(const QString& timerName, const char* sourceFile, const char* func, unsigned int line)
|
||||
{
|
||||
std::map<QString,StopWatchItem>::iterator ret = GlobalProfilerMap.find(timerName);
|
||||
Profiler::initLogger();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace RGBW {
|
||||
|
||||
WhiteAlgorithm stringToWhiteAlgorithm(QString str)
|
||||
WhiteAlgorithm stringToWhiteAlgorithm(const QString& str)
|
||||
{
|
||||
if (str == "subtract_minimum") return WhiteAlgorithm::SUBTRACT_MINIMUM;
|
||||
if (str == "sub_min_warm_adjust") return WhiteAlgorithm::SUB_MIN_WARM_ADJUST;
|
||||
|
@@ -166,7 +166,7 @@ void QJsonSchemaChecker::setMessage(const QString & message)
|
||||
_messages.append(_currentPath.join("") +": "+message);
|
||||
}
|
||||
|
||||
const QStringList & QJsonSchemaChecker::getMessages() const
|
||||
QStringList QJsonSchemaChecker::getMessages() const
|
||||
{
|
||||
return _messages;
|
||||
}
|
||||
|
@@ -10,19 +10,20 @@
|
||||
#include "QtHttpReply.h"
|
||||
#include "QtHttpRequest.h"
|
||||
|
||||
class CgiHandler : public QObject {
|
||||
class CgiHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CgiHandler (QObject * parent = NULL);
|
||||
CgiHandler(QObject * parent = nullptr);
|
||||
|
||||
void setBaseUrl(const QString& url);
|
||||
void exec(const QStringList & args,QtHttpRequest * request, QtHttpReply * reply);
|
||||
void exec(const QStringList & args, QtHttpRequest * request, QtHttpReply * reply);
|
||||
|
||||
private:
|
||||
// CGI commands
|
||||
void cmd_cfg_jsonserver();
|
||||
void cmd_runscript ();
|
||||
void cmd_runscript();
|
||||
|
||||
QtHttpReply * _reply;
|
||||
QtHttpRequest * _request;
|
||||
|
@@ -24,7 +24,7 @@ class QtHttpServerWrapper : public QTcpServer
|
||||
|
||||
public:
|
||||
explicit QtHttpServerWrapper (QObject * parent = Q_NULLPTR);
|
||||
virtual ~QtHttpServerWrapper (void);
|
||||
~QtHttpServerWrapper() override;
|
||||
|
||||
void setUseSecure (const bool ssl = true);
|
||||
|
||||
|
@@ -11,12 +11,13 @@
|
||||
|
||||
#include <utils/Logger.h>
|
||||
|
||||
class StaticFileServing : public QObject {
|
||||
class StaticFileServing : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StaticFileServing (QObject * parent = nullptr);
|
||||
virtual ~StaticFileServing ();
|
||||
explicit StaticFileServing (QObject * parent = nullptr);
|
||||
~StaticFileServing() override;
|
||||
|
||||
///
|
||||
/// @brief Overwrite current base url
|
||||
@@ -29,7 +30,7 @@ public:
|
||||
void setSSDPDescription(const QString& desc);
|
||||
|
||||
public slots:
|
||||
void onRequestNeedsReply (QtHttpRequest * request, QtHttpReply * reply);
|
||||
void onRequestNeedsReply (QtHttpRequest * request, QtHttpReply * reply);
|
||||
|
||||
private:
|
||||
QString _baseUrl;
|
||||
|
@@ -9,7 +9,8 @@ class QtHttpRequest;
|
||||
class Hyperion;
|
||||
class JsonAPI;
|
||||
|
||||
class WebSocketClient : public QObject {
|
||||
class WebSocketClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
WebSocketClient(QtHttpRequest* request, QTcpSocket* sock, bool localConnection, QObject* parent);
|
||||
|
Reference in New Issue
Block a user