21 #ifndef PLUGINS_ESPNET_ESPNETNODE_H_
22 #define PLUGINS_ESPNET_ESPNETNODE_H_
28 #include "ola/network/IPV4Address.h"
29 #include "ola/network/Interface.h"
30 #include "ola/network/Socket.h"
31 #include "plugins/espnet/EspNetPackets.h"
32 #include "plugins/espnet/RunLengthDecoder.h"
42 ESPNET_NODE_TYPE_SINGLE_OUT = 0x0001,
43 ESPNET_NODE_TYPE_SINGLE_IN = 0x0002,
44 ESPNET_NODE_TYPE_RS232 = 0x0060,
45 ESPNET_NODE_TYPE_IO = 0x0061,
46 ESPNET_NODE_TYPE_LONWORKS = 0x0100,
49 enum { ESPNET_MAX_UNIVERSES = 512 };
65 void SetName(
const string &name) { m_node_name = name; }
66 void SetType(espnet_node_type type) { m_type = type; }
67 void SetUniverse(uint8_t universe) { m_universe = universe; }
74 bool SetHandler(uint8_t universe,
DmxBuffer *buffer,
76 bool RemoveHandler(uint8_t universe);
79 bool SendPoll(
bool full_poll =
false);
101 bool SendEspPoll(
const IPV4Address &dst,
bool full);
118 espnet_node_type m_type;
120 string m_preferred_ip;
121 std::map<uint8_t, universe_handler> m_handlers;
126 static const char NODE_NAME[];
127 static const uint8_t DEFAULT_OPTIONS = 0;
128 static const uint8_t DEFAULT_TOS = 0;
129 static const uint8_t DEFAULT_TTL = 4;
130 static const uint8_t FIRMWARE_VERSION = 1;
131 static const uint8_t SWITCH_SETTINGS = 0;
132 static const uint16_t ESPNET_PORT = 3333;
133 static const uint8_t DATA_RAW = 1;
134 static const uint8_t DATA_PAIRS = 2;
135 static const uint8_t DATA_RLE = 4;
136 static const uint8_t START_CODE = 0;
141 #endif // PLUGINS_ESPNET_ESPNETNODE_H_