Open Lighting Architecture: libs/usb/JaRulePortHandle.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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>
28#include <ola/rdm/RDMControllerInterface.h>
29#include <ola/rdm/QueueingRDMController.h>
30
31#include <memory>
32
33#include "libs/usb/JaRuleConstants.h"
34
35namespace ola {
36namespace usb {
37
41 class JaRulePortHandle : public ola::rdm::DiscoverableRDMControllerInterface {
42 public:
46 JaRulePortHandle(class JaRuleWidgetPort *parent_port,
47 const ola::rdm::UID &uid,
48 uint8_t physical_port);
49 ~JaRulePortHandle();
50
51 void SendRDMRequest(ola::rdm::RDMRequest *request,
52 ola::rdm::RDMCallback *on_complete);
53 void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback);
54 void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback);
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 JaRulePortHandle(const JaRulePortHandle &) = delete;
79 const JaRulePortHandle &operator=(const JaRulePortHandle &) = delete;
80};
81} // namespace usb
82} // namespace ola
83#endif // LIBS_USB_JARULEPORTHANDLE_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
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.
ola::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::plugin::usbdmx::JaRulePortHandle::JaRulePortHandle
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
ola::rdm::DiscoverableQueueingRDMController
Definition QueueingRDMController.h:88
ola::rdm::DiscoverableRDMControllerInterface
The interface that can send RDM commands, as well as perform discovery operations.
Definition RDMControllerInterface.h:104
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::usb::JaRulePortHandle::RunFullDiscovery
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start a full discovery operation.
Definition JaRulePortHandle.cpp:57
ola::usb::JaRulePortHandle::RunIncrementalDiscovery
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start an incremental discovery operation.
Definition JaRulePortHandle.cpp:62
ola::usb::JaRulePortHandle::SetPortMode
bool SetPortMode(JaRulePortMode new_mode)
Change the mode of the port.
Definition JaRulePortHandle.cpp:71
ola::usb::JaRulePortHandle::SendDMX
bool SendDMX(const DmxBuffer &buffer)
Send DMX data from this widget.
Definition JaRulePortHandle.cpp:67
ola::usb::JaRulePortHandle::SendRDMRequest
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *on_complete)
Send a RDM command.
Definition JaRulePortHandle.cpp:52
ola::usb::JaRulePortHandle::JaRulePortHandle
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
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::usb
USB Device drivers.
ola::usb::JaRulePortMode
JaRulePortMode
Ja Rule Port modes.
Definition JaRuleConstants.h:42
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44