Open Lighting Architecture: include/ola/rdm/RDMControllerInterface.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
RDMControllerInterface.h
Go to the documentation of this file.
1/*
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library 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 GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 *
16 * RDMControllerInterface.h
17 * A RDM Controller that sends a single message at a time.
18 * Copyright (C) 2010 Simon Newton
19 */
20
29#ifndef INCLUDE_OLA_RDM_RDMCONTROLLERINTERFACE_H_
30#define INCLUDE_OLA_RDM_RDMCONTROLLERINTERFACE_H_
31
32#include <ola/Callback.h>
33#include <ola/rdm/RDMCommand.h>
34#include <ola/rdm/RDMReply.h>
35#include <ola/rdm/RDMResponseCodes.h>
36#include <ola/rdm/UIDSet.h>
37
38namespace ola {
39namespace rdm {
40
52 typedef ola::BaseCallback1<void, RDMReply*> RDMCallback;
53
59 inline void RunRDMCallback(RDMCallback *callback, RDMStatusCode status_code) {
60 ola::rdm::RDMReply reply(status_code);
61 callback->Run(&reply);
62}
63
68 typedef ola::BaseCallback1<void, const ola::rdm::UIDSet&> RDMDiscoveryCallback;
69
73 class RDMControllerInterface {
74 public:
75 virtual ~RDMControllerInterface() {}
76
95 virtual void SendRDMRequest(RDMRequest *request,
96 RDMCallback *on_complete) = 0;
97};
98
99
104 class DiscoverableRDMControllerInterface: public RDMControllerInterface {
105 public:
106 DiscoverableRDMControllerInterface(): RDMControllerInterface() {}
107
108 virtual ~DiscoverableRDMControllerInterface() {}
109
115 virtual void RunFullDiscovery(RDMDiscoveryCallback *callback) = 0;
116
122 virtual void RunIncrementalDiscovery(RDMDiscoveryCallback *callback) = 0;
123};
124} // namespace rdm
125} // namespace ola
126#endif // INCLUDE_OLA_RDM_RDMCONTROLLERINTERFACE_H_
Callback.h
RDMCommand.h
Classes that represent RDM commands.
RDMResponseCodes.h
Enums representing the states of a response. This is generated from the proto file.
UIDSet.h
A set of UIDs.
ola::BaseCallback1
The base class for all 1 argument callbacks.
Definition Callback.h:982
ola::rdm::DiscoverableRDMControllerInterface::RunFullDiscovery
virtual void RunFullDiscovery(RDMDiscoveryCallback *callback)=0
Start a full discovery operation.
ola::rdm::DiscoverableRDMControllerInterface::RunIncrementalDiscovery
virtual void RunIncrementalDiscovery(RDMDiscoveryCallback *callback)=0
Start an incremental discovery operation.
ola::rdm::RDMControllerInterface
The interface that can send RDMRequest.
Definition RDMControllerInterface.h:73
ola::rdm::RDMControllerInterface::SendRDMRequest
virtual void SendRDMRequest(RDMRequest *request, RDMCallback *on_complete)=0
Send a RDM command.
ola::rdm::RDMRequest
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
ola::rdm
PLASA E1.20 Remote Device Management.
Definition AckTimerResponder.cpp:38
ola::rdm::RunRDMCallback
void RunRDMCallback(RDMCallback *callback, RDMStatusCode status_code)
A helper message to run a RDMCallback with the given status code.
Definition RDMControllerInterface.h:59
ola::rdm::RDMStatusCode
RDMStatusCode
RDM Status Codes.
Definition RDMResponseCodes.h:45
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
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
ola::rdm::RDMReply
Holds the final state of an RDM request.
Definition RDMReply.h:43