21 #ifndef PLUGINS_ESPNET_ESPNETNODE_H_ 22 #define PLUGINS_ESPNET_ESPNETNODE_H_ 30 #include "ola/network/Interface.h" 31 #include "ola/network/Socket.h" 32 #include "plugins/espnet/EspNetPackets.h" 33 #include "plugins/espnet/RunLengthDecoder.h" 41 ESPNET_NODE_TYPE_SINGLE_OUT = 0x0001,
42 ESPNET_NODE_TYPE_SINGLE_IN = 0x0002,
43 ESPNET_NODE_TYPE_RS232 = 0x0060,
44 ESPNET_NODE_TYPE_IO = 0x0061,
45 ESPNET_NODE_TYPE_LONWORKS = 0x0100,
48 enum { ESPNET_MAX_UNIVERSES = 512 };
52 explicit EspNetNode(
const std::string &ip_address);
62 void SetName(
const std::string &name) { m_node_name = name; }
63 void SetType(espnet_node_type type) { m_type = type; }
64 void SetUniverse(uint8_t universe) { m_universe = universe; }
71 bool SetHandler(uint8_t universe,
DmxBuffer *buffer,
73 bool RemoveHandler(uint8_t universe);
76 bool SendPoll(
bool full_poll =
false);
86 void HandlePoll(
const espnet_poll_t &poll, ssize_t length,
88 void HandleReply(
const espnet_poll_reply_t &reply,
91 void HandleAck(
const espnet_ack_t &ack, ssize_t length,
93 void HandleData(
const espnet_data_t &data, ssize_t length,
113 espnet_node_type m_type;
114 std::string m_node_name;
115 std::string m_preferred_ip;
116 std::map<uint8_t, universe_handler> m_handlers;
121 static const char NODE_NAME[];
122 static const uint8_t DEFAULT_OPTIONS = 0;
123 static const uint8_t DEFAULT_TOS = 0;
124 static const uint8_t DEFAULT_TTL = 4;
125 static const uint8_t FIRMWARE_VERSION = 1;
126 static const uint8_t SWITCH_SETTINGS = 0;
127 static const uint16_t ESPNET_PORT = 3333;
128 static const uint8_t DATA_RAW = 1;
129 static const uint8_t DATA_PAIRS = 2;
130 static const uint8_t DATA_RLE = 4;
131 static const uint8_t START_CODE = 0;
138 #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:50