nice_flo.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #pragma once
  2. #include "base.h"
  3. #define SUBGHZ_PROTOCOL_NICE_FLO_NAME "Nice FLO"
  4. typedef struct SubGhzProtocolDecoderNiceFlo SubGhzProtocolDecoderNiceFlo;
  5. typedef struct SubGhzProtocolEncoderNiceFlo SubGhzProtocolEncoderNiceFlo;
  6. extern const SubGhzProtocolDecoder subghz_protocol_nice_flo_decoder;
  7. extern const SubGhzProtocolEncoder subghz_protocol_nice_flo_encoder;
  8. extern const SubGhzProtocol subghz_protocol_nice_flo;
  9. /**
  10. * Allocate SubGhzProtocolEncoderNiceFlo.
  11. * @param environment Pointer to a SubGhzEnvironment instance
  12. * @return SubGhzProtocolEncoderNiceFlo* pointer to a SubGhzProtocolEncoderNiceFlo instance
  13. */
  14. void* subghz_protocol_encoder_nice_flo_alloc(SubGhzEnvironment* environment);
  15. /**
  16. * Free SubGhzProtocolEncoderNiceFlo.
  17. * @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
  18. */
  19. void subghz_protocol_encoder_nice_flo_free(void* context);
  20. /**
  21. * Deserialize and generating an upload to send.
  22. * @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
  23. * @param flipper_format Pointer to a FlipperFormat instance
  24. * @return true On success
  25. */
  26. bool subghz_protocol_encoder_nice_flo_deserialize(void* context, FlipperFormat* flipper_format);
  27. /**
  28. * Forced transmission stop.
  29. * @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
  30. */
  31. void subghz_protocol_encoder_nice_flo_stop(void* context);
  32. /**
  33. * Getting the level and duration of the upload to be loaded into DMA.
  34. * @param context Pointer to a SubGhzProtocolEncoderNiceFlo instance
  35. * @return LevelDuration
  36. */
  37. LevelDuration subghz_protocol_encoder_nice_flo_yield(void* context);
  38. /**
  39. * Allocate SubGhzProtocolDecoderNiceFlo.
  40. * @param environment Pointer to a SubGhzEnvironment instance
  41. * @return SubGhzProtocolDecoderNiceFlo* pointer to a SubGhzProtocolDecoderNiceFlo instance
  42. */
  43. void* subghz_protocol_decoder_nice_flo_alloc(SubGhzEnvironment* environment);
  44. /**
  45. * Free SubGhzProtocolDecoderNiceFlo.
  46. * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
  47. */
  48. void subghz_protocol_decoder_nice_flo_free(void* context);
  49. /**
  50. * Reset decoder SubGhzProtocolDecoderNiceFlo.
  51. * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
  52. */
  53. void subghz_protocol_decoder_nice_flo_reset(void* context);
  54. /**
  55. * Parse a raw sequence of levels and durations received from the air.
  56. * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
  57. * @param level Signal level true-high false-low
  58. * @param duration Duration of this level in, us
  59. */
  60. void subghz_protocol_decoder_nice_flo_feed(void* context, bool level, uint32_t duration);
  61. /**
  62. * Getting the hash sum of the last randomly received parcel.
  63. * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
  64. * @return hash Hash sum
  65. */
  66. uint8_t subghz_protocol_decoder_nice_flo_get_hash_data(void* context);
  67. /**
  68. * Serialize data SubGhzProtocolDecoderNiceFlo.
  69. * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
  70. * @param flipper_format Pointer to a FlipperFormat instance
  71. * @param frequency The frequency at which the signal was received, Hz
  72. * @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
  73. * @return true On success
  74. */
  75. bool subghz_protocol_decoder_nice_flo_serialize(
  76. void* context,
  77. FlipperFormat* flipper_format,
  78. uint32_t frequency,
  79. FuriHalSubGhzPreset preset);
  80. /**
  81. * Deserialize data SubGhzProtocolDecoderNiceFlo.
  82. * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
  83. * @param flipper_format Pointer to a FlipperFormat instance
  84. * @return true On success
  85. */
  86. bool subghz_protocol_decoder_nice_flo_deserialize(void* context, FlipperFormat* flipper_format);
  87. /**
  88. * Getting a textual representation of the received data.
  89. * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance
  90. * @param output Resulting text
  91. */
  92. void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output);