Leosac  0.7.0
OpenSourceAccessControl
LED.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2017 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "hardware/LED.hpp"
21 #include "hardware/GPIO.hpp"
22 
23 namespace Leosac
24 {
25 namespace Hardware
26 {
27 
30 {
31 }
32 
33 void LED::validation_callback(odb::callback_event e, odb::database &db) const
34 {
36 }
37 
38 const GPIOPtr &LED::gpio() const
39 {
40  return gpio_;
41 }
42 
43 void LED::gpio(const GPIOPtr &gpio)
44 {
45  gpio_ = gpio;
46 }
47 
49 {
51 }
52 
54 {
56 }
57 
58 int64_t LED::default_blink_speed() const
59 {
60  return default_blink_speed_;
61 }
62 
64 {
66 }
67 }
68 }
void validation_callback(odb::callback_event e, odb::database &) const override
Definition: LED.cpp:33
DeviceClass
An enumeration describing the class of the device.
Definition: HardwareFwd.hpp:41
std::shared_ptr< GPIO > GPIOPtr
Definition: HardwareFwd.hpp:55
This is the header file for a generated source file, GitSHA1.cpp.
int64_t default_blink_speed_
Definition: LED.hpp:58
const GPIOPtr & gpio() const
Definition: LED.cpp:38
int64_t default_blink_speed() const
Definition: LED.cpp:58
Base class for hardware devices.
Definition: Device.hpp:44
int64_t default_blink_duration_
Definition: LED.hpp:57
virtual void validation_callback(odb::callback_event e, odb::database &) const
Definition: Device.cpp:85
int64_t default_blink_duration() const
Definition: LED.cpp:48
Abstraction of LED device attributes.
Definition: LED.hpp:36
GPIOPtr gpio_
The underlying GPIO.
Definition: LED.hpp:63