mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-17 02:13:19 +03:00
a7edebce69
* Fix comparison of constant 300 with expression of type 'uint8_t' is always false rfid-worker.cpp:111 if(validate_counts > (5 * 60)) * Fix format string is not a string literal (potentially insecure) Co-authored-by: Tony Freeman <tonyfreeman@users.noreply.github.com>
48 lines
886 B
C++
48 lines
886 B
C++
#pragma once
|
|
#include "key-info.h"
|
|
#include "rfid-reader.h"
|
|
#include "rfid-writer.h"
|
|
#include "rfid-timer-emulator.h"
|
|
#include "rfid-key.h"
|
|
#include "state-sequencer.h"
|
|
|
|
class RfidWorker {
|
|
public:
|
|
RfidWorker();
|
|
~RfidWorker();
|
|
|
|
void start_read();
|
|
bool read();
|
|
bool detect();
|
|
bool any_read();
|
|
void stop_read();
|
|
|
|
enum class WriteResult : uint8_t {
|
|
Ok,
|
|
NotWritable,
|
|
Nothing,
|
|
};
|
|
|
|
void start_write();
|
|
WriteResult write();
|
|
void stop_write();
|
|
|
|
void start_emulate();
|
|
void stop_emulate();
|
|
|
|
RfidKey key;
|
|
|
|
private:
|
|
RfidWriter writer;
|
|
RfidReader reader;
|
|
RfidTimerEmulator emulator;
|
|
|
|
WriteResult write_result;
|
|
TickSequencer* write_sequence;
|
|
|
|
void sq_write();
|
|
void sq_write_start_validate();
|
|
void sq_write_validate();
|
|
uint16_t validate_counts;
|
|
void sq_write_stop_validate();
|
|
}; |