subghz_read_raw.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include <gui/view.h>
  3. #include "../helpers/subghz_custom_event.h"
  4. #define SUBGHZ_RAW_TRESHOLD_MIN -90.0f
  5. typedef struct SubGhzReadRAW SubGhzReadRAW;
  6. typedef void (*SubGhzReadRAWCallback)(SubGhzCustomEvent event, void* context);
  7. typedef enum {
  8. SubGhzReadRAWStatusStart,
  9. SubGhzReadRAWStatusIDLE,
  10. SubGhzReadRAWStatusREC,
  11. SubGhzReadRAWStatusTX,
  12. SubGhzReadRAWStatusTXRepeat,
  13. SubGhzReadRAWStatusLoadKeyIDLE,
  14. SubGhzReadRAWStatusLoadKeyTX,
  15. SubGhzReadRAWStatusLoadKeyTXRepeat,
  16. SubGhzReadRAWStatusSaveKey,
  17. } SubGhzReadRAWStatus;
  18. void subghz_read_raw_set_callback(
  19. SubGhzReadRAW* subghz_read_raw,
  20. SubGhzReadRAWCallback callback,
  21. void* context);
  22. SubGhzReadRAW* subghz_read_raw_alloc();
  23. void subghz_read_raw_free(SubGhzReadRAW* subghz_static);
  24. void subghz_read_raw_add_data_statusbar(
  25. SubGhzReadRAW* instance,
  26. const char* frequency_str,
  27. const char* preset_str);
  28. void subghz_read_raw_update_sample_write(SubGhzReadRAW* instance, size_t sample);
  29. void subghz_read_raw_stop_send(SubGhzReadRAW* instance);
  30. void subghz_read_raw_update_sin(SubGhzReadRAW* instance);
  31. void subghz_read_raw_add_data_rssi(SubGhzReadRAW* instance, float rssi, bool trace);
  32. void subghz_read_raw_set_status(
  33. SubGhzReadRAW* instance,
  34. SubGhzReadRAWStatus status,
  35. const char* file_name,
  36. float raw_threshold_rssi);
  37. View* subghz_read_raw_get_view(SubGhzReadRAW* subghz_static);