kia.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "base.h"
  3. #define SUBGHZ_PROTOCOL_KIA_NAME "KIA Seed"
  4. typedef struct SubGhzProtocolDecoderKIA SubGhzProtocolDecoderKIA;
  5. typedef struct SubGhzProtocolEncoderKIA SubGhzProtocolEncoderKIA;
  6. extern const SubGhzProtocolDecoder subghz_protocol_kia_decoder;
  7. extern const SubGhzProtocolEncoder subghz_protocol_kia_encoder;
  8. extern const SubGhzProtocol subghz_protocol_kia;
  9. /**
  10. * Allocate SubGhzProtocolDecoderKIA.
  11. * @param environment Pointer to a SubGhzEnvironment instance
  12. * @return SubGhzProtocolDecoderKIA* pointer to a SubGhzProtocolDecoderKIA instance
  13. */
  14. void* subghz_protocol_decoder_kia_alloc(SubGhzEnvironment* environment);
  15. /**
  16. * Free SubGhzProtocolDecoderKIA.
  17. * @param context Pointer to a SubGhzProtocolDecoderKIA instance
  18. */
  19. void subghz_protocol_decoder_kia_free(void* context);
  20. /**
  21. * Reset decoder SubGhzProtocolDecoderKIA.
  22. * @param context Pointer to a SubGhzProtocolDecoderKIA instance
  23. */
  24. void subghz_protocol_decoder_kia_reset(void* context);
  25. /**
  26. * Parse a raw sequence of levels and durations received from the air.
  27. * @param context Pointer to a SubGhzProtocolDecoderKIA 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_kia_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 SubGhzProtocolDecoderKIA instance
  35. * @return hash Hash sum
  36. */
  37. uint8_t subghz_protocol_decoder_kia_get_hash_data(void* context);
  38. /**
  39. * Serialize data SubGhzProtocolDecoderKIA.
  40. * @param context Pointer to a SubGhzProtocolDecoderKIA instance
  41. * @param flipper_format Pointer to a FlipperFormat instance
  42. * @param preset The modulation on which the signal was received, SubGhzRadioPreset
  43. * @return true On success
  44. */
  45. bool subghz_protocol_decoder_kia_serialize(
  46. void* context,
  47. FlipperFormat* flipper_format,
  48. SubGhzRadioPreset* preset);
  49. /**
  50. * Deserialize data SubGhzProtocolDecoderKIA.
  51. * @param context Pointer to a SubGhzProtocolDecoderKIA instance
  52. * @param flipper_format Pointer to a FlipperFormat instance
  53. * @return true On success
  54. */
  55. bool subghz_protocol_decoder_kia_deserialize(void* context, FlipperFormat* flipper_format);
  56. /**
  57. * Getting a textual representation of the received data.
  58. * @param context Pointer to a SubGhzProtocolDecoderKIA instance
  59. * @param output Resulting text
  60. */
  61. void subghz_protocol_decoder_kia_get_string(void* context, FuriString* output);