faac_slh.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "base.h"
  3. #define SUBGHZ_PROTOCOL_FAAC_SLH_NAME "Faac SLH"
  4. typedef struct SubGhzProtocolDecoderFaacSLH SubGhzProtocolDecoderFaacSLH;
  5. typedef struct SubGhzProtocolEncoderFaacSLH SubGhzProtocolEncoderFaacSLH;
  6. extern const SubGhzProtocolDecoder subghz_protocol_faac_slh_decoder;
  7. extern const SubGhzProtocolEncoder subghz_protocol_faac_slh_encoder;
  8. extern const SubGhzProtocol subghz_protocol_faac_slh;
  9. /**
  10. * Allocate SubGhzProtocolDecoderFaacSLH.
  11. * @param environment Pointer to a SubGhzEnvironment instance
  12. * @return SubGhzProtocolDecoderFaacSLH* pointer to a SubGhzProtocolDecoderFaacSLH instance
  13. */
  14. void* subghz_protocol_decoder_faac_slh_alloc(SubGhzEnvironment* environment);
  15. /**
  16. * Free SubGhzProtocolDecoderFaacSLH.
  17. * @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
  18. */
  19. void subghz_protocol_decoder_faac_slh_free(void* context);
  20. /**
  21. * Reset decoder SubGhzProtocolDecoderFaacSLH.
  22. * @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
  23. */
  24. void subghz_protocol_decoder_faac_slh_reset(void* context);
  25. /**
  26. * Parse a raw sequence of levels and durations received from the air.
  27. * @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
  28. * @param level Signal level true-high false-low
  29. * @param duration Duration of this level in, us
  30. */
  31. void subghz_protocol_decoder_faac_slh_feed(void* context, bool level, uint32_t duration);
  32. /**
  33. * Getting the hash sum of the last randomly received parcel.
  34. * @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
  35. * @return hash Hash sum
  36. */
  37. uint8_t subghz_protocol_decoder_faac_slh_get_hash_data(void* context);
  38. /**
  39. * Serialize data SubGhzProtocolDecoderFaacSLH.
  40. * @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
  41. * @param flipper_format Pointer to a FlipperFormat instance
  42. * @param preset The modulation on which the signal was received, SubGhzRadioPreset
  43. * @return true On success
  44. */
  45. bool subghz_protocol_decoder_faac_slh_serialize(
  46. void* context,
  47. FlipperFormat* flipper_format,
  48. SubGhzRadioPreset* preset);
  49. /**
  50. * Deserialize data SubGhzProtocolDecoderFaacSLH.
  51. * @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
  52. * @param flipper_format Pointer to a FlipperFormat instance
  53. * @return true On success
  54. */
  55. bool subghz_protocol_decoder_faac_slh_deserialize(void* context, FlipperFormat* flipper_format);
  56. /**
  57. * Getting a textual representation of the received data.
  58. * @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
  59. * @param output Resulting text
  60. */
  61. void subghz_protocol_decoder_faac_slh_get_string(void* context, FuriString* output);