Permalink
Browse files

First version of nodes using the default interface. Need to rewrite i…

…t so we pass in an Interface instead
  • Loading branch information...
peternewman committed Aug 21, 2018
1 parent 3c06bfc commit 8b066b05fba394fd7e1572fcafdfcc8beeb8b4e6
@@ -94,6 +94,7 @@ bool ArtNetDevice::StartHook() {
options.include_loopback = m_preferences->GetValueAsBool(K_LOOPBACK_KEY);
if (!picker->ChooseInterface(&iface,
m_preferences->GetValue(K_IP_KEY),
m_plugin_adaptor->DefaultIPOrInterfaceName(),
options)) {
OLA_INFO << "Failed to find an interface";
return false;
@@ -72,7 +72,11 @@ E131Device::E131Device(Plugin *owner,
* Start this device
*/
bool E131Device::StartHook() {
m_node.reset(new E131Node(m_plugin_adaptor, m_ip_addr, m_options, m_cid));
string ip_address = m_ip_addr;
if (ip_address.empty()) {
ip_address = m_plugin_adaptor->DefaultIPOrInterfaceName();
}
m_node.reset(new E131Node(m_plugin_adaptor, ip_address, m_options, m_cid));

if (!m_node->Start()) {
m_node.reset();
@@ -38,6 +38,7 @@ namespace plugin {
namespace espnet {

using std::ostringstream;
using std::string;

const char EspNetDevice::ESPNET_DEVICE_NAME[] = "ESP Net";
const char EspNetDevice::IP_KEY[] = "ip";
@@ -60,7 +61,11 @@ EspNetDevice::EspNetDevice(Plugin *owner,
* Start this device
*/
bool EspNetDevice::StartHook() {
m_node = new EspNetNode(m_preferences->GetValue(IP_KEY));
string ip_address = m_preferences->GetValue(IP_KEY);
if (ip_address.empty()) {
ip_address = m_plugin_adaptor->DefaultIPOrInterfaceName();
}
m_node = new EspNetNode(ip_address);
m_node->SetName(m_preferences->GetValue(NODE_NAME_KEY));
m_node->SetType(ESPNET_NODE_TYPE_IO);

@@ -19,6 +19,7 @@
*/

#include <sstream>
#include <string>
#include <vector>

#include "ola/Logging.h"
@@ -36,6 +37,7 @@ namespace plugin {
namespace pathport {

using std::ostringstream;
using std::string;
using std::vector;

const char PathportDevice::K_DEFAULT_NODE_NAME[] = "ola-Pathport";
@@ -81,7 +83,11 @@ bool PathportDevice::StartHook() {
dscp = dscp << 2;
}

m_node = new PathportNode(m_preferences->GetValue(K_NODE_IP_KEY),
string ip_address = m_preferences->GetValue(K_NODE_IP_KEY);
if (ip_address.empty()) {
ip_address = m_plugin_adaptor->DefaultIPOrInterfaceName();
}
m_node = new PathportNode(ip_address,
product_id, dscp);

if (!m_node->Start()) {
@@ -64,7 +64,11 @@ bool SandNetDevice::StartHook() {
vector<ola::network::UDPSocket*> sockets;
vector<ola::network::UDPSocket*>::iterator iter;

m_node = new SandNetNode(m_preferences->GetValue(IP_KEY));
string ip_address = m_preferences->GetValue(IP_KEY);
if (ip_address.empty()) {
ip_address = m_plugin_adaptor->DefaultIPOrInterfaceName();
}
m_node = new SandNetNode(ip_address);
m_node->SetName(m_preferences->GetValue(NAME_KEY));

// setup the output ports (ie INTO sandnet)
@@ -35,6 +35,7 @@ namespace plugin {
namespace shownet {

using std::ostringstream;
using std::string;

const char ShowNetDevice::SHOWNET_DEVICE_NAME[] = "ShowNet";
const char ShowNetDevice::IP_KEY[] = "ip";
@@ -56,7 +57,11 @@ ShowNetDevice::ShowNetDevice(ola::Plugin *owner,
* Start this device
*/
bool ShowNetDevice::StartHook() {
m_node = new ShowNetNode(m_preferences->GetValue(IP_KEY));
string ip_address = m_preferences->GetValue(IP_KEY);
if (ip_address.empty()) {
ip_address = m_plugin_adaptor->DefaultIPOrInterfaceName();
}
m_node = new ShowNetNode(ip_address);
m_node->SetName(m_preferences->GetValue("name"));

if (!m_node->Start()) {

0 comments on commit 8b066b0

Please sign in to comment.