rfid-timer-emulator.h 769 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include <api-hal.h>
  3. #include "key-info.h"
  4. #include "encoder-generic.h"
  5. #include "encoder-emmarine.h"
  6. #include "encoder-hid.h"
  7. #include "encoder-indala.h"
  8. #include "pulse-joiner.h"
  9. #include <map>
  10. class RfidTimerEmulator {
  11. public:
  12. enum class Type : uint8_t {
  13. EM,
  14. HID,
  15. Indala,
  16. };
  17. RfidTimerEmulator();
  18. ~RfidTimerEmulator();
  19. void start(Type type);
  20. void stop();
  21. void emulate();
  22. private:
  23. EncoderGeneric* current_encoder = nullptr;
  24. std::map<Type, EncoderGeneric*> encoders = {
  25. {Type::EM, new EncoderEM()},
  26. {Type::HID, new EncoderHID()},
  27. {Type::Indala, new EncoderIndala()},
  28. };
  29. PulseJoiner pulse_joiner;
  30. static void timer_update_callback(void* _hw, void* ctx);
  31. };