protocol_i.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include "protocol.h"
  3. #if defined(RFID_125_PROTOCOL)
  4. #define MAX_PAYLOAD_SIZE (8)
  5. #define PROTOCOL_DEF_IDLE_TIME (4)
  6. #define PROTOCOL_DEF_EMU_TIME (5)
  7. #define PROTOCOL_TIME_DELAY_MIN PROTOCOL_DEF_IDLE_TIME + PROTOCOL_DEF_EMU_TIME
  8. #define PROTOCOL_KEY_FOLDER_NAME "lfrfid"
  9. #define PROTOCOL_KEY_EXTENSION ".rfid"
  10. #else
  11. #define MAX_PAYLOAD_SIZE (8)
  12. #define PROTOCOL_DEF_IDLE_TIME (2)
  13. #define PROTOCOL_DEF_EMU_TIME (2)
  14. #define PROTOCOL_TIME_DELAY_MIN PROTOCOL_DEF_IDLE_TIME + PROTOCOL_DEF_EMU_TIME
  15. #define PROTOCOL_KEY_FOLDER_NAME "ibutton"
  16. #define PROTOCOL_KEY_EXTENSION ".ibtn"
  17. #endif
  18. typedef struct ProtoDict ProtoDict;
  19. typedef struct FuzzerProtocol FuzzerProtocol;
  20. struct ProtoDict {
  21. const uint8_t* val;
  22. const uint8_t len;
  23. };
  24. struct FuzzerProtocol {
  25. const char* name;
  26. const uint8_t data_size;
  27. const ProtoDict dict;
  28. };
  29. // #define MAX_PAYLOAD_SIZE 6
  30. // #define FUZZ_TIME_DELAY_MIN (5)
  31. // #define FUZZ_TIME_DELAY_DEFAULT (10)
  32. // #define FUZZ_TIME_DELAY_MAX (70)
  33. // #define MAX_PAYLOAD_SIZE 8
  34. // #define FUZZ_TIME_DELAY_MIN (4)
  35. // #define FUZZ_TIME_DELAY_DEFAULT (8)
  36. // #define FUZZ_TIME_DELAY_MAX (80)
  37. extern const FuzzerProtocol fuzzer_proto_items[];