34 , pin_key_end_(pin_key_end)
57 DEBUG(
"This is likely a PIN code");
72 DEBUG(
"DOING SOME CARD READING");
103 if (elapsed_ms_pin >
delay_)
106 DEBUG(
"PIN READING TIMEOUT");
140 if (with_card && with_pin)
179 assert(bits == 4 || bits == 8);
182 return std::unique_ptr<PinReading>(
187 return std::unique_ptr<PinReading>(
TimePoint time_card_read_
An implementation class that represents a Wiegand Reader.
This define message formatting for data source SIMPLE_WIEGAND.
Implementation of a wiegand card only strategy.
WiegandReaderImpl * reader_
std::unique_ptr< PinReading > PinReadingUPtr
Strategy for ready PIN only.
int counter() const
Returns the number of bits read.
PinReadingUPtr read_pin_strategy_
CardReadingUPtr read_card_strategy_
The multiple modes available to wiegand reader are implemented through the strategy pattern...
Message formatting when using a simple PIN code.
void check_timeout()
Called when timeout() was called but nothing was read.
void read_reset()
Reset the "read state" of the reader, effectively cleaning the wiegand-bit-buffer and resetting the c...
When reading both a card an a PIN code.
std::chrono::milliseconds delay_
PinReadingUPtr build_strategy(int bits)
Dynamically instanciate a new strategy based on the number of bits available.
virtual void set_reader(WiegandReaderImpl *new_ptr) override
Update the pointer that points back to the associated reader.
virtual void set_reader(WiegandReaderImpl *new_ptr)
Update the pointer that points back to the associated reader.
virtual void timeout() override
This is called when the module detect a timeout.
virtual bool completed() const override
Did the strategy gather needed data? If this function returns true, that means that the strategy impl...
Provide support for Wiegand devices.
const std::string & name() const
Returns the name of this reader.
void reset() override
Reset self.
virtual void signal(zmqpp::socket &sock) override
Tells the strategy implementation to send a message to the application containing the received creden...
Autodetect(WiegandReaderImpl *reader, std::chrono::milliseconds delay, char pin_key_end)
Create a strategy that read whatever it can and tries its best to determine what is was that it read...