rfid-timer-emulator.h 821 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-h10301.h"
  7. #include "encoder-indala-40134.h"
  8. #include "pulse-joiner.h"
  9. #include <map>
  10. class RfidTimerEmulator {
  11. public:
  12. enum class Type : uint8_t {
  13. EM,
  14. HID_H10301,
  15. Indala_40134,
  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_H10301, new EncoderHID_H10301()},
  27. {Type::Indala_40134, new EncoderIndala_40134()},
  28. };
  29. PulseJoiner pulse_joiner;
  30. static void timer_update_callback(void* _hw, void* ctx);
  31. };