hardware_worker.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. // typedef HwProtocolID HwProtocolID;
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #if defined(RFID_125_PROTOCOL)
  6. #include <lib/lfrfid/lfrfid_dict_file.h>
  7. typedef ProtocolId HwProtocolID;
  8. #else
  9. #include <lib/ibutton/protocols/protocol_common.h>
  10. typedef iButtonProtocolId HwProtocolID;
  11. #endif
  12. typedef struct HardwareWorker HardwareWorker;
  13. HardwareWorker* hardware_worker_alloc();
  14. void hardware_worker_free(HardwareWorker* instance);
  15. void hardware_worker_start_thread(HardwareWorker* instance);
  16. void hardware_worker_stop_thread(HardwareWorker* instance);
  17. void hardware_worker_emulate_start(HardwareWorker* instance);
  18. void hardware_worker_stop(HardwareWorker* instance);
  19. void hardware_worker_set_protocol_data(
  20. HardwareWorker* instance,
  21. uint8_t* payload,
  22. uint8_t payload_size);
  23. void hardware_worker_get_protocol_data(
  24. HardwareWorker* instance,
  25. uint8_t* payload,
  26. uint8_t payload_size);
  27. bool hardware_worker_set_protocol_id_by_name(HardwareWorker* instance, const char* protocol_name);
  28. HwProtocolID hardware_worker_get_protocol_id(HardwareWorker* instance);
  29. bool hardware_worker_load_key_from_file(HardwareWorker* instance, const char* filename);