![]() |
Leosac
0.8.0
Open Source Access Control
|
Base class for hardware devices. More...
#include <Device.hpp>
Inheritance diagram for Leosac::Hardware::Device:
Collaboration diagram for Leosac::Hardware::Device:Public Member Functions | |
| Device () | |
| Device (DeviceClass device_class) | |
| virtual | ~Device ()=default |
| virtual void | validation_callback (odb::callback_event e, odb::database &) const |
| UUID | id () const |
| const std::string & | name () const |
| void | name (const std::string &name) |
| DeviceClass | device_class () const |
| void | device_class (DeviceClass d) |
| bool | enabled () const |
| void | enabled (bool e) |
| uint64_t | odb_version () const |
Private Attributes | |
| DeviceId | id_ |
| std::string | name_ |
| Name of an hardware device must be unique due to an implementation details. More... | |
| DeviceClass | device_class_ |
| bool | enabled_ |
| Is this device supposed to be enabled? More... | |
| uint64_t | version_ |
Base class for hardware devices.
Device is an abstraction around GPIOs, RFID-readers, and possibly other device classes.
Definition at line 44 of file Device.hpp.
| Leosac::Hardware::Device::Device | ( | ) |
Definition at line 31 of file Device.cpp.
|
explicit |
Definition at line 36 of file Device.cpp.
|
virtualdefault |
| DeviceClass Leosac::Hardware::Device::device_class | ( | ) | const |
Definition at line 65 of file Device.cpp.
| void Leosac::Hardware::Device::device_class | ( | DeviceClass | d | ) |
Definition at line 70 of file Device.cpp.
| bool Leosac::Hardware::Device::enabled | ( | ) | const |
Definition at line 75 of file Device.cpp.
| void Leosac::Hardware::Device::enabled | ( | bool | e | ) |
Definition at line 80 of file Device.cpp.
| UUID Leosac::Hardware::Device::id | ( | ) | const |
Definition at line 49 of file Device.cpp.
| const std::string & Leosac::Hardware::Device::name | ( | ) | const |
Definition at line 55 of file Device.cpp.
| void Leosac::Hardware::Device::name | ( | const std::string & | name | ) |
Definition at line 60 of file Device.cpp.
| uint64_t Leosac::Hardware::Device::odb_version | ( | ) | const |
Definition at line 44 of file Device.cpp.
|
virtual |
Reimplemented in Leosac::Hardware::ExternalMessage, Leosac::Hardware::RFIDReader, Leosac::Hardware::ExternalServer, Leosac::Module::Mqtt::MqttServerConfig, Leosac::Module::Wiegand::WiegandReaderConfig, Leosac::Hardware::GPIO, Leosac::Hardware::Buzzer, and Leosac::Hardware::LED.
Definition at line 85 of file Device.cpp.
|
private |
Definition at line 83 of file Device.hpp.
|
private |
Is this device supposed to be enabled?
This allows module to know if they should process a device or just ignore it.
Definition at line 91 of file Device.hpp.
|
private |
Definition at line 71 of file Device.hpp.
|
private |
Name of an hardware device must be unique due to an implementation details.
Most object bind a ZMQ socket at an address based on their name.
Todo: This restriction should be lifted in the future, when device will Todo: bind to their id rather name.
Definition at line 81 of file Device.hpp.
|
private |
Definition at line 94 of file Device.hpp.