subghz_protocol_keeloq.h 1.3 KB

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