Const correctness, override keyword, a bunch of stuff..

This commit is contained in:
Murat
2020-08-08 23:12:43 +02:00
parent 4099d12d9a
commit 4a688b932a
144 changed files with 622 additions and 566 deletions

View File

@@ -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:

View File

@@ -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() )
{

View File

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

View File

@@ -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');

View File

@@ -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:

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

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

View File

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

View File

@@ -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;

View File

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

View File

@@ -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);

View File

@@ -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:

View File

@@ -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;

View File

@@ -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:

View File

@@ -16,8 +16,7 @@
class httpResponse
{
public:
explicit httpResponse() {}
httpResponse() {}
bool error() const { return _hasError;}
void setError(bool hasError) { _hasError = hasError; }

View File

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

View File

@@ -182,7 +182,7 @@ void ProviderUdpSSL::closeSSLConnection()
}
}
const int *ProviderUdpSSL::getCiphersuites()
const int *ProviderUdpSSL::getCiphersuites() const
{
return mbedtls_ssl_list_ciphersuites();
}

View File

@@ -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");