21 #ifndef PLUGINS_SANDNET_SANDNETNODE_H_ 22 #define PLUGINS_SANDNET_SANDNETNODE_H_ 31 #include "ola/network/InterfacePicker.h" 32 #include "ola/network/Socket.h" 34 #include "plugins/sandnet/SandNetPackets.h" 44 SANDNET_PORT_MODE_DISABLED,
45 SANDNET_PORT_MODE_OUT,
47 SANDNET_PORT_MODE_MOUT,
51 explicit SandNetNode(
const std::string &preferred_ip);
58 void SetName(
const std::string &name) {
63 std::vector<ola::network::UDPSocket*> GetSockets();
66 bool SetHandler(uint8_t group,
70 bool RemoveHandler(uint8_t group, uint8_t universe);
72 bool SetPortParameters(uint8_t port_id, sandnet_port_type type,
73 uint8_t group, uint8_t universe);
74 bool SendAdvertisement();
75 bool SendDMX(uint8_t port_id,
const DmxBuffer &buffer);
81 sandnet_port_type type;
89 typedef std::pair<uint8_t, uint8_t> group_universe_pair;
90 typedef std::map<group_universe_pair, universe_handler> universe_handlers;
94 bool HandleCompressedDMX(
const sandnet_compressed_dmx &dmx_packet,
97 bool HandleDMX(
const sandnet_dmx &dmx_packet,
99 bool SendUncompressedDMX(uint8_t port_id,
const DmxBuffer &buffer);
100 bool SendPacket(
const sandnet_packet &packet,
102 bool is_control =
false);
105 std::string m_node_name;
106 std::string m_preferred_ip;
108 sandnet_port m_ports[SANDNET_MAX_PORTS];
109 universe_handlers m_handlers;
117 static const uint16_t CONTROL_PORT;
118 static const uint16_t DATA_PORT;
119 static const char CONTROL_ADDRESS[];
120 static const char DATA_ADDRESS[];
121 static const char DEFAULT_NODE_NAME[];
122 static const uint32_t FIRMWARE_VERSION = 0x00050501;
127 #endif // PLUGINS_SANDNET_SANDNETNODE_H_
Encode / Decode DMX data using Run Length Encoding
Definition: RunLengthEncoder.h:39
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
Encode / Decode DMX data using Run Length Encoding
A class used to hold a single universe of DMX data.
Definition: Interface.h:35
Represents an IPv4 Address.
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
Definition: SandNetNode.h:41
An IPv4 SocketAddress.
Definition: SocketAddress.h:78