came_atomo.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #pragma once
  2. #include "base.h"
  3. #define SUBGHZ_PROTOCOL_CAME_ATOMO_NAME "CAME Atomo"
  4. typedef struct SubGhzProtocolDecoderCameAtomo SubGhzProtocolDecoderCameAtomo;
  5. typedef struct SubGhzProtocolEncoderCameAtomo SubGhzProtocolEncoderCameAtomo;
  6. extern const SubGhzProtocolDecoder subghz_protocol_came_atomo_decoder;
  7. extern const SubGhzProtocolEncoder subghz_protocol_came_atomo_encoder;
  8. extern const SubGhzProtocol subghz_protocol_came_atomo;
  9. /**
  10. * Allocate SubGhzProtocolDecoderCameAtomo.
  11. * @param environment Pointer to a SubGhzEnvironment instance
  12. * @return SubGhzProtocolDecoderCameAtomo* pointer to a SubGhzProtocolDecoderCameAtomo instance
  13. */
  14. void* subghz_protocol_decoder_came_atomo_alloc(SubGhzEnvironment* environment);
  15. /**
  16. * Free SubGhzProtocolDecoderCameAtomo.
  17. * @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
  18. */
  19. void subghz_protocol_decoder_came_atomo_free(void* context);
  20. /**
  21. * Reset decoder SubGhzProtocolDecoderCameAtomo.
  22. * @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
  23. */
  24. void subghz_protocol_decoder_came_atomo_reset(void* context);
  25. /**
  26. * Parse a raw sequence of levels and durations received from the air.
  27. * @param context Pointer to a SubGhzProtocolDecoderCameAtomo 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_came_atomo_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 SubGhzProtocolDecoderCameAtomo instance
  35. * @return hash Hash sum
  36. */
  37. uint8_t subghz_protocol_decoder_came_atomo_get_hash_data(void* context);
  38. /**
  39. * Serialize data SubGhzProtocolDecoderCameAtomo.
  40. * @param context Pointer to a SubGhzProtocolDecoderCameAtomo 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_came_atomo_serialize(
  47. void* context,
  48. FlipperFormat* flipper_format,
  49. uint32_t frequency,
  50. FuriHalSubGhzPreset preset);
  51. /**
  52. * Deserialize data SubGhzProtocolDecoderCameAtomo.
  53. * @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
  54. * @param flipper_format Pointer to a FlipperFormat instance
  55. * @return true On success
  56. */
  57. bool subghz_protocol_decoder_came_atomo_deserialize(void* context, FlipperFormat* flipper_format);
  58. /**
  59. * Getting a textual representation of the received data.
  60. * @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
  61. * @param output Resulting text
  62. */
  63. void subghz_protocol_decoder_came_atomo_get_string(void* context, string_t output);