tx_8300.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_TX_8300_NAME "TX8300"
  9. typedef struct WSProtocolDecoderTX_8300 WSProtocolDecoderTX_8300;
  10. typedef struct WSProtocolEncoderTX_8300 WSProtocolEncoderTX_8300;
  11. extern const SubGhzProtocolDecoder ws_protocol_tx_8300_decoder;
  12. extern const SubGhzProtocolEncoder ws_protocol_tx_8300_encoder;
  13. extern const SubGhzProtocol ws_protocol_tx_8300;
  14. /**
  15. * Allocate WSProtocolDecoderTX_8300.
  16. * @param environment Pointer to a SubGhzEnvironment instance
  17. * @return WSProtocolDecoderTX_8300* pointer to a WSProtocolDecoderTX_8300 instance
  18. */
  19. void* ws_protocol_decoder_tx_8300_alloc(SubGhzEnvironment* environment);
  20. /**
  21. * Free WSProtocolDecoderTX_8300.
  22. * @param context Pointer to a WSProtocolDecoderTX_8300 instance
  23. */
  24. void ws_protocol_decoder_tx_8300_free(void* context);
  25. /**
  26. * Reset decoder WSProtocolDecoderTX_8300.
  27. * @param context Pointer to a WSProtocolDecoderTX_8300 instance
  28. */
  29. void ws_protocol_decoder_tx_8300_reset(void* context);
  30. /**
  31. * Parse a raw sequence of levels and durations received from the air.
  32. * @param context Pointer to a WSProtocolDecoderTX_8300 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_tx_8300_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 WSProtocolDecoderTX_8300 instance
  40. * @return hash Hash sum
  41. */
  42. uint8_t ws_protocol_decoder_tx_8300_get_hash_data(void* context);
  43. /**
  44. * Serialize data WSProtocolDecoderTX_8300.
  45. * @param context Pointer to a WSProtocolDecoderTX_8300 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_tx_8300_serialize(
  51. void* context,
  52. FlipperFormat* flipper_format,
  53. SubGhzRadioPreset* preset);
  54. /**
  55. * Deserialize data WSProtocolDecoderTX_8300.
  56. * @param context Pointer to a WSProtocolDecoderTX_8300 instance
  57. * @param flipper_format Pointer to a FlipperFormat instance
  58. * @return status
  59. */
  60. SubGhzProtocolStatus
  61. ws_protocol_decoder_tx_8300_deserialize(void* context, FlipperFormat* flipper_format);
  62. /**
  63. * Getting a textual representation of the received data.
  64. * @param context Pointer to a WSProtocolDecoderTX_8300 instance
  65. * @param output Resulting text
  66. */
  67. void ws_protocol_decoder_tx_8300_get_string(void* context, FuriString* output);