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

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
SensorResponder.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 * SensorResponder.h
17 * Copyright (C) 2013 Simon Newton
18 */
19
27
28#ifndef INCLUDE_OLA_RDM_SENSORRESPONDER_H_
29#define INCLUDE_OLA_RDM_SENSORRESPONDER_H_
30
31#include <ola/rdm/RDMControllerInterface.h>
32#include <ola/rdm/RDMEnums.h>
33#include <ola/rdm/ResponderOps.h>
34#include <ola/rdm/ResponderSensor.h>
35#include <ola/rdm/UID.h>
36
37#include <string>
38#include <vector>
39
40namespace ola {
41namespace rdm {
42
46 class SensorResponder: public RDMControllerInterface {
47 public:
48 explicit SensorResponder(const UID &uid);
49 ~SensorResponder();
50
51 void SendRDMRequest(RDMRequest *request, RDMCallback *callback);
52
53 private:
57 class RDMOps : public ResponderOps<SensorResponder> {
58 public:
59 static RDMOps *Instance() {
60 if (!instance)
61 instance = new RDMOps();
62 return instance;
63 }
64
65 private:
66 RDMOps() : ResponderOps<SensorResponder>(PARAM_HANDLERS) {}
67
68 static RDMOps *instance;
69 };
70
71 const UID m_uid;
72 bool m_identify_mode;
73 Sensors m_sensors;
74
75 RDMResponse *GetDeviceInfo(const RDMRequest *request);
76 RDMResponse *GetProductDetailList(const RDMRequest *request);
77 RDMResponse *GetIdentify(const RDMRequest *request);
78 RDMResponse *SetIdentify(const RDMRequest *request);
79 RDMResponse *GetManufacturerLabel(const RDMRequest *request);
80 RDMResponse *GetDeviceLabel(const RDMRequest *request);
81 RDMResponse *GetDeviceModelDescription(const RDMRequest *request);
82 RDMResponse *GetSoftwareVersionLabel(const RDMRequest *request);
83 RDMResponse *GetSensorDefinition(const RDMRequest *request);
84 RDMResponse *GetSensorValue(const RDMRequest *request);
85 RDMResponse *SetSensorValue(const RDMRequest *request);
86 RDMResponse *RecordSensor(const RDMRequest *request);
87
88 static const ResponderOps<SensorResponder>::ParamHandler PARAM_HANDLERS[];
89};
90} // namespace rdm
91} // namespace ola
92#endif // INCLUDE_OLA_RDM_SENSORRESPONDER_H_
RDMControllerInterface.h
Definitions and Interfaces to implement an RDMController that sends a single message at a time.
RDMEnums.h
Various constants used in RDM.
ResponderOps.h
A framework for building RDM responders.
ResponderSensor.h
Holds the information about a sensor.
UID.h
A RDM unique identifier (UID).
ola::rdm::RDMControllerInterface
The interface that can send RDMRequest.
Definition RDMControllerInterface.h:73
ola::rdm::RDMRequest
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
ola::rdm::RDMResponse
An RDM Command that represents responses (GET, SET or DISCOVER).
Definition RDMCommand.h:457
ola::rdm::ResponderOps
A class which dispatches RDM requests to registered PID handlers.
Definition ResponderOps.h:60
ola::rdm::SensorResponder::SensorResponder
SensorResponder(const UID &uid)
Definition SensorResponder.cpp:120
ola::rdm::SensorResponder::SendRDMRequest
void SendRDMRequest(RDMRequest *request, RDMCallback *callback)
Send a RDM command.
Definition SensorResponder.cpp:181
ola::rdm::UID
Represents a RDM UID.
Definition UID.h:57
ola::rdm
PLASA E1.20 Remote Device Management.
Definition AckTimerResponder.cpp:38
ola::rdm::RDMCallback
ola::BaseCallback1< void, RDMReply * > RDMCallback
The callback run when a RDM request completes.
Definition RDMControllerInterface.h:52
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
ola::rdm::ResponderOps::ParamHandler
the structure that defines the behaviour for a specific PID.o
Definition ResponderOps.h:76