subghz_protocol_keeloq.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include "subghz_protocol_common.h"
  3. typedef struct SubGhzProtocolKeeloq SubGhzProtocolKeeloq;
  4. /** Allocate SubGhzProtocolKeeloq
  5. *
  6. * @return SubGhzProtocolKeeloq*
  7. */
  8. SubGhzProtocolKeeloq* subghz_protocol_keeloq_alloc();
  9. /** Free SubGhzProtocolKeeloq
  10. *
  11. * @param instance
  12. */
  13. void subghz_protocol_keeloq_free(SubGhzProtocolKeeloq* instance);
  14. /** Loading of manufacture keys
  15. *
  16. * @param instance - SubGhzProtocolKeeloq instance
  17. * @param name - key name
  18. * @param key - manufacture (64bit)
  19. * @param type - type manufacture key
  20. */
  21. void subghz_protocol_keeloq_add_manafacture_key(SubGhzProtocolKeeloq* instance, const char* name, uint64_t key, uint16_t type);
  22. /** Sends the key on the air
  23. *
  24. * @param instance - SubGhzProtocolKeeloq instance
  25. * @param key - key send
  26. * @param bit - count bit key
  27. * @param repeat - repeat send key
  28. */
  29. void subghz_protocol_keeloq_send_key(SubGhzProtocolKeeloq* instance, uint64_t key, uint8_t bit, uint8_t repeat);
  30. /** Reset internal state
  31. * @param instance - SubGhzProtocolKeeloq instance
  32. */
  33. void subghz_protocol_keeloq_reset(SubGhzProtocolKeeloq* instance);
  34. /** Parse accepted duration
  35. *
  36. * @param instance - SubGhzProtocolKeeloq instance
  37. * @param data - LevelDuration level_duration
  38. */
  39. void subghz_protocol_keeloq_parse(SubGhzProtocolKeeloq* instance, bool level, uint32_t duration);
  40. /** Outputting information from the parser
  41. *
  42. * @param instance - SubGhzProtocolKeeloq* instance
  43. * @param output - output string
  44. */
  45. void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t output);