subghz_protocol_keeloq.h 2.1 KB

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