subghz.c 584 B

123456789101112131415161718192021222324252627282930313233
  1. /* Reduced variant of the Flipper Zero SubGhz Class */
  2. #include "subghz_i.h"
  3. static SubGhz* subghz_alloc() {
  4. SubGhz* subghz = malloc(sizeof(SubGhz));
  5. subghz->file_path = furi_string_alloc();
  6. subghz->txrx = subghz_txrx_alloc();
  7. return subghz;
  8. }
  9. static void subghz_free(SubGhz* subghz) {
  10. //TxRx
  11. subghz_txrx_free(subghz->txrx);
  12. // Furi strings
  13. furi_string_free(subghz->file_path);
  14. // The rest
  15. free(subghz);
  16. }
  17. void subghz_send(void* context) {
  18. UNUSED(context);
  19. SubGhz* subghz = subghz_alloc();
  20. subghz_free(subghz);
  21. }