Leosac
0.8.0
Open Source Access Control
|
Strategy for PIN only, when up to 5 keys are buffered and sent as 26 bits. More...
#include <WiegandPinBuffered.hpp>
Public Member Functions | |
WiegandPinBuffered (WiegandReaderImpl *reader) | |
Create a strategy that read 4bits-per-key PIN code. More... | |
virtual void | timeout () override |
This is called when the module detect a timeout. More... | |
virtual bool | completed () const override |
Did the strategy gather needed data? If this function returns true, that means that the strategy implementation successfully retrieve data from wiegand bits. More... | |
virtual void | signal (zmqpp::socket &sock) override |
Tells the strategy implementation to send a message to the application containing the received credentials. More... | |
virtual const std::string & | get_pin () const override |
Retrieve the pin code that was read from the reader. More... | |
virtual void | reset () override |
Reset the strategy, meaning that the next time timeout() is called the behavior should be the same than the first time. More... | |
Public Member Functions inherited from Leosac::Module::Wiegand::Strategy::PinReading | |
PinReading (WiegandReaderImpl *reader) | |
Public Member Functions inherited from Leosac::Module::Wiegand::Strategy::WiegandStrategy | |
WiegandStrategy (WiegandReaderImpl *reader) | |
virtual | ~WiegandStrategy ()=default |
virtual void | set_reader (WiegandReaderImpl *new_ptr) |
Update the pointer that points back to the associated reader. More... | |
Private Attributes | |
bool | ready_ |
std::string | pin_ |
Additional Inherited Members | |
Protected Attributes inherited from Leosac::Module::Wiegand::Strategy::WiegandStrategy | |
WiegandReaderImpl * | reader_ |
Strategy for PIN only, when up to 5 keys are buffered and sent as 26 bits.
See HID documentation about keypad buffered mode.
Definition at line 36 of file WiegandPinBuffered.hpp.
WiegandPinBuffered::WiegandPinBuffered | ( | WiegandReaderImpl * | reader | ) |
Create a strategy that read 4bits-per-key PIN code.
reader | the reader object we provide the strategy for. |
Definition at line 27 of file WiegandPinBuffered.cpp.
|
overridevirtual |
Did the strategy gather needed data? If this function returns true, that means that the strategy implementation successfully retrieve data from wiegand bits.
It successfully build a card_id, or a PIN code, etc. The reader implementation will call signal()
if completed()
returns true.
Implements Leosac::Module::Wiegand::Strategy::WiegandStrategy.
Definition at line 66 of file WiegandPinBuffered.cpp.
|
overridevirtual |
Retrieve the pin code that was read from the reader.
Implements Leosac::Module::Wiegand::Strategy::PinReading.
Definition at line 82 of file WiegandPinBuffered.cpp.
|
overridevirtual |
Reset the strategy, meaning that the next time timeout() is called the behavior should be the same than the first time.
Basically, implementation should wipe its state (parts of PIN code read, card ID, etc).
Implements Leosac::Module::Wiegand::Strategy::WiegandStrategy.
Definition at line 87 of file WiegandPinBuffered.cpp.
|
overridevirtual |
Tells the strategy implementation to send a message to the application containing the received credentials.
It is up to the strategy to format a correct message. This is required because only the strategy knows what kind of credential it can generate.
sock | the socket where we write the message containing credentials. |
Implements Leosac::Module::Wiegand::Strategy::WiegandStrategy.
Definition at line 71 of file WiegandPinBuffered.cpp.
|
overridevirtual |
This is called when the module detect a timeout.
(2 ms of inactivity).
Implements Leosac::Module::Wiegand::Strategy::WiegandStrategy.
Definition at line 33 of file WiegandPinBuffered.cpp.
|
private |
Definition at line 58 of file WiegandPinBuffered.hpp.
|
private |
Definition at line 57 of file WiegandPinBuffered.hpp.