mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Add "enable" to forwarder, fix udp listener (#91)
* Add "enable" to forwarder fix udp listener - address and port parsing was broken * updated example configs * updated example config with comments
This commit is contained in:
parent
12cae1e634
commit
ca795d883e
@ -252,12 +252,14 @@
|
|||||||
|
|
||||||
/// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts
|
/// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts
|
||||||
/// 'proto' is mostly used for video streams and 'json' for effects
|
/// 'proto' is mostly used for video streams and 'json' for effects
|
||||||
|
/// * enable : Enable or disable the forwarder (true/false)
|
||||||
/// * proto : Proto server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19447"] or more instances to forward ["127.0.0.1:19447","192.168.0.24:19449"]
|
/// * proto : Proto server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19447"] or more instances to forward ["127.0.0.1:19447","192.168.0.24:19449"]
|
||||||
/// * json : Json server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19446"] or more instances to forward ["127.0.0.1:19446","192.168.0.24:19448"]
|
/// * json : Json server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19446"] or more instances to forward ["127.0.0.1:19446","192.168.0.24:19448"]
|
||||||
/// HINT:If you redirect to "127.0.0.1" (localhost) you could start a second hyperion with another device/led config!
|
/// HINT:If you redirect to "127.0.0.1" (localhost) you could start a second hyperion with another device/led config!
|
||||||
/// Be sure your client(s) is/are listening on the configured ports. The second Hyperion (if used) also needs to be configured! (HyperCon -> External -> Json Server/Proto Server)
|
/// Be sure your client(s) is/are listening on the configured ports. The second Hyperion (if used) also needs to be configured! (HyperCon -> External -> Json Server/Proto Server)
|
||||||
"forwarder" :
|
"forwarder" :
|
||||||
{
|
{
|
||||||
|
"enable" : false,
|
||||||
"proto" : ["127.0.0.1:19447"],
|
"proto" : ["127.0.0.1:19447"],
|
||||||
"json" : ["127.0.0.1:19446"]
|
"json" : ["127.0.0.1:19446"]
|
||||||
},
|
},
|
||||||
|
@ -149,6 +149,7 @@
|
|||||||
|
|
||||||
"forwarder" :
|
"forwarder" :
|
||||||
{
|
{
|
||||||
|
"enable" : false,
|
||||||
"json" : ["127.0.0.1:19446"],
|
"json" : ["127.0.0.1:19446"],
|
||||||
"proto" : ["127.0.0.1:19447"]
|
"proto" : ["127.0.0.1:19447"]
|
||||||
},
|
},
|
||||||
|
@ -522,7 +522,7 @@ LedDevice * Hyperion::createColorSmoothing(const Json::Value & smoothingConfig,
|
|||||||
MessageForwarder * Hyperion::createMessageForwarder(const Json::Value & forwarderConfig)
|
MessageForwarder * Hyperion::createMessageForwarder(const Json::Value & forwarderConfig)
|
||||||
{
|
{
|
||||||
MessageForwarder * forwarder = new MessageForwarder();
|
MessageForwarder * forwarder = new MessageForwarder();
|
||||||
if ( ! forwarderConfig.isNull() )
|
if ( ( ! forwarderConfig.isNull() ) && ( forwarderConfig.get("enable", true).asBool() ) )
|
||||||
{
|
{
|
||||||
if ( ! forwarderConfig["json"].isNull() && forwarderConfig["json"].isArray() )
|
if ( ! forwarderConfig["json"].isNull() && forwarderConfig["json"].isArray() )
|
||||||
{
|
{
|
||||||
|
@ -20,10 +20,11 @@ UDPListener::UDPListener(const int priority, const int timeout, const std::strin
|
|||||||
_ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb::BLACK),
|
_ledColors(Hyperion::getInstance()->getLedCount(), ColorRgb::BLACK),
|
||||||
_log(Logger::getInstance("UDPLISTENER")),
|
_log(Logger::getInstance("UDPLISTENER")),
|
||||||
_isActive(false),
|
_isActive(false),
|
||||||
|
_listenPort(listenPort),
|
||||||
_bondage(shared ? QAbstractSocket::ShareAddress : QAbstractSocket::DefaultForPlatform)
|
_bondage(shared ? QAbstractSocket::ShareAddress : QAbstractSocket::DefaultForPlatform)
|
||||||
{
|
{
|
||||||
_server = new QUdpSocket(this);
|
_server = new QUdpSocket(this);
|
||||||
QHostAddress listenAddress = address.empty()
|
_listenAddress = address.empty()
|
||||||
? QHostAddress::AnyIPv4
|
? QHostAddress::AnyIPv4
|
||||||
: QHostAddress( QString::fromStdString(address) );
|
: QHostAddress( QString::fromStdString(address) );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user