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);
87 void HandlePoll(
const espnet_poll_t &poll, ssize_t length,
89 void HandleReply(
const espnet_poll_reply_t &reply,
92 void HandleAck(
const espnet_ack_t &ack, ssize_t length,
94 void HandleData(
const espnet_data_t &data, ssize_t length,
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_
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
A class used to hold a single universe of DMX data.
Definition: EspNetPackets.h:134
Represents a IPv4 Address.
Definition: IPV4Address.h:55
Definition: RunLengthDecoder.h:30
Definition: Interface.h:35
Represents an IPv4 Address.
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
Definition: EspNetNode.h:49