Open Lighting Architecture: plugins/artnet/ArtNetNode.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
ArtNetNode.h
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15 *
16 * ArtNetNode.h
17 * Header file for the ArtNetNodeImpl class
18 * Copyright (C) 2005 Simon Newton
19 */
20
21#ifndef PLUGINS_ARTNET_ARTNETNODE_H_
22#define PLUGINS_ARTNET_ARTNETNODE_H_
23
24#include <map>
25#include <memory>
26#include <string>
27#include <utility>
28#include <vector>
29
30#include "ola/Callback.h"
31#include "ola/Clock.h"
32#include "ola/DmxBuffer.h"
33#include "ola/network/IPV4Address.h"
34#include "ola/network/Interface.h"
35#include "ola/io/SelectServerInterface.h"
36#include "ola/network/Socket.h"
37#include "ola/rdm/QueueingRDMController.h"
38#include "ola/rdm/RDMCommand.h"
39#include "ola/rdm/RDMFrame.h"
40#include "ola/rdm/RDMControllerInterface.h"
41#include "ola/rdm/UIDSet.h"
42#include "ola/timecode/TimeCode.h"
43#include "plugins/artnet/ArtNetPackets.h"
44
45namespace ola {
46namespace plugin {
47namespace artnet {
48
49
50// The directions are the opposite from what OLA uses
51typedef enum {
52 ARTNET_INPUT_PORT, // sends ArtNet data
53 ARTNET_OUTPUT_PORT, // receives ArtNet data
54} artnet_port_type;
55
56typedef enum {
57 ARTNET_MERGE_HTP, // default
58 ARTNET_MERGE_LTP,
59} artnet_merge_mode;
60
61
62// This can be passed to SetPortUniverse to disable ports
63static const uint8_t ARTNET_DISABLE_PORT = 0xf0;
64
65 class ArtNetNodeOptions {
66 public:
67 ArtNetNodeOptions()
68 : always_broadcast(false),
69 use_limited_broadcast_address(false),
70 rdm_queue_size(20),
71 broadcast_threshold(30),
72 input_port_count(4) {
73 }
74
75 bool always_broadcast;
76 bool use_limited_broadcast_address;
77 unsigned int rdm_queue_size;
78 unsigned int broadcast_threshold;
79 uint8_t input_port_count;
80};
81
82
83 class ArtNetNodeImpl {
84 public:
92 ArtNetNodeImpl(const ola::network::Interface &iface,
93 ola::io::SelectServerInterface *ss,
94 const ArtNetNodeOptions &options,
95 ola::network::UDPSocketInterface *socket = NULL);
96
100 virtual ~ArtNetNodeImpl();
101
105 bool Start();
106
110 bool Stop();
111
128 bool EnterConfigurationMode();
129
135 bool ExitConfigurationMode();
136
137
138 // Various parameters to control the behaviour
143 bool SetShortName(const std::string &name);
144 std::string ShortName() const { return m_short_name; }
145
150 bool SetLongName(const std::string &name);
151 std::string LongName() const { return m_long_name; }
152
157 bool SetNetAddress(uint8_t net_address);
158 uint8_t NetAddress() const { return m_net_address; }
159
164 bool SetSubnetAddress(uint8_t subnet_address);
165 uint8_t SubnetAddress() const {
166 return m_output_ports[0].universe_address >> 4;
167 }
168
173 uint8_t InputPortCount() const;
174
178 bool SetInputPortUniverse(uint8_t port_id, uint8_t universe_id);
179
188 uint8_t GetInputPortUniverse(uint8_t port_id) const;
189
194 void DisableInputPort(uint8_t port_id);
195
202 bool InputPortState(uint8_t port_id) const;
203
209 bool SetOutputPortUniverse(uint8_t port_id, uint8_t universe_id);
210
216 uint8_t GetOutputPortUniverse(uint8_t port_id);
217
222 void DisableOutputPort(uint8_t port_id);
223
230 bool OutputPortState(uint8_t port_id) const;
231
232 void SetBroadcastThreshold(unsigned int threshold) {
233 m_broadcast_threshold = threshold;
234 }
235
241 bool SetMergeMode(uint8_t port_id, artnet_merge_mode merge_mode);
242
248 bool SendPoll();
249
250 // The following apply to Input Ports (those which send data)
257 bool SendDMX(uint8_t port_id, const ola::DmxBuffer &buffer);
258
267 void RunFullDiscovery(uint8_t port_id,
268 ola::rdm::RDMDiscoveryCallback *callback);
269
279 void RunIncrementalDiscovery(uint8_t port_id,
280 ola::rdm::RDMDiscoveryCallback *callback);
281
294 void SendRDMRequest(uint8_t port_id,
295 ola::rdm::RDMRequest *request,
296 ola::rdm::RDMCallback *on_complete);
297
304 bool SetUnsolicitedUIDSetHandler(
305 uint8_t port_id,
306 ola::Callback1<void, const ola::rdm::UIDSet&> *on_tod);
307
316 void GetSubscribedNodes(
317 uint8_t port_id,
318 std::vector<ola::network::IPV4Address> *node_addresses);
319
320 // The following apply to Output Ports (those which receive data);
328 bool SetDMXHandler(uint8_t port_id,
329 DmxBuffer *buffer,
330 ola::Callback0<void> *handler);
331
337 bool SendTod(uint8_t port_id, const ola::rdm::UIDSet &uid_set);
338
342 bool SetOutputPortRDMHandlers(
343 uint8_t port_id,
344 ola::Callback0<void> *on_discover,
345 ola::Callback0<void> *on_flush,
346 ola::Callback2<void,
347 ola::rdm::RDMRequest*,
348 ola::rdm::RDMCallback*> *on_rdm_request);
349
353 bool SendTimeCode(const ola::timecode::TimeCode &timecode);
354
355 private:
356 class InputPort;
357 typedef std::vector<InputPort*> InputPorts;
358
359 // map a uid to a IP address and the number of times we've missed a
360 // response.
361 typedef std::map<ola::rdm::UID,
362 std::pair<ola::network::IPV4Address, uint8_t> > uid_map;
363
364 enum { MAX_MERGE_SOURCES = 2 };
365
366 struct DMXSource {
367 DmxBuffer buffer;
368 TimeStamp timestamp;
369 ola::network::IPV4Address address;
370 };
371
372 // Output Ports receive ArtNet data
373 struct OutputPort {
374 uint8_t universe_address;
375 uint8_t sequence_number;
376 bool enabled;
377 artnet_merge_mode merge_mode;
378 bool is_merging;
379 DMXSource sources[MAX_MERGE_SOURCES];
380 DmxBuffer *buffer;
381 std::map<ola::rdm::UID, ola::network::IPV4Address> uid_map;
382 Callback0<void> *on_data;
383 Callback0<void> *on_discover;
384 Callback0<void> *on_flush;
385 ola::Callback2<void,
386 ola::rdm::RDMRequest*,
387 ola::rdm::RDMCallback*> *on_rdm_request;
388 };
389
390 bool m_running;
391 uint8_t m_net_address; // this is the 'net' portion of the Artnet address
392 bool m_send_reply_on_change;
393 std::string m_short_name;
394 std::string m_long_name;
395 unsigned int m_broadcast_threshold;
396 unsigned int m_unsolicited_replies;
397 ola::io::SelectServerInterface *m_ss;
398 bool m_always_broadcast;
399 bool m_use_limited_broadcast_address;
400
401 // The following keep track of "Configuration mode"
402 bool m_in_configuration_mode;
403 bool m_artpoll_required;
404 bool m_artpollreply_required;
405
406 InputPorts m_input_ports;
407 OutputPort m_output_ports[ARTNET_MAX_PORTS];
408 ola::network::Interface m_interface;
409 std::auto_ptr<ola::network::UDPSocketInterface> m_socket;
410
414 void SocketReady();
415
421 bool SendPollIfAllowed();
422
430 bool SendPollReplyIfRequired();
431
435 bool SendPollReply(const ola::network::IPV4Address &destination);
436
440 bool SendIPReply(const ola::network::IPV4Address &destination);
441
445 void HandlePacket(const ola::network::IPV4Address &source_address,
446 const artnet_packet &packet,
447 unsigned int packet_size);
448
452 void HandlePollPacket(const ola::network::IPV4Address &source_address,
453 const artnet_poll_t &packet,
454 unsigned int packet_size);
455
459 void HandleReplyPacket(const ola::network::IPV4Address &source_address,
460 const artnet_reply_t &packet,
461 unsigned int packet_size);
462
466 void HandleDataPacket(const ola::network::IPV4Address &source_address,
467 const artnet_dmx_t &packet,
468 unsigned int packet_size);
469
473 void HandleTodRequest(const ola::network::IPV4Address &source_address,
474 const artnet_todrequest_t &packet,
475 unsigned int packet_size);
476
480 void HandleTodData(const ola::network::IPV4Address &source_address,
481 const artnet_toddata_t &packet,
482 unsigned int packet_size);
483
487 void HandleTodControl(const ola::network::IPV4Address &source_address,
488 const artnet_todcontrol_t &packet,
489 unsigned int packet_size);
490
494 void HandleRdm(const ola::network::IPV4Address &source_address,
495 const artnet_rdm_t &packet,
496 unsigned int packet_size);
497
501 void RDMRequestCompletion(ola::network::IPV4Address destination,
502 uint8_t port_id,
503 uint8_t universe_address,
504 ola::rdm::RDMReply *reply);
505
515 void HandleRDMResponse(InputPort *port,
516 const ola::rdm::RDMFrame &rdm_data,
517 const ola::network::IPV4Address &source_address);
518
522 void HandleIPProgram(const ola::network::IPV4Address &source_address,
523 const artnet_ip_prog_t &packet,
524 unsigned int packet_size);
525
529 void PopulatePacketHeader(artnet_packet *packet, uint16_t op_code);
530
537 bool SendPacket(const artnet_packet &packet,
538 unsigned int size,
539 const ola::network::IPV4Address &destination);
540
545 void TimeoutRDMRequest(InputPort *port);
546
550 bool SendRDMCommand(const ola::rdm::RDMCommand &command,
551 const ola::network::IPV4Address &destination,
552 uint8_t universe);
553
557 void UpdatePortFromSource(OutputPort *port, const DMXSource &source);
558
562 bool CheckPacketVersion(const ola::network::IPV4Address &source_address,
563 const std::string &packet_type,
564 uint16_t version);
565
569 bool CheckPacketSize(const ola::network::IPV4Address &source_address,
570 const std::string &packet_type,
571 unsigned int actual_size,
572 unsigned int expected_size);
573
574 // methods for accessing Input & Output ports
578 InputPort *GetInputPort(uint8_t port_id, bool warn = true);
579
583 const InputPort *GetInputPort(uint8_t port_id) const;
584
588 InputPort *GetEnabledInputPort(uint8_t port_id, const std::string &action);
589
593 OutputPort *GetOutputPort(uint8_t port_id);
594
598 const OutputPort *GetOutputPort(uint8_t port_id) const;
599
603 OutputPort *GetEnabledOutputPort(uint8_t port_id, const std::string &action);
604
608 void UpdatePortFromTodPacket(InputPort *port,
609 const ola::network::IPV4Address &source_address,
610 const artnet_toddata_t &packet,
611 unsigned int packet_size);
612
616 void ReleaseDiscoveryLock(InputPort *port);
617
624 bool StartDiscoveryProcess(InputPort *port,
625 ola::rdm::RDMDiscoveryCallback *callback);
626
630 bool InitNetwork();
631
632 static const char ARTNET_ID[];
633 static const uint16_t ARTNET_PORT = 6454;
634 static const uint16_t OEM_CODE = 0x0431;
635 static const uint16_t ARTNET_VERSION = 14;
636 // after not receiving a PollReply after this many seconds we declare the
637 // node as dead. This is set to 3x the POLL_INTERVAL in ArtNetDevice.
638 static const uint8_t NODE_CODE = 0x00;
639 static const uint16_t MAX_UIDS_PER_UNIVERSE = 0xffff;
640 static const uint8_t RDM_VERSION = 0x01; // v1.0 standard baby!
641 static const uint8_t TOD_FLUSH_COMMAND = 0x01;
642 static const unsigned int MERGE_TIMEOUT = 10; // As per the spec
643 // seconds after which a node is marked as inactive for the dmx merging
644 static const unsigned int NODE_TIMEOUT = 31;
645 // mseconds we wait for a TodData packet before declaring a node missing
646 static const unsigned int RDM_TOD_TIMEOUT_MS = 4000;
647 // Number of missed TODs before we decide a UID has gone
648 static const unsigned int RDM_MISSED_TODDATA_LIMIT = 3;
649 // The maximum number of requests we'll allow in the queue. This is a per
650 // port (universe) limit.
651 static const unsigned int RDM_REQUEST_QUEUE_LIMIT = 100;
652 // How long to wait for a response to an RDM Request
653 static const unsigned int RDM_REQUEST_TIMEOUT_MS = 2000;
654
655 ArtNetNodeImpl(const ArtNetNodeImpl &) = delete;
656 const ArtNetNodeImpl &operator=(const ArtNetNodeImpl &) = delete;
657};
658
659
664 class ArtNetNodeImplRDMWrapper
665 : public ola::rdm::DiscoverableRDMControllerInterface {
666 public:
667 ArtNetNodeImplRDMWrapper(ArtNetNodeImpl *impl, uint8_t port_id):
668 m_impl(impl),
669 m_port_id(port_id) {
670 }
671 ~ArtNetNodeImplRDMWrapper() {}
672
673 void SendRDMRequest(ola::rdm::RDMRequest *request,
674 ola::rdm::RDMCallback *on_complete) {
675 m_impl->SendRDMRequest(m_port_id, request, on_complete);
676 }
677
678 void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback) {
679 m_impl->RunFullDiscovery(m_port_id, callback);
680 }
681
682 void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback) {
683 m_impl->RunIncrementalDiscovery(m_port_id, callback);
684 }
685
686 private:
687 ArtNetNodeImpl *m_impl;
688 uint8_t m_port_id;
689
690 ArtNetNodeImplRDMWrapper(const ArtNetNodeImplRDMWrapper &) = delete;
691 const ArtNetNodeImplRDMWrapper &operator=(const ArtNetNodeImplRDMWrapper &) = delete;
692};
693
694
698 class ArtNetNode {
699 public:
700 ArtNetNode(const ola::network::Interface &iface,
701 ola::io::SelectServerInterface *ss,
702 const ArtNetNodeOptions &options,
703 ola::network::UDPSocketInterface *socket = NULL);
704 virtual ~ArtNetNode();
705
706 bool Start() { return m_impl.Start(); }
707 bool Stop() { return m_impl.Stop(); }
708
709 bool EnterConfigurationMode() {
710 return m_impl.EnterConfigurationMode();
711 }
712 bool ExitConfigurationMode() {
713 return m_impl.ExitConfigurationMode();
714 }
715
716 // Various parameters to control the behaviour
717 bool SetShortName(const std::string &name) {
718 return m_impl.SetShortName(name);
719 }
720
721 std::string ShortName() const { return m_impl.ShortName(); }
722 bool SetLongName(const std::string &name) {
723 return m_impl.SetLongName(name);
724 }
725
726 std::string LongName() const { return m_impl.LongName(); }
727
728 uint8_t NetAddress() const { return m_impl.NetAddress(); }
729 bool SetNetAddress(uint8_t net_address) {
730 return m_impl.SetNetAddress(net_address);
731 }
732 bool SetSubnetAddress(uint8_t subnet_address) {
733 return m_impl.SetSubnetAddress(subnet_address);
734 }
735 uint8_t SubnetAddress() const {
736 return m_impl.SubnetAddress();
737 }
738
739 uint8_t InputPortCount() const {
740 return m_impl.InputPortCount();
741 }
742
743 bool SetInputPortUniverse(uint8_t port_id, uint8_t universe_id) {
744 return m_impl.SetInputPortUniverse(port_id, universe_id);
745 }
746 uint8_t GetInputPortUniverse(uint8_t port_id) const {
747 return m_impl.GetInputPortUniverse(port_id);
748 }
749 void DisableInputPort(uint8_t port_id) {
750 m_impl.DisableInputPort(port_id);
751 }
752 bool InputPortState(uint8_t port_id) const {
753 return m_impl.InputPortState(port_id);
754 }
755
756 bool SetOutputPortUniverse(uint8_t port_id, uint8_t universe_id) {
757 return m_impl.SetOutputPortUniverse(port_id, universe_id);
758 }
759 uint8_t GetOutputPortUniverse(uint8_t port_id) {
760 return m_impl.GetOutputPortUniverse(port_id);
761 }
762 void DisableOutputPort(uint8_t port_id) {
763 m_impl.DisableOutputPort(port_id);
764 }
765 bool OutputPortState(uint8_t port_id) const {
766 return m_impl.OutputPortState(port_id);
767 }
768
769 void SetBroadcastThreshold(unsigned int threshold) {
770 m_impl.SetBroadcastThreshold(threshold);
771 }
772
773 bool SetMergeMode(uint8_t port_id, artnet_merge_mode merge_mode) {
774 return m_impl.SetMergeMode(port_id, merge_mode);
775 }
776
777 // Poll, this should be called periodically if we're sending data.
778 bool SendPoll() {
779 return m_impl.SendPoll();
780 }
781
782 // The following apply to Input Ports (those which send data)
783 bool SendDMX(uint8_t port_id, const ola::DmxBuffer &buffer) {
784 return m_impl.SendDMX(port_id, buffer);
785 }
786
790 void RunFullDiscovery(uint8_t port_id,
791 ola::rdm::RDMDiscoveryCallback *callback);
792
796 void RunIncrementalDiscovery(uint8_t port_id,
797 ola::rdm::RDMDiscoveryCallback *callback);
798
802 void SendRDMRequest(uint8_t port_id,
803 ola::rdm::RDMRequest *request,
804 ola::rdm::RDMCallback *on_complete);
805
806 /*
807 * @brief This handler is called if we receive ArtTod packets and a discovery
808 * process isn't running.
809 */
810 bool SetUnsolicitedUIDSetHandler(
811 uint8_t port_id,
812 ola::Callback1<void, const ola::rdm::UIDSet&> *on_tod) {
813 return m_impl.SetUnsolicitedUIDSetHandler(port_id, on_tod);
814 }
815 void GetSubscribedNodes(
816 uint8_t port_id,
817 std::vector<ola::network::IPV4Address> *node_addresses) {
818 m_impl.GetSubscribedNodes(port_id, node_addresses);
819 }
820
821 // The following apply to Output Ports (those which receive data);
822 bool SetDMXHandler(uint8_t port_id,
823 DmxBuffer *buffer,
824 ola::Callback0<void> *handler) {
825 return m_impl.SetDMXHandler(port_id, buffer, handler);
826 }
827 bool SendTod(uint8_t port_id, const ola::rdm::UIDSet &uid_set) {
828 return m_impl.SendTod(port_id, uid_set);
829 }
830 bool SetOutputPortRDMHandlers(
831 uint8_t port_id,
832 ola::Callback0<void> *on_discover,
833 ola::Callback0<void> *on_flush,
834 ola::Callback2<void,
835 ola::rdm::RDMRequest*,
836 ola::rdm::RDMCallback*> *on_rdm_request) {
837 return m_impl.SetOutputPortRDMHandlers(port_id,
838 on_discover,
839 on_flush,
840 on_rdm_request);
841 }
842
843 // Time Code methods
844 bool SendTimeCode(const ola::timecode::TimeCode &timecode) {
845 return m_impl.SendTimeCode(timecode);
846 }
847
848 private:
849 ArtNetNodeImpl m_impl;
850 std::vector<ArtNetNodeImplRDMWrapper*> m_wrappers;
851 std::vector<ola::rdm::DiscoverableQueueingRDMController*> m_controllers;
852
857 bool CheckInputPortId(uint8_t port_id);
858
859 ArtNetNode(const ArtNetNode &) = delete;
860 const ArtNetNode &operator=(const ArtNetNode &) = delete;
861};
862} // namespace artnet
863} // namespace plugin
864} // namespace ola
865#endif // PLUGINS_ARTNET_ARTNETNODE_H_
Callback.h
DmxBuffer.h
A class used to hold a single universe of DMX data.
IPV4Address.h
Represents an IPv4 Address.
QueueingRDMController.h
An RDM Controller that queues messages and only sends a single message at a time.
RDMCommand.h
Classes that represent RDM commands.
RDMControllerInterface.h
Definitions and Interfaces to implement an RDMController that sends a single message at a time.
UIDSet.h
A set of UIDs.
ola::Callback0
A 0 argument callback which can be called multiple times.
Definition Callback.h:129
ola::Callback1
A 1 argument callback which can be called multiple times.
Definition Callback.h:992
ola::Callback2
A 2 argument callback which can be called multiple times.
Definition Callback.h:1895
ola::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::TimeStamp
Definition Clock.h:179
ola::io::SelectServerInterface
The interface for the SelectServer.
Definition SelectServerInterface.h:42
ola::network::IPV4Address
Represents a IPv4 Address.
Definition IPV4Address.h:55
ola::network::Interface
Definition Interface.h:35
ola::network::UDPSocketInterface
The interface for UDPSockets.
Definition Socket.h:48
ola::plugin::artnet::ArtNetNode::RunFullDiscovery
void RunFullDiscovery(uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
Trigger full discovery for a port.
Definition ArtNetNode.cpp:1821
ola::plugin::artnet::ArtNetNode::SendRDMRequest
void SendRDMRequest(uint8_t port_id, ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
Send a RDM request by passing it though the Queuing Controller.
Definition ArtNetNode.cpp:1841
ola::plugin::artnet::ArtNetNode::RunIncrementalDiscovery
void RunIncrementalDiscovery(uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
Trigger incremental discovery for a port.
Definition ArtNetNode.cpp:1831
ola::plugin::artnet::ArtNetNodeImpl::InputPort
Definition ArtNetNode.cpp:85
ola::plugin::artnet::ArtNetNodeImpl
Definition ArtNetNode.h:83
ola::plugin::artnet::ArtNetNodeImpl::SendRDMRequest
void SendRDMRequest(uint8_t port_id, ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
Send an RDMRequest on this port.
Definition ArtNetNode.cpp:659
ola::plugin::artnet::ArtNetNodeImpl::InputPortState
bool InputPortState(uint8_t port_id) const
Check the state of an input port.
Definition ArtNetNode.cpp:445
ola::plugin::artnet::ArtNetNodeImpl::GetOutputPortUniverse
uint8_t GetOutputPortUniverse(uint8_t port_id)
Definition ArtNetNode.cpp:467
ola::plugin::artnet::ArtNetNodeImpl::SetLongName
bool SetLongName(const std::string &name)
Set the long name.
Definition ArtNetNode.cpp:347
ola::plugin::artnet::ArtNetNodeImpl::RunFullDiscovery
void RunFullDiscovery(uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
Flush the TOD and force a full discovery.
Definition ArtNetNode.cpp:603
ola::plugin::artnet::ArtNetNodeImpl::DisableOutputPort
void DisableOutputPort(uint8_t port_id)
Disable an output port.
Definition ArtNetNode.cpp:472
ola::plugin::artnet::ArtNetNodeImpl::Start
bool Start()
Start this node. The port modifying functions can be called before this.
Definition ArtNetNode.cpp:260
ola::plugin::artnet::ArtNetNodeImpl::EnterConfigurationMode
bool EnterConfigurationMode()
Start the configuration transaction.
Definition ArtNetNode.cpp:311
ola::plugin::artnet::ArtNetNodeImpl::ArtNetNodeImpl
ArtNetNodeImpl(const ola::network::Interface &iface, ola::io::SelectServerInterface *ss, const ArtNetNodeOptions &options, ola::network::UDPSocketInterface *socket=NULL)
Create a new node.
Definition ArtNetNode.cpp:196
ola::plugin::artnet::ArtNetNodeImpl::OutputPortState
bool OutputPortState(uint8_t port_id) const
Check the state of an output port.
Definition ArtNetNode.cpp:485
ola::plugin::artnet::ArtNetNodeImpl::SetMergeMode
bool SetMergeMode(uint8_t port_id, artnet_merge_mode merge_mode)
Set the merge mode for an output port.
Definition ArtNetNode.cpp:490
ola::plugin::artnet::ArtNetNodeImpl::ExitConfigurationMode
bool ExitConfigurationMode()
End the configuration transaction.
Definition ArtNetNode.cpp:321
ola::plugin::artnet::ArtNetNodeImpl::SetInputPortUniverse
bool SetInputPortUniverse(uint8_t port_id, uint8_t universe_id)
Definition ArtNetNode.cpp:412
ola::plugin::artnet::ArtNetNodeImpl::SetShortName
bool SetShortName(const std::string &name)
Set the short name.
Definition ArtNetNode.cpp:338
ola::plugin::artnet::ArtNetNodeImpl::~ArtNetNodeImpl
virtual ~ArtNetNodeImpl()
Cleanup.
Definition ArtNetNode.cpp:239
ola::plugin::artnet::ArtNetNodeImpl::GetSubscribedNodes
void GetSubscribedNodes(uint8_t port_id, std::vector< ola::network::IPV4Address > *node_addresses)
Get the nodes listening to the universe a port is sending.
Definition ArtNetNode.cpp:723
ola::plugin::artnet::ArtNetNodeImpl::SetNetAddress
bool SetNetAddress(uint8_t net_address)
Set the net address for this node.
Definition ArtNetNode.cpp:355
ola::plugin::artnet::ArtNetNodeImpl::SendDMX
bool SendDMX(uint8_t port_id, const ola::DmxBuffer &buffer)
Send some DMX data.
Definition ArtNetNode.cpp:528
ola::plugin::artnet::ArtNetNodeImpl::SetOutputPortUniverse
bool SetOutputPortUniverse(uint8_t port_id, uint8_t universe_id)
Set the universe for an output port.
Definition ArtNetNode.cpp:450
ola::plugin::artnet::ArtNetNodeImpl::SendTimeCode
bool SendTimeCode(const ola::timecode::TimeCode &timecode)
Send a timecode packet.
Definition ArtNetNode.cpp:833
ola::plugin::artnet::ArtNetNodeImpl::SendTod
bool SendTod(uint8_t port_id, const ola::rdm::UIDSet &uid_set)
Send an set of UIDs in one of more ArtTod packets.
Definition ArtNetNode.cpp:758
ola::plugin::artnet::ArtNetNodeImpl::SetSubnetAddress
bool SetSubnetAddress(uint8_t subnet_address)
Set the subnet address for this node.
Definition ArtNetNode.cpp:379
ola::plugin::artnet::ArtNetNodeImpl::SetOutputPortRDMHandlers
bool SetOutputPortRDMHandlers(uint8_t port_id, ola::Callback0< void > *on_discover, ola::Callback0< void > *on_flush, ola::Callback2< void, ola::rdm::RDMRequest *, ola::rdm::RDMCallback * > *on_rdm_request)
Set the RDM handlers for an Output port.
Definition ArtNetNode.cpp:808
ola::plugin::artnet::ArtNetNodeImpl::SetUnsolicitedUIDSetHandler
bool SetUnsolicitedUIDSetHandler(uint8_t port_id, ola::Callback1< void, const ola::rdm::UIDSet & > *on_tod)
Set the RDM handlers for an Input port.
Definition ArtNetNode.cpp:713
ola::plugin::artnet::ArtNetNodeImpl::InputPortCount
uint8_t InputPortCount() const
Definition ArtNetNode.cpp:408
ola::plugin::artnet::ArtNetNodeImpl::SetDMXHandler
bool SetDMXHandler(uint8_t port_id, DmxBuffer *buffer, ola::Callback0< void > *handler)
Set the closure to be called when we receive data for this universe.
Definition ArtNetNode.cpp:742
ola::plugin::artnet::ArtNetNodeImpl::GetInputPortUniverse
uint8_t GetInputPortUniverse(uint8_t port_id) const
Get an input port universe address.
Definition ArtNetNode.cpp:427
ola::plugin::artnet::ArtNetNodeImpl::SendPoll
bool SendPoll()
Send an ArtPoll if any of the ports are sending data.
Definition ArtNetNode.cpp:501
ola::plugin::artnet::ArtNetNodeImpl::Stop
bool Stop()
Stop this node.
Definition ArtNetNode.cpp:269
ola::plugin::artnet::ArtNetNodeImpl::RunIncrementalDiscovery
void RunIncrementalDiscovery(uint8_t port_id, ola::rdm::RDMDiscoveryCallback *callback)
Run an 'incremental' discovery. This just involves fetching the TOD from all nodes.
Definition ArtNetNode.cpp:630
ola::plugin::artnet::ArtNetNodeImpl::DisableInputPort
void DisableInputPort(uint8_t port_id)
Disable an input port.
Definition ArtNetNode.cpp:432
ola::plugin::artnet::ArtNetNodeImplRDMWrapper
Definition ArtNetNode.h:665
ola::plugin::artnet::ArtNetNodeImplRDMWrapper::RunFullDiscovery
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start a full discovery operation.
Definition ArtNetNode.h:678
ola::plugin::artnet::ArtNetNodeImplRDMWrapper::SendRDMRequest
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
Send a RDM command.
Definition ArtNetNode.h:673
ola::plugin::artnet::ArtNetNodeImplRDMWrapper::RunIncrementalDiscovery
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start an incremental discovery operation.
Definition ArtNetNode.h:682
ola::plugin::artnet::ArtNetNodeOptions
Definition ArtNetNode.h:65
ola::rdm::DiscoverableRDMControllerInterface
The interface that can send RDM commands, as well as perform discovery operations.
Definition RDMControllerInterface.h:104
ola::rdm::RDMCommand
The base class that all RDM requests & responses inherit from.
Definition RDMCommand.h:59
ola::rdm::RDMFrame
The raw data for a RDM message and its associated timing information.
Definition RDMFrame.h:40
ola::rdm::RDMRequest
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
ola::rdm::UID
Represents a RDM UID.
Definition UID.h:57
ola::rdm::UIDSet
Represents a set of RDM UIDs.
Definition UIDSet.h:48
ola::timecode::TimeCode
Definition TimeCode.h:33
ola::plugin::artnet
The ArtNet plugin.
ola::plugin
Code for supported devices and protocols.
ola::rdm::RDMCallback
ola::BaseCallback1< void, RDMReply * > RDMCallback
The callback run when a RDM request completes.
Definition RDMControllerInterface.h:52
ola::rdm::RDMDiscoveryCallback
ola::BaseCallback1< void, const ola::rdm::UIDSet & > RDMDiscoveryCallback
The callback run when a discovery operation completes.
Definition RDMControllerInterface.h:68
ola::timecode
Timecode.
Definition TimeCode.cpp:30
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
ola::plugin::artnet::artnet_packet
Definition ArtNetPackets.h:252
ola::rdm::RDMReply
Holds the final state of an RDM request.
Definition RDMReply.h:43