Leosac
0.8.0
Open Source Access Control
|
Facade object for a Wiegand Reader device. More...
#include <FWiegandReader.hpp>
Public Member Functions | |
FWiegandReader (zmqpp::context &ctx, const std::string &reader_name) | |
Construct a facade to a wiegand reader; this facade will connect to the reader. More... | |
FWiegandReader (const FWiegandReader &)=delete | |
FWiegandReader & | operator= (const FWiegandReader &)=delete |
~FWiegandReader ()=default | |
bool | greenLedOn () |
Turn the reader's green led on. More... | |
bool | greenLedOff () |
Turn the reader's green led off. More... | |
bool | greenLedBlink (int64_t duration=1000, int64_t speed=300) |
Make the reader's green led blink. More... | |
bool | beep (int64_t duration=1000) |
Beep for a given duration. More... | |
bool | buzzerOn () |
Turn the buzzer on. More... | |
bool | buzzerOff () |
Turn the buzzer off. More... | |
const std::string & | name () const |
Returns the device's name. More... | |
Private Member Functions | |
bool | send_to_backend (zmqpp::message &m) |
Send a message to the backend_ wiegand reader and wait for a response. More... | |
Private Attributes | |
zmqpp::socket | backend_ |
A socket to talk to the backend wiegand reader. More... | |
std::string | name_ |
Facade object for a Wiegand Reader device.
You can control a reader through this class by acting on its led and buzzer.
Definition at line 38 of file FWiegandReader.hpp.
FWiegandReader::FWiegandReader | ( | zmqpp::context & | ctx, |
const std::string & | reader_name | ||
) |
Construct a facade to a wiegand reader; this facade will connect to the reader.
ctx | ZMQ context |
reader_name | name of targeted wiegand device |
Definition at line 24 of file FWiegandReader.cpp.
|
delete |
|
default |
bool FWiegandReader::beep | ( | int64_t | duration = 1000 | ) |
Beep for a given duration.
Definition at line 70 of file FWiegandReader.cpp.
bool FWiegandReader::buzzerOff | ( | ) |
Turn the buzzer off.
Definition at line 86 of file FWiegandReader.cpp.
bool FWiegandReader::buzzerOn | ( | ) |
Turn the buzzer on.
Definition at line 78 of file FWiegandReader.cpp.
bool FWiegandReader::greenLedBlink | ( | int64_t | duration = 1000 , |
int64_t | speed = 300 |
||
) |
Make the reader's green led blink.
Definition at line 49 of file FWiegandReader.cpp.
bool FWiegandReader::greenLedOff | ( | ) |
Turn the reader's green led off.
Definition at line 40 of file FWiegandReader.cpp.
bool FWiegandReader::greenLedOn | ( | ) |
Turn the reader's green led on.
Definition at line 31 of file FWiegandReader.cpp.
const std::string & FWiegandReader::name | ( | ) | const |
Returns the device's name.
Definition at line 94 of file FWiegandReader.cpp.
|
delete |
|
private |
Send a message to the backend_
wiegand reader and wait for a response.
The response shall be either "OK" or "KO"
Definition at line 58 of file FWiegandReader.cpp.
|
private |
A socket to talk to the backend wiegand reader.
Definition at line 99 of file FWiegandReader.hpp.
|
private |
Definition at line 101 of file FWiegandReader.hpp.