rfid-timer-emulator.h 801 B

1234567891011121314151617181920212223242526272829303132333435
  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. private:
  22. EncoderGeneric* current_encoder = nullptr;
  23. std::map<Type, EncoderGeneric*> encoders = {
  24. {Type::EM, new EncoderEM()},
  25. {Type::HID_H10301, new EncoderHID_H10301()},
  26. {Type::Indala_40134, new EncoderIndala_40134()},
  27. };
  28. PulseJoiner pulse_joiner;
  29. static void timer_update_callback(void* _hw, void* ctx);
  30. };