rfid-timer-emulator.h 795 B

1234567891011121314151617181920212223242526272829
  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. RfidTimerEmulator();
  13. ~RfidTimerEmulator();
  14. void start(LfrfidKeyType type, const uint8_t* data, uint8_t data_size);
  15. void stop();
  16. private:
  17. EncoderGeneric* current_encoder = nullptr;
  18. std::map<LfrfidKeyType, EncoderGeneric*> encoders = {
  19. {LfrfidKeyType::KeyEM4100, new EncoderEM()},
  20. {LfrfidKeyType::KeyH10301, new EncoderHID_H10301()},
  21. {LfrfidKeyType::KeyI40134, new EncoderIndala_40134()},
  22. };
  23. PulseJoiner pulse_joiner;
  24. static void timer_update_callback(void* _hw, void* ctx);
  25. };