ido.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #pragma once
  2. #include "base.h"
  3. #define SUBGHZ_PROTOCOL_IDO_NAME "iDo 117/111"
  4. typedef struct SubGhzProtocolDecoderIDo SubGhzProtocolDecoderIDo;
  5. typedef struct SubGhzProtocolEncoderIDo SubGhzProtocolEncoderIDo;
  6. extern const SubGhzProtocolDecoder subghz_protocol_ido_decoder;
  7. extern const SubGhzProtocolEncoder subghz_protocol_ido_encoder;
  8. extern const SubGhzProtocol subghz_protocol_ido;
  9. /**
  10. * Allocate SubGhzProtocolDecoderIDo.
  11. * @param environment Pointer to a SubGhzEnvironment instance
  12. * @return SubGhzProtocolDecoderIDo* pointer to a SubGhzProtocolDecoderIDo instance
  13. */
  14. void* subghz_protocol_decoder_ido_alloc(SubGhzEnvironment* environment);
  15. /**
  16. * Free SubGhzProtocolDecoderIDo.
  17. * @param context Pointer to a SubGhzProtocolDecoderIDo instance
  18. */
  19. void subghz_protocol_decoder_ido_free(void* context);
  20. /**
  21. * Reset decoder SubGhzProtocolDecoderIDo.
  22. * @param context Pointer to a SubGhzProtocolDecoderIDo instance
  23. */
  24. void subghz_protocol_decoder_ido_reset(void* context);
  25. /**
  26. * Parse a raw sequence of levels and durations received from the air.
  27. * @param context Pointer to a SubGhzProtocolDecoderIDo 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_ido_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 SubGhzProtocolDecoderIDo instance
  35. * @return hash Hash sum
  36. */
  37. uint8_t subghz_protocol_decoder_ido_get_hash_data(void* context);
  38. /**
  39. * Serialize data SubGhzProtocolDecoderIDo.
  40. * @param context Pointer to a SubGhzProtocolDecoderIDo instance
  41. * @param flipper_format Pointer to a FlipperFormat instance
  42. * @param frequency The frequency at which the signal was received, Hz
  43. * @param preset The modulation on which the signal was received, FuriHalSubGhzPreset
  44. * @return true On success
  45. */
  46. bool subghz_protocol_decoder_ido_serialize(
  47. void* context,
  48. FlipperFormat* flipper_format,
  49. uint32_t frequency,
  50. FuriHalSubGhzPreset preset);
  51. /**
  52. * Deserialize data SubGhzProtocolDecoderIDo.
  53. * @param context Pointer to a SubGhzProtocolDecoderIDo instance
  54. * @param flipper_format Pointer to a FlipperFormat instance
  55. * @return true On success
  56. */
  57. bool subghz_protocol_decoder_ido_deserialize(void* context, FlipperFormat* flipper_format);
  58. /**
  59. * Getting a textual representation of the received data.
  60. * @param context Pointer to a SubGhzProtocolDecoderIDo instance
  61. * @param output Resulting text
  62. */
  63. void subghz_protocol_decoder_ido_get_string(void* context, string_t output);