unleashed-firmware/applications/main/subghz/subghz_i.h

136 lines
3.7 KiB
C
Raw Normal View History

#pragma once
#include "helpers/subghz_types.h"
#include "helpers/subghz_error_type.h"
#include <lib/subghz/types.h>
#include "subghz.h"
#include "views/receiver.h"
#include "views/transmitter.h"
#include "views/subghz_frequency_analyzer.h"
#include "views/subghz_read_raw.h"
#include <gui/gui.h>
#include <assets_icons.h>
#include <dialogs/dialogs.h>
2021-08-12 14:42:56 +00:00
#include <gui/scene_manager.h>
#include <notification/notification_messages.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/submenu.h>
2021-08-12 14:42:56 +00:00
#include <gui/modules/popup.h>
#include <gui/modules/text_input.h>
2022-04-10 19:47:37 +00:00
#include <gui/modules/byte_input.h>
#include <gui/modules/widget.h>
2021-08-12 14:42:56 +00:00
#include <subghz/scenes/subghz_scene.h>
#include <lib/subghz/subghz_worker.h>
#include <lib/subghz/subghz_file_encoder_worker.h>
#include <lib/subghz/subghz_setting.h>
#include <lib/subghz/receiver.h>
#include <lib/subghz/transmitter.h>
Skorp subghz signal archive (#667) * SubGhz: Add millis() furi, add subghz history struct * SubGhz: Fix subghz history * Gubghz: Fix code repeat history, add clean history * SubGhz: reading and adding keys to history * Gui: Renaming Sub 1-Ghz -> SubGhz * Archive: Renaming Sub 1-Ghz -> SubGhz * SubGhz: Add menu history, modified button for sending a signal, changed output of data about accepted protocol * Archive: Fix name subghz * SubGhz: Menu navigation * Assets: Add assets/SubGHz/icon.png * Assets: add new icons for subghz * SubGhz: Fix name Add manually scene * SubGhz: Fix load icon Read scene. rename encoder struct, rename protocol function load from file, add load raw data protocol, add info pleasant signals all protocol * SubGhz: fix memory leak * SubGhz: change of receiving frequency for read scene * SubGhz: Add save/load frequency and preset, add automatic configuration of transmit/receive to the desired frequency and modulation, add button "save" config scene * SubGhz: Fix frequency and preset, fix frequency add manualli scene, fix re-executing the parser * Furi-hal-subghz: add 2-FSK config, fix ook config 650KHz BW Tx filter * Fix formatting and release build * SubGhz: Delete read scene * SubGhz: Fix frequency add manualli scene, refactoring code * SubGhz: 2 profiles for OOK, fix broken build. * SubGhz: Add passing static codes from read scene, add notification read scene, refactoring code * SubGhz: fix assert on worker double stop. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-28 13:51:48 +00:00
#include "subghz_history.h"
2022-09-27 22:01:09 +00:00
#include "subghz_last_settings.h"
2021-08-12 14:42:56 +00:00
#include <gui/modules/variable_item_list.h>
#include <lib/toolbox/path.h>
#include "rpc/rpc_app.h"
2023-05-05 23:00:26 +00:00
#include "helpers/subghz_threshold_rssi.h"
2023-05-09 16:10:56 +00:00
#include "helpers/subghz_txrx.h"
2022-06-01 13:07:53 +00:00
#define SUBGHZ_MAX_LEN_NAME 64
#define SUBGHZ_EXT_PRESET_NAME true
#define SUBGHZ_RAW_THRESHOLD_MIN (-90.0f)
#define SUBGHZ_MEASURE_LOADING false
2022-04-12 11:57:53 +00:00
typedef struct {
2022-04-18 21:32:25 +00:00
uint8_t fix[4];
2023-08-22 17:22:49 +00:00
uint8_t cnt[4];
2022-04-20 19:23:45 +00:00
uint8_t seed[4];
} SecureData;
2022-04-18 21:32:25 +00:00
struct SubGhz {
Gui* gui;
NotificationApp* notifications;
SubGhzTxRx* txrx;
2021-08-12 14:42:56 +00:00
SceneManager* scene_manager;
ViewDispatcher* view_dispatcher;
Submenu* submenu;
2021-08-12 14:42:56 +00:00
Popup* popup;
TextInput* text_input;
2022-04-10 19:47:37 +00:00
ByteInput* byte_input;
Widget* widget;
DialogsApp* dialogs;
FuriString* file_path;
FuriString* file_path_tmp;
2022-06-01 13:07:53 +00:00
char file_name_tmp[SUBGHZ_MAX_LEN_NAME];
SubGhzNotificationState state_notifications;
SubGhzViewReceiver* subghz_receiver;
SubGhzViewTransmitter* subghz_transmitter;
VariableItemList* variable_item_list;
SubGhzFrequencyAnalyzer* subghz_frequency_analyzer;
SubGhzReadRAW* subghz_read_raw;
bool raw_send_only;
2023-07-06 15:54:39 +00:00
bool save_datetime_set;
DateTime save_datetime;
2022-09-27 22:01:09 +00:00
SubGhzLastSettings* last_settings;
2023-05-09 12:58:56 +00:00
SubGhzProtocolFlag filter;
SubGhzProtocolFlag ignore_filter;
FuriString* error_str;
2022-07-03 18:01:23 +00:00
SubGhzLock lock;
SecureData* secure_data;
SubGhzFileEncoderWorker* decode_raw_file_worker_encoder;
2023-05-05 23:00:26 +00:00
SubGhzThresholdRssi* threshold_rssi;
SubGhzRxKeyState rx_key_state;
2023-05-09 12:11:54 +00:00
SubGhzHistory* history;
2023-05-05 23:00:26 +00:00
uint16_t idx_menu_chosen;
SubGhzLoadTypeFile load_type_file;
void* rpc_ctx;
};
2023-05-09 16:10:56 +00:00
void subghz_blink_start(SubGhz* subghz);
void subghz_blink_stop(SubGhz* subghz);
2023-05-09 16:50:01 +00:00
bool subghz_tx_start(SubGhz* subghz, FlipperFormat* flipper_format);
void subghz_dialog_message_freq_error(SubGhz* subghz, bool only_rx);
2023-05-09 16:33:45 +00:00
bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog);
bool subghz_get_next_name_file(SubGhz* subghz, uint8_t max_len);
bool subghz_save_protocol_to_file(
SubGhz* subghz,
FlipperFormat* flipper_format,
const char* dev_file_name);
void subghz_save_to_file(void* context);
Skorp subghz signal archive (#667) * SubGhz: Add millis() furi, add subghz history struct * SubGhz: Fix subghz history * Gubghz: Fix code repeat history, add clean history * SubGhz: reading and adding keys to history * Gui: Renaming Sub 1-Ghz -> SubGhz * Archive: Renaming Sub 1-Ghz -> SubGhz * SubGhz: Add menu history, modified button for sending a signal, changed output of data about accepted protocol * Archive: Fix name subghz * SubGhz: Menu navigation * Assets: Add assets/SubGHz/icon.png * Assets: add new icons for subghz * SubGhz: Fix name Add manually scene * SubGhz: Fix load icon Read scene. rename encoder struct, rename protocol function load from file, add load raw data protocol, add info pleasant signals all protocol * SubGhz: fix memory leak * SubGhz: change of receiving frequency for read scene * SubGhz: Add save/load frequency and preset, add automatic configuration of transmit/receive to the desired frequency and modulation, add button "save" config scene * SubGhz: Fix frequency and preset, fix frequency add manualli scene, fix re-executing the parser * Furi-hal-subghz: add 2-FSK config, fix ook config 650KHz BW Tx filter * Fix formatting and release build * SubGhz: Delete read scene * SubGhz: Fix frequency add manualli scene, refactoring code * SubGhz: 2 profiles for OOK, fix broken build. * SubGhz: Add passing static codes from read scene, add notification read scene, refactoring code * SubGhz: fix assert on worker double stop. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-28 13:51:48 +00:00
bool subghz_load_protocol_from_file(SubGhz* subghz);
bool subghz_rename_file(SubGhz* subghz);
bool subghz_file_available(SubGhz* subghz);
bool subghz_delete_file(SubGhz* subghz);
void subghz_file_name_clear(SubGhz* subghz);
bool subghz_path_is_file(FuriString* path);
2023-05-09 16:33:45 +00:00
SubGhzLoadTypeFile subghz_get_load_type_file(SubGhz* subghz);
2023-05-06 13:36:15 +00:00
void subghz_lock(SubGhz* subghz);
void subghz_unlock(SubGhz* subghz);
bool subghz_is_locked(SubGhz* subghz);
void subghz_rx_key_state_set(SubGhz* subghz, SubGhzRxKeyState state);
SubGhzRxKeyState subghz_rx_key_state_get(SubGhz* subghz);
extern const NotificationSequence subghz_sequence_rx;
extern const NotificationSequence subghz_sequence_rx_locked;