OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
e131_protocol.hpp
1
2#pragma once
3#include <ossia/detail/config.hpp>
4#if defined(OSSIA_PROTOCOL_ARTNET)
5#include <ossia/network/sockets/udp_socket.hpp>
6#include <ossia/protocols/artnet/dmx_protocol_base.hpp>
7
8namespace ossia::net
9{
10// Implementation mostly based on https://github.com/hhromic/libe131
11
12class OSSIA_EXPORT e131_protocol final : public ossia::net::dmx_output_protocol_base
13{
14public:
15 static constexpr uint16_t default_port = 5568;
16 static constexpr uint8_t default_priority = 100;
17
18 e131_protocol(
19 ossia::net::network_context_ptr, const dmx_config& conf,
20 const ossia::net::outbound_socket_configuration& socket);
21
22 ~e131_protocol();
23
24 void set_device(ossia::net::device_base& dev) override;
25
26private:
27 void update_function();
28 ossia::net::udp_send_socket m_socket;
29};
30
31class OSSIA_EXPORT e131_input_protocol final : public ossia::net::dmx_input_protocol_base
32{
33public:
34 static constexpr uint16_t default_port = 5568;
35 static constexpr uint8_t default_priority = 100;
36
37 e131_input_protocol(
38 ossia::net::network_context_ptr, const dmx_config& conf,
39 const ossia::net::inbound_socket_configuration& socket);
40
41 ~e131_input_protocol();
42
43 void set_device(ossia::net::device_base& dev) override;
44
45private:
46 void on_packet(const char* bytes, int sz);
47
48 ossia::net::udp_receive_socket m_socket;
49};
50}
51#endif
Root of a device tree.
Definition ossia/network/base/device.hpp:58