2021-10-27 20:37:11 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gui/view.h>
|
|
|
|
#include "../helpers/subghz_custom_event.h"
|
|
|
|
|
2023-02-20 18:55:53 +03:00
|
|
|
#define SUBGHZ_RAW_THRESHOLD_MIN -90.0f
|
2022-10-26 18:13:00 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
typedef struct SubGhzReadRAW SubGhzReadRAW;
|
2021-10-27 20:37:11 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
typedef void (*SubGhzReadRAWCallback)(SubGhzCustomEvent event, void* context);
|
2021-10-27 20:37:11 +03:00
|
|
|
|
2021-11-24 16:59:45 +03:00
|
|
|
typedef enum {
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzReadRAWStatusStart,
|
|
|
|
SubGhzReadRAWStatusIDLE,
|
|
|
|
SubGhzReadRAWStatusREC,
|
|
|
|
SubGhzReadRAWStatusTX,
|
|
|
|
SubGhzReadRAWStatusTXRepeat,
|
|
|
|
|
|
|
|
SubGhzReadRAWStatusLoadKeyIDLE,
|
|
|
|
SubGhzReadRAWStatusLoadKeyTX,
|
|
|
|
SubGhzReadRAWStatusLoadKeyTXRepeat,
|
|
|
|
SubGhzReadRAWStatusSaveKey,
|
|
|
|
} SubGhzReadRAWStatus;
|
2021-11-24 16:59:45 +03:00
|
|
|
|
2021-10-27 20:37:11 +03:00
|
|
|
void subghz_read_raw_set_callback(
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzReadRAW* subghz_read_raw,
|
|
|
|
SubGhzReadRAWCallback callback,
|
2021-10-27 20:37:11 +03:00
|
|
|
void* context);
|
|
|
|
|
2022-10-02 08:50:41 +03:00
|
|
|
SubGhzReadRAW* subghz_read_raw_alloc(bool raw_send_only);
|
2021-10-27 20:37:11 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_read_raw_free(SubGhzReadRAW* subghz_static);
|
2021-10-27 20:37:11 +03:00
|
|
|
|
|
|
|
void subghz_read_raw_add_data_statusbar(
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzReadRAW* instance,
|
2021-10-27 20:37:11 +03:00
|
|
|
const char* frequency_str,
|
|
|
|
const char* preset_str);
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_read_raw_update_sample_write(SubGhzReadRAW* instance, size_t sample);
|
2021-10-27 20:37:11 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_read_raw_stop_send(SubGhzReadRAW* instance);
|
2021-11-24 16:59:45 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_read_raw_update_sin(SubGhzReadRAW* instance);
|
2021-11-24 16:59:45 +03:00
|
|
|
|
2022-10-26 18:13:00 +03:00
|
|
|
void subghz_read_raw_add_data_rssi(SubGhzReadRAW* instance, float rssi, bool trace);
|
2021-10-27 20:37:11 +03:00
|
|
|
|
2021-12-08 18:00:54 +03:00
|
|
|
void subghz_read_raw_set_status(
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzReadRAW* instance,
|
2022-07-25 17:35:02 +03:00
|
|
|
SubGhzReadRAWStatus status,
|
2022-10-26 18:13:00 +03:00
|
|
|
const char* file_name,
|
|
|
|
float raw_threshold_rssi);
|
2021-11-24 16:59:45 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
View* subghz_read_raw_get_view(SubGhzReadRAW* subghz_static);
|