Open Lighting Architecture  Latest Git
JaRulePortHandle.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  * JaRulePortHandle.h
17  * A Ja Rule Port Handle.
18  * Copyright (C) 2015 Simon Newton
19  */
20 
21 #ifndef LIBS_USB_JARULEPORTHANDLE_H_
22 #define LIBS_USB_JARULEPORTHANDLE_H_
23 
24 #include <stdint.h>
25 
26 #include <ola/DmxBuffer.h>
27 #include <ola/rdm/RDMCommand.h>
30 
31 #include <memory>
32 
33 #include "libs/usb/JaRuleConstants.h"
34 
35 namespace ola {
36 namespace usb {
37 
42  public:
46  JaRulePortHandle(class JaRuleWidgetPort *parent_port,
47  const ola::rdm::UID &uid,
48  uint8_t physical_port);
50 
52  ola::rdm::RDMCallback *on_complete);
55 
61  bool SendDMX(const DmxBuffer &buffer);
62 
69  bool SetPortMode(JaRulePortMode new_mode);
70 
71  private:
72  // Order of destruction is important.
73  std::auto_ptr<class JaRulePortHandleImpl> m_impl;
74  ola::rdm::DiscoverableQueueingRDMController m_queueing_controller;
75 
76  static const unsigned int RDM_QUEUE_SIZE = 50;
77 
78  DISALLOW_COPY_AND_ASSIGN(JaRulePortHandle);
79 };
80 } // namespace usb
81 } // namespace ola
82 #endif // LIBS_USB_JARULEPORTHANDLE_H_
Definitions and Interfaces to implement an RDMController that sends a single message at a time...
bool SendDMX(const DmxBuffer &buffer)
Send DMX data from this widget.
Definition: JaRulePortHandle.cpp:67
Represents a DMX/RDM port on a Ja Rule device.
Definition: JaRulePortHandle.h:41
JaRulePortHandle(class JaRuleWidgetPort *parent_port, const ola::rdm::UID &uid, uint8_t physical_port)
Create a new Ja Rule Port Handle.
Definition: JaRulePortHandle.cpp:36
The interface that can send RDM commands, as well as perform discovery operations.
Definition: RDMControllerInterface.h:104
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition: RDMCommand.h:234
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
JaRulePortMode
Ja Rule Port modes.
Definition: JaRuleConstants.h:42
A class used to hold a single universe of DMX data.
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start a full discovery operation.
Definition: JaRulePortHandle.cpp:57
The internal model of a port on a JaRule device.
Definition: JaRuleWidgetPort.h:47
bool SetPortMode(JaRulePortMode new_mode)
Change the mode of the port.
Definition: JaRulePortHandle.cpp:71
An RDM Controller that queues messages and only sends a single message at a time. ...
The base class for all 1 argument callbacks.
Definition: Callback.h:982
Definition: QueueingRDMController.h:88
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
Send a RDM command.
Definition: JaRulePortHandle.cpp:52
Represents a RDM UID.
Definition: UID.h:57
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start an incremental discovery operation.
Definition: JaRulePortHandle.cpp:62
Classes that represent RDM commands.