implemented bare providerudp constructor and made h801 use it

This commit is contained in:
Rick van Hattem
2016-09-22 00:18:46 +02:00
parent 37130f9c9b
commit ad785b9eba
3 changed files with 15 additions and 4 deletions

View File

@@ -16,11 +16,16 @@
#include "ProviderUdp.h"
ProviderUdp::ProviderUdp(const Json::Value &deviceConfig)
: ProviderUdp()
{
setConfig(deviceConfig);
}
ProviderUdp::ProviderUdp()
: LedDevice()
, _LatchTime_ns(-1)
, _port(0)
{
setConfig(deviceConfig);
_udpSocket = new QUdpSocket();
}
@@ -49,7 +54,7 @@ bool ProviderUdp::setConfig(const Json::Value &deviceConfig, int defaultPort, st
Debug( _log, "Successfully parsed %s as a hostname.", deviceConfig["host"].asString().c_str());
_address = info.addresses().first();
}
_port = deviceConfig.get("port", defaultPort).asUInt();
if ( _port<=0 || _port > 65535)
{