21 #ifndef PLUGINS_ESPNET_ESPNETNODE_H_
22 #define PLUGINS_ESPNET_ESPNETNODE_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"
40 ESPNET_NODE_TYPE_SINGLE_OUT = 0x0001,
41 ESPNET_NODE_TYPE_SINGLE_IN = 0x0002,
42 ESPNET_NODE_TYPE_RS232 = 0x0060,
43 ESPNET_NODE_TYPE_IO = 0x0061,
44 ESPNET_NODE_TYPE_LONWORKS = 0x0100,
47 enum { ESPNET_MAX_UNIVERSES = 512 };
51 explicit EspNetNode(
const std::string &ip_address);
61 void SetName(
const std::string &name) { m_node_name = name; }
62 void SetType(espnet_node_type type) { m_type = type; }
63 void SetUniverse(uint8_t universe) { m_universe = universe; }
70 bool SetHandler(uint8_t universe,
DmxBuffer *buffer,
72 bool RemoveHandler(uint8_t universe);
75 bool SendPoll(
bool full_poll =
false);
114 espnet_node_type m_type;
115 std::string m_node_name;
116 std::string m_preferred_ip;
117 std::map<uint8_t, universe_handler> m_handlers;
122 static const char NODE_NAME[];
123 static const uint8_t DEFAULT_OPTIONS = 0;
124 static const uint8_t DEFAULT_TOS = 0;
125 static const uint8_t DEFAULT_TTL = 4;
126 static const uint8_t FIRMWARE_VERSION = 1;
127 static const uint8_t SWITCH_SETTINGS = 0;
128 static const uint16_t ESPNET_PORT = 3333;
129 static const uint8_t DATA_RAW = 1;
130 static const uint8_t DATA_PAIRS = 2;
131 static const uint8_t DATA_RLE = 4;
132 static const uint8_t START_CODE = 0;
137 #endif // PLUGINS_ESPNET_ESPNETNODE_H_