lacrosse_tx141thbv2.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma once
  2. #include <lib/subghz/protocols/base.h>
  3. #include <lib/subghz/blocks/const.h>
  4. #include <lib/subghz/blocks/decoder.h>
  5. #include <lib/subghz/blocks/encoder.h>
  6. #include "ws_generic.h"
  7. #include <lib/subghz/blocks/math.h>
  8. #define WS_PROTOCOL_LACROSSE_TX141THBV2_NAME "TX141THBv2"
  9. typedef struct WSProtocolDecoderLaCrosse_TX141THBv2 WSProtocolDecoderLaCrosse_TX141THBv2;
  10. typedef struct WSProtocolEncoderLaCrosse_TX141THBv2 WSProtocolEncoderLaCrosse_TX141THBv2;
  11. extern const SubGhzProtocolDecoder ws_protocol_lacrosse_tx141thbv2_decoder;
  12. extern const SubGhzProtocolEncoder ws_protocol_lacrosse_tx141thbv2_encoder;
  13. extern const SubGhzProtocol ws_protocol_lacrosse_tx141thbv2;
  14. /**
  15. * Allocate WSProtocolDecoderLaCrosse_TX141THBv2.
  16. * @param environment Pointer to a SubGhzEnvironment instance
  17. * @return WSProtocolDecoderLaCrosse_TX141THBv2* pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  18. */
  19. void* ws_protocol_decoder_lacrosse_tx141thbv2_alloc(SubGhzEnvironment* environment);
  20. /**
  21. * Free WSProtocolDecoderLaCrosse_TX141THBv2.
  22. * @param context Pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  23. */
  24. void ws_protocol_decoder_lacrosse_tx141thbv2_free(void* context);
  25. /**
  26. * Reset decoder WSProtocolDecoderLaCrosse_TX141THBv2.
  27. * @param context Pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  28. */
  29. void ws_protocol_decoder_lacrosse_tx141thbv2_reset(void* context);
  30. /**
  31. * Parse a raw sequence of levels and durations received from the air.
  32. * @param context Pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  33. * @param level Signal level true-high false-low
  34. * @param duration Duration of this level in, us
  35. */
  36. void ws_protocol_decoder_lacrosse_tx141thbv2_feed(void* context, bool level, uint32_t duration);
  37. /**
  38. * Getting the hash sum of the last randomly received parcel.
  39. * @param context Pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  40. * @return hash Hash sum
  41. */
  42. uint8_t ws_protocol_decoder_lacrosse_tx141thbv2_get_hash_data(void* context);
  43. /**
  44. * Serialize data WSProtocolDecoderLaCrosse_TX141THBv2.
  45. * @param context Pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  46. * @param flipper_format Pointer to a FlipperFormat instance
  47. * @param preset The modulation on which the signal was received, SubGhzRadioPreset
  48. * @return status
  49. */
  50. SubGhzProtocolStatus ws_protocol_decoder_lacrosse_tx141thbv2_serialize(
  51. void* context,
  52. FlipperFormat* flipper_format,
  53. SubGhzRadioPreset* preset);
  54. /**
  55. * Deserialize data WSProtocolDecoderLaCrosse_TX141THBv2.
  56. * @param context Pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  57. * @param flipper_format Pointer to a FlipperFormat instance
  58. * @return status
  59. */
  60. SubGhzProtocolStatus ws_protocol_decoder_lacrosse_tx141thbv2_deserialize(
  61. void* context,
  62. FlipperFormat* flipper_format);
  63. /**
  64. * Getting a textual representation of the received data.
  65. * @param context Pointer to a WSProtocolDecoderLaCrosse_TX141THBv2 instance
  66. * @param output Resulting text
  67. */
  68. void ws_protocol_decoder_lacrosse_tx141thbv2_get_string(void* context, FuriString* output);