Leosac  0.8.0
Open Source Access Control
GPIO.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/GPIO.hpp"
22 
23 namespace Leosac
24 {
25 namespace Hardware
26 {
27 
30  , number_(0)
31  , direction_(Direction::In)
32  , default_value_(false)
33 {
34 }
35 
36 uint16_t GPIO::number() const
37 {
38  return number_;
39 }
40 
41 void GPIO::number(uint16_t number)
42 {
43  number_ = number;
44 }
45 
47 {
48  return direction_;
49 }
50 
52 {
54 }
55 
56 bool GPIO::default_value() const
57 {
58  return default_value_;
59 }
60 
61 void GPIO::default_value(bool default_value)
62 {
64 }
65 
66 void GPIO::validation_callback(odb::callback_event e, odb::database &db) const
67 {
69 }
70 }
71 }
Leosac::Hardware::DeviceClass
DeviceClass
An enumeration describing the class of the device.
Definition: HardwareFwd.hpp:42
Leosac::Hardware::GPIO::GPIO
GPIO()
Definition: GPIO.cpp:28
Leosac::Hardware::GPIO::default_value
void default_value(bool default_value)
Definition: GPIO.cpp:61
Leosac::Hardware::GPIO::number
uint16_t number() const
Definition: GPIO.cpp:36
Leosac::Hardware::Device::validation_callback
virtual void validation_callback(odb::callback_event e, odb::database &) const
Definition: Device.cpp:85
Leosac::Hardware::GPIO::direction_
Direction direction_
Definition: GPIO.hpp:70
Leosac::Hardware::GPIO::default_value
bool default_value() const
Definition: GPIO.cpp:56
Leosac::Hardware::Device
Base class for hardware devices.
Definition: Device.hpp:44
Leosac::Hardware::GPIO::number_
uint16_t number_
Definition: GPIO.hpp:68
Leosac::Hardware::GPIO::validation_callback
void validation_callback(odb::callback_event e, odb::database &) const override
Definition: GPIO.cpp:66
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Hardware::GPIO::direction
Direction direction() const
Definition: GPIO.cpp:46
Leosac::Hardware::GPIO::default_value_
bool default_value_
True to default to ON, false otherwise.
Definition: GPIO.hpp:75
Leosac::Hardware::GPIO::Direction
Direction
Definition: GPIO.hpp:44
ModelException.hpp
GPIO.hpp
Leosac::Hardware::GPIO
Abstraction of a GPIO device attributes.
Definition: GPIO.hpp:41