protocol_i.h 1.0 KB

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