pcsg_generic.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <stddef.h>
  5. #include <lib/flipper_format/flipper_format.h>
  6. #include "furi.h"
  7. #include "furi_hal.h"
  8. #include <lib/subghz/types.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef struct PCSGBlockGeneric PCSGBlockGeneric;
  13. struct PCSGBlockGeneric {
  14. const char* protocol_name;
  15. FuriString* result_ric;
  16. FuriString* result_msg;
  17. };
  18. /**
  19. * Get name preset.
  20. * @param preset_name name preset
  21. * @param preset_str Output name preset
  22. */
  23. void pcsg_block_generic_get_preset_name(const char* preset_name, FuriString* preset_str);
  24. /**
  25. * Serialize data PCSGBlockGeneric.
  26. * @param instance Pointer to a PCSGBlockGeneric instance
  27. * @param flipper_format Pointer to a FlipperFormat instance
  28. * @param preset The modulation on which the signal was received, SubGhzRadioPreset
  29. * @return true On success
  30. */
  31. SubGhzProtocolStatus pcsg_block_generic_serialize(
  32. PCSGBlockGeneric* instance,
  33. FlipperFormat* flipper_format,
  34. SubGhzRadioPreset* preset);
  35. /**
  36. * Deserialize data PCSGBlockGeneric.
  37. * @param instance Pointer to a PCSGBlockGeneric instance
  38. * @param flipper_format Pointer to a FlipperFormat instance
  39. * @return true On success
  40. */
  41. SubGhzProtocolStatus
  42. pcsg_block_generic_deserialize(PCSGBlockGeneric* instance, FlipperFormat* flipper_format);
  43. float pcsg_block_generic_fahrenheit_to_celsius(float fahrenheit);
  44. #ifdef __cplusplus
  45. }
  46. #endif