subghz_protocol_gate_tx.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #pragma once
  2. #include "subghz_protocol_common.h"
  3. typedef struct SubGhzProtocolGateTX SubGhzProtocolGateTX;
  4. /** Allocate SubGhzProtocolGateTX
  5. *
  6. * @return SubGhzProtocolGateTX*
  7. */
  8. SubGhzProtocolGateTX* subghz_protocol_gate_tx_alloc();
  9. /** Free SubGhzProtocolGateTX
  10. *
  11. * @param instance
  12. */
  13. void subghz_protocol_gate_tx_free(SubGhzProtocolGateTX* instance);
  14. /** Get upload protocol
  15. *
  16. * @param instance - SubGhzProtocolGateTX instance
  17. * @param encoder - SubGhzProtocolCommonEncoder encoder
  18. * @return bool
  19. */
  20. bool subghz_protocol_gate_tx_send_key(
  21. SubGhzProtocolGateTX* instance,
  22. SubGhzProtocolCommonEncoder* encoder);
  23. /** Reset internal state
  24. * @param instance - SubGhzProtocolGateTX instance
  25. */
  26. void subghz_protocol_gate_tx_reset(SubGhzProtocolGateTX* instance);
  27. /** Parse accepted duration
  28. *
  29. * @param instance - SubGhzProtocolGateTX instance
  30. * @param data - LevelDuration level_duration
  31. */
  32. void subghz_protocol_gate_tx_parse(SubGhzProtocolGateTX* instance, bool level, uint32_t duration);
  33. /** Outputting information from the parser
  34. *
  35. * @param instance - SubGhzProtocolFaacSLH* instance
  36. * @param output - output string
  37. */
  38. void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t output);
  39. /** Get a string to save the protocol
  40. *
  41. * @param instance - SubGhzProtocolGateTX instance
  42. * @param output - the resulting string
  43. */
  44. void subghz_protocol_gate_tx_to_save_str(SubGhzProtocolGateTX* instance, string_t output);
  45. /** Loading protocol from file
  46. *
  47. * @param file_worker - FileWorker file_worker
  48. * @param instance - SubGhzProtocolGateTX instance
  49. * @param file_path - file path
  50. * @return bool
  51. */
  52. bool subghz_protocol_gate_tx_to_load_protocol_from_file(
  53. FileWorker* file_worker,
  54. SubGhzProtocolGateTX* instance,
  55. const char* file_path);
  56. /** Loading protocol from bin data
  57. *
  58. * @param instance - SubGhzProtocolGateTX instance
  59. * @param context - SubGhzProtocolCommonLoad context
  60. */
  61. void subghz_decoder_gate_tx_to_load_protocol(SubGhzProtocolGateTX* instance, void* context);