Open Lighting Architecture 0.10.9
Loading...
Searching...
No Matches
UartDmxDevice.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 * UartDmxDevice.h
17 * The DMX through a UART plugin for ola
18 * Copyright (C) 2011 Rui Barreiros
19 * Copyright (C) 2014 Richard Ash
20 */
21
22#ifndef PLUGINS_UARTDMX_UARTDMXDEVICE_H_
23#define PLUGINS_UARTDMX_UARTDMXDEVICE_H_
24
25#include <string>
26#include <sstream>
27#include <memory>
28#include "ola/DmxBuffer.h"
29#include "olad/Device.h"
30#include "olad/Preferences.h"
31#include "plugins/uartdmx/UartWidget.h"
32
33namespace ola {
34namespace plugin {
35namespace uartdmx {
36
37class UartDmxDevice : public Device {
38 public:
40 class Preferences *preferences,
41 const std::string &name,
42 const std::string &path);
44
45 std::string DeviceId() const { return m_path; }
46 UartWidget* GetWidget() { return m_widget.get(); }
47
48 protected:
49 bool StartHook();
50
51 private:
52 // Per device options
53 std::string DeviceBreakKey() const;
54 std::string DeviceMalfKey() const;
55 void SetDefaults();
56
57 std::auto_ptr<UartWidget> m_widget;
58 class Preferences *m_preferences;
59 const std::string m_name;
60 const std::string m_path;
61 unsigned int m_breakt;
62 unsigned int m_malft;
63
64 static const unsigned int DEFAULT_MALF;
65 static const char K_MALF[];
66 static const unsigned int DEFAULT_BREAK;
67 static const char K_BREAK[];
68
69 UartDmxDevice(const UartDmxDevice &) = delete;
70 const UartDmxDevice &operator=(const UartDmxDevice &) = delete;
71};
72} // namespace uartdmx
73} // namespace plugin
74} // namespace ola
75#endif // PLUGINS_UARTDMX_UARTDMXDEVICE_H_
A class used to hold a single universe of DMX data.
Definition Plugin.h:38
Definition Device.h:89
Definition Preferences.h:148
Definition UartDmxDevice.h:37
std::string DeviceId() const
The device ID.
Definition UartDmxDevice.h:45
bool StartHook()
Called during Start().
Definition UartDmxDevice.cpp:69
Definition UartWidget.h:46
The namespace containing all OLA symbols.
Definition Credentials.cpp:44