Improve UDP-Error handling

This commit is contained in:
LordGrey
2020-08-09 17:43:23 +02:00
parent 4099d12d9a
commit 16353a5906
2 changed files with 38 additions and 34 deletions

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
@@ -61,12 +61,12 @@ protected:
///
/// @return Zero on success, else negative
///
int writeBytes(unsigned size, const uint8_t *data);
int writeBytes(const unsigned size, const uint8_t *data);
///
QUdpSocket * _udpSocket;
QHostAddress _address;
ushort _port;
quint16 _port;
QString _defaultHost;
};