New builtin udp listener (#18)

* Fixed compile error when no grabbers are defined

* Remove stupid avahi warning...

* Started on the new integrated UDP listener to replace the python effect.

Cloned boblight server and rename it to be UDP listener
It compiles!, It starts! it seems to work as a second boblight protocol server...

* moving from the exsting TCP to UDP.
i can catch packets now.. need to consider ditching the connection handling

* It kinda works right now.
UDP packets are received, led data is sent and hyperion displays them.
.... for a moment before going back to what it was doing

* It works!

looks like the default priority of 900 was fighting with something else that was also 900

commented out some udp packet debugging

* oops, forgot to add the changes the the previous commit

* resolving merge conflicts
This commit is contained in:
penfold42
2016-06-20 16:38:12 +10:00
committed by brindosch
parent 065e65b8e0
commit a23735d1ef
7 changed files with 196 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ target_link_libraries(hyperiond
effectengine
jsonserver
boblightserver
udplistener
protoserver
webconfig
bonjour

View File

@@ -17,6 +17,7 @@
#include <jsonserver/JsonServer.h>
#include <protoserver/ProtoServer.h>
#include <boblightserver/BoblightServer.h>
#include <udplistener/UDPListener.h>
#include "hyperiond.h"
@@ -28,6 +29,7 @@ HyperionDaemon::HyperionDaemon(std::string configFile, QObject *parent)
, _jsonServer(nullptr)
, _protoServer(nullptr)
, _boblightServer(nullptr)
, _udpListener(nullptr)
, _v4l2Grabber(nullptr)
, _dispmanx(nullptr)
, _amlGrabber(nullptr)
@@ -51,6 +53,7 @@ HyperionDaemon::~HyperionDaemon()
delete _jsonServer;
delete _protoServer;
delete _boblightServer;
delete _udpListener;
delete _webConfig;
}
@@ -217,6 +220,18 @@ void HyperionDaemon::startNetworkServices()
Info(_log, "Boblight server created and started on port %d", _boblightServer->getPort());
}
// Create UDP listener if configuration is present
if (_config.isMember("udpListener"))
{
const Json::Value & udpListenerConfig = _config["udpListener"];
_udpListener = new UDPListener(hyperion,
udpListenerConfig.get("priority",890).asInt(),
udpListenerConfig.get("timeout",10000).asInt(),
udpListenerConfig["port"].asUInt()
);
Info(_log, "UDP listener created and started on port %d", _udpListener->getPort());
}
// zeroconf
const Json::Value & deviceConfig = _config["device"];
const std::string deviceName = deviceConfig.get("name", "").asString();

View File

@@ -39,6 +39,7 @@
#include <protoserver/ProtoServer.h>
#include <boblightserver/BoblightServer.h>
#include <webconfig/WebConfig.h>
#include <udplistener/UDPListener.h>
class HyperionDaemon : public QObject
{
@@ -67,6 +68,7 @@ private:
JsonServer* _jsonServer;
ProtoServer* _protoServer;
BoblightServer* _boblightServer;
UDPListener* _udpListener;
V4L2Wrapper* _v4l2Grabber;
DispmanxWrapper* _dispmanx;
AmlogicWrapper* _amlGrabber;