subghz_protocol_keeloq.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. /** Set manufacture name
  16. *
  17. * @param manufacture_name - manufacture name
  18. * @param context - SubGhzProtocolKeeloq context
  19. */
  20. void subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name);
  21. /** Get key keeloq
  22. *
  23. * @param context - SubGhzProtocolKeeloq context
  24. * @return key
  25. */
  26. uint64_t subghz_protocol_keeloq_gen_key(void* context);
  27. /** Get upload protocol
  28. *
  29. * @param instance - SubGhzProtocolCame instance
  30. * @param encoder - SubGhzProtocolEncoderCommon encoder
  31. * @return bool
  32. */
  33. bool subghz_protocol_keeloq_send_key(SubGhzProtocolKeeloq* instance, SubGhzProtocolEncoderCommon* encoder);
  34. /** Reset internal state
  35. * @param instance - SubGhzProtocolKeeloq instance
  36. */
  37. void subghz_protocol_keeloq_reset(SubGhzProtocolKeeloq* instance);
  38. /** Parse accepted duration
  39. *
  40. * @param instance - SubGhzProtocolKeeloq instance
  41. * @param data - LevelDuration level_duration
  42. */
  43. void subghz_protocol_keeloq_parse(SubGhzProtocolKeeloq* instance, bool level, uint32_t duration);
  44. /** Outputting information from the parser
  45. *
  46. * @param instance - SubGhzProtocolKeeloq* instance
  47. * @param output - output string
  48. */
  49. void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t output);
  50. void subghz_protocol_keeloq_to_save_str(SubGhzProtocolKeeloq* instance, string_t output);
  51. bool subghz_protocol_keeloq_to_load_protocol(FileWorker* file_worker, SubGhzProtocolKeeloq* instance);