alutech_at_4n.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #pragma once
  2. #include "base.h"
  3. #define SUBGHZ_PROTOCOL_ALUTECH_AT_4N_NAME "Alutech at-4n"
  4. typedef struct SubGhzProtocolDecoderAlutech_at_4n SubGhzProtocolDecoderAlutech_at_4n;
  5. typedef struct SubGhzProtocolEncoderAlutech_at_4n SubGhzProtocolEncoderAlutech_at_4n;
  6. extern const SubGhzProtocolDecoder subghz_protocol_alutech_at_4n_decoder;
  7. extern const SubGhzProtocolEncoder subghz_protocol_alutech_at_4n_encoder;
  8. extern const SubGhzProtocol subghz_protocol_alutech_at_4n;
  9. /**
  10. * Allocate SubGhzProtocolDecoderAlutech_at_4n.
  11. * @param environment Pointer to a SubGhzEnvironment instance
  12. * @return SubGhzProtocolDecoderAlutech_at_4n* pointer to a SubGhzProtocolDecoderAlutech_at_4n instance
  13. */
  14. void* subghz_protocol_decoder_alutech_at_4n_alloc(SubGhzEnvironment* environment);
  15. /**
  16. * Free SubGhzProtocolDecoderAlutech_at_4n.
  17. * @param context Pointer to a SubGhzProtocolDecoderAlutech_at_4n instance
  18. */
  19. void subghz_protocol_decoder_alutech_at_4n_free(void* context);
  20. /**
  21. * Reset decoder SubGhzProtocolDecoderAlutech_at_4n.
  22. * @param context Pointer to a SubGhzProtocolDecoderAlutech_at_4n instance
  23. */
  24. void subghz_protocol_decoder_alutech_at_4n_reset(void* context);
  25. /**
  26. * Parse a raw sequence of levels and durations received from the air.
  27. * @param context Pointer to a SubGhzProtocolDecoderAlutech_at_4n 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_alutech_at_4n_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 SubGhzProtocolDecoderAlutech_at_4n instance
  35. * @return hash Hash sum
  36. */
  37. uint8_t subghz_protocol_decoder_alutech_at_4n_get_hash_data(void* context);
  38. /**
  39. * Serialize data SubGhzProtocolDecoderAlutech_at_4n.
  40. * @param context Pointer to a SubGhzProtocolDecoderAlutech_at_4n 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_alutech_at_4n_serialize(
  46. void* context,
  47. FlipperFormat* flipper_format,
  48. SubGhzRadioPreset* preset);
  49. /**
  50. * Deserialize data SubGhzProtocolDecoderAlutech_at_4n.
  51. * @param context Pointer to a SubGhzProtocolDecoderAlutech_at_4n instance
  52. * @param flipper_format Pointer to a FlipperFormat instance
  53. * @return true On success
  54. */
  55. bool subghz_protocol_decoder_alutech_at_4n_deserialize(
  56. void* context,
  57. FlipperFormat* flipper_format);
  58. /**
  59. * Getting a textual representation of the received data.
  60. * @param context Pointer to a SubGhzProtocolDecoderAlutech_at_4n instance
  61. * @param output Resulting text
  62. */
  63. void subghz_protocol_decoder_alutech_at_4n_get_string(void* context, FuriString* output);