21 #ifndef PLUGINS_SHOWNET_SHOWNETNODE_H_
22 #define PLUGINS_SHOWNET_SHOWNETNODE_H_
29 #include "ola/network/InterfacePicker.h"
30 #include "ola/network/Socket.h"
31 #include "plugins/shownet/ShowNetPackets.h"
39 explicit ShowNetNode(
const std::string &ip_address);
44 void SetName(
const std::string &name);
47 bool SetHandler(
unsigned int universe,
50 bool RemoveHandler(
unsigned int universe);
59 static const uint16_t SHOWNET_MAX_UNIVERSES = 8;
61 friend class ShowNetNodeTest;
70 uint16_t m_packet_count;
71 std::string m_node_name;
72 std::string m_preferred_ip;
73 std::map<unsigned int, universe_handler> m_handlers;
82 unsigned int universe,
85 inline uint8_t ShortGetHigh(uint16_t x)
const {
return (0xff00 & x) >> 8; }
86 inline uint8_t ShortGetLow(uint16_t x)
const {
return 0x00ff & x; }
88 static const uint16_t SHOWNET_PORT = 2501;
89 static const uint8_t SHOWNET_ID_HIGH = 0x80;
90 static const uint8_t SHOWNET_ID_LOW = 0x8f;
91 static const int MAGIC_INDEX_OFFSET = 11;
96 #endif // PLUGINS_SHOWNET_SHOWNETNODE_H_