intertechno_v3.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #pragma once
  2. #include "base.h"
  3. #define SUBGHZ_PROTOCOL_INTERTECHNO_V3_NAME "Intertechno_V3"
  4. typedef struct SubGhzProtocolDecoderIntertechno_V3 SubGhzProtocolDecoderIntertechno_V3;
  5. typedef struct SubGhzProtocolEncoderIntertechno_V3 SubGhzProtocolEncoderIntertechno_V3;
  6. extern const SubGhzProtocolDecoder subghz_protocol_intertechno_v3_decoder;
  7. extern const SubGhzProtocolEncoder subghz_protocol_intertechno_v3_encoder;
  8. extern const SubGhzProtocol subghz_protocol_intertechno_v3;
  9. /**
  10. * Allocate SubGhzProtocolEncoderIntertechno_V3.
  11. * @param environment Pointer to a SubGhzEnvironment instance
  12. * @return SubGhzProtocolEncoderIntertechno_V3* pointer to a SubGhzProtocolEncoderIntertechno_V3 instance
  13. */
  14. void* subghz_protocol_encoder_intertechno_v3_alloc(SubGhzEnvironment* environment);
  15. /**
  16. * Free SubGhzProtocolEncoderIntertechno_V3.
  17. * @param context Pointer to a SubGhzProtocolEncoderIntertechno_V3 instance
  18. */
  19. void subghz_protocol_encoder_intertechno_v3_free(void* context);
  20. /**
  21. * Deserialize and generating an upload to send.
  22. * @param context Pointer to a SubGhzProtocolEncoderIntertechno_V3 instance
  23. * @param flipper_format Pointer to a FlipperFormat instance
  24. * @return true On success
  25. */
  26. bool subghz_protocol_encoder_intertechno_v3_deserialize(
  27. void* context,
  28. FlipperFormat* flipper_format);
  29. /**
  30. * Forced transmission stop.
  31. * @param context Pointer to a SubGhzProtocolEncoderIntertechno_V3 instance
  32. */
  33. void subghz_protocol_encoder_intertechno_v3_stop(void* context);
  34. /**
  35. * Getting the level and duration of the upload to be loaded into DMA.
  36. * @param context Pointer to a SubGhzProtocolEncoderIntertechno_V3 instance
  37. * @return LevelDuration
  38. */
  39. LevelDuration subghz_protocol_encoder_intertechno_v3_yield(void* context);
  40. /**
  41. * Allocate SubGhzProtocolDecoderIntertechno_V3.
  42. * @param environment Pointer to a SubGhzEnvironment instance
  43. * @return SubGhzProtocolDecoderIntertechno_V3* pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  44. */
  45. void* subghz_protocol_decoder_intertechno_v3_alloc(SubGhzEnvironment* environment);
  46. /**
  47. * Free SubGhzProtocolDecoderIntertechno_V3.
  48. * @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  49. */
  50. void subghz_protocol_decoder_intertechno_v3_free(void* context);
  51. /**
  52. * Reset decoder SubGhzProtocolDecoderIntertechno_V3.
  53. * @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  54. */
  55. void subghz_protocol_decoder_intertechno_v3_reset(void* context);
  56. /**
  57. * Parse a raw sequence of levels and durations received from the air.
  58. * @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  59. * @param level Signal level true-high false-low
  60. * @param duration Duration of this level in, us
  61. */
  62. void subghz_protocol_decoder_intertechno_v3_feed(void* context, bool level, uint32_t duration);
  63. /**
  64. * Getting the hash sum of the last randomly received parcel.
  65. * @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  66. * @return hash Hash sum
  67. */
  68. uint8_t subghz_protocol_decoder_intertechno_v3_get_hash_data(void* context);
  69. /**
  70. * Serialize data SubGhzProtocolDecoderIntertechno_V3.
  71. * @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  72. * @param flipper_format Pointer to a FlipperFormat instance
  73. * @param preset The modulation on which the signal was received, SubGhzRadioPreset
  74. * @return true On success
  75. */
  76. bool subghz_protocol_decoder_intertechno_v3_serialize(
  77. void* context,
  78. FlipperFormat* flipper_format,
  79. SubGhzRadioPreset* preset);
  80. /**
  81. * Deserialize data SubGhzProtocolDecoderIntertechno_V3.
  82. * @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  83. * @param flipper_format Pointer to a FlipperFormat instance
  84. * @return true On success
  85. */
  86. bool subghz_protocol_decoder_intertechno_v3_deserialize(
  87. void* context,
  88. FlipperFormat* flipper_format);
  89. /**
  90. * Getting a textual representation of the received data.
  91. * @param context Pointer to a SubGhzProtocolDecoderIntertechno_V3 instance
  92. * @param output Resulting text
  93. */
  94. void subghz_protocol_decoder_intertechno_v3_get_string(void* context, FuriString* output);