2021-03-31 20:52:26 +03:00
|
|
|
#pragma once
|
|
|
|
|
2022-07-03 19:03:36 +03:00
|
|
|
#include "helpers/subghz_types.h"
|
2022-12-08 08:49:54 +03:00
|
|
|
#include "helpers/subghz_error_type.h"
|
2022-10-18 19:51:44 +03:00
|
|
|
#include <lib/subghz/types.h>
|
2021-03-31 20:52:26 +03:00
|
|
|
#include "subghz.h"
|
2022-03-03 12:48:56 +03:00
|
|
|
#include "views/receiver.h"
|
|
|
|
#include "views/transmitter.h"
|
2021-10-10 17:35:10 +03:00
|
|
|
#include "views/subghz_frequency_analyzer.h"
|
2021-10-27 20:37:11 +03:00
|
|
|
#include "views/subghz_read_raw.h"
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
#include <gui/gui.h>
|
2022-10-28 17:08:50 +03:00
|
|
|
#include <assets_icons.h>
|
2021-11-11 15:49:19 +03:00
|
|
|
#include <dialogs/dialogs.h>
|
[FL-1610] SubGhz: scene based application, PT save and replay (#630)
* SubGhz: scene based application
* SubGhz: encoder/decoder separation, DMA streaming, update app and cli.
* SubGhz: 2 stage async tx complete, minor cleanup
* SubGhz: 2 stage async tx complete, FIX state pin end transmit
* SubGhz: Pricenton, receive TE signal
* SubGhz: Pricenton, add save data, add load data
* SubGhz: Add Read scene, Fix pricenton save, load funtion
* SubGhz: Add Read, Receiver, SaveName scene
* SubGhz: Read and Save (pricenton)
* SubGhz: add Load scence
* SubGhz: Fix select file scene, add load scene, add transmitter view, add send tx pricenton
* SubGhz: Fix pricenton encoder, fix transmitter send
* SubGhz: modified Pricenton Encoder (added guard time at the beginning), modified CC1101 config, code refactoring
* SubGhz: Fix pricenton encoder defalut TE
* Archive: Fix path and name SubGhz
* Archive: Fix name app SubGhz
* GubGhz: Came: add Save, Load key
* GubGhz: GateTX: add Save, Load key
* GubGhz: NeroSketch: add Save, Load key
* Github: better linters triggers
* SubGhz: adding fast loading keys Archive -> Run in app
* GubGhz: KeeLog: add Save, Load key, key generation from the serial number of the meter and the button
* SubGhz: format sources and fix compilation
* FuriHal: add subghz configuration description for AGC section
* SubGhz: save only protocols that can be saved. Cleanup.
* Github: lint on pull requests
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-12 17:42:56 +03:00
|
|
|
#include <gui/scene_manager.h>
|
2022-01-05 19:10:18 +03:00
|
|
|
#include <notification/notification_messages.h>
|
2021-03-31 20:52:26 +03:00
|
|
|
#include <gui/view_dispatcher.h>
|
|
|
|
#include <gui/modules/submenu.h>
|
[FL-1610] SubGhz: scene based application, PT save and replay (#630)
* SubGhz: scene based application
* SubGhz: encoder/decoder separation, DMA streaming, update app and cli.
* SubGhz: 2 stage async tx complete, minor cleanup
* SubGhz: 2 stage async tx complete, FIX state pin end transmit
* SubGhz: Pricenton, receive TE signal
* SubGhz: Pricenton, add save data, add load data
* SubGhz: Add Read scene, Fix pricenton save, load funtion
* SubGhz: Add Read, Receiver, SaveName scene
* SubGhz: Read and Save (pricenton)
* SubGhz: add Load scence
* SubGhz: Fix select file scene, add load scene, add transmitter view, add send tx pricenton
* SubGhz: Fix pricenton encoder, fix transmitter send
* SubGhz: modified Pricenton Encoder (added guard time at the beginning), modified CC1101 config, code refactoring
* SubGhz: Fix pricenton encoder defalut TE
* Archive: Fix path and name SubGhz
* Archive: Fix name app SubGhz
* GubGhz: Came: add Save, Load key
* GubGhz: GateTX: add Save, Load key
* GubGhz: NeroSketch: add Save, Load key
* Github: better linters triggers
* SubGhz: adding fast loading keys Archive -> Run in app
* GubGhz: KeeLog: add Save, Load key, key generation from the serial number of the meter and the button
* SubGhz: format sources and fix compilation
* FuriHal: add subghz configuration description for AGC section
* SubGhz: save only protocols that can be saved. Cleanup.
* Github: lint on pull requests
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-12 17:42:56 +03:00
|
|
|
#include <gui/modules/popup.h>
|
|
|
|
#include <gui/modules/text_input.h>
|
2022-04-10 22:47:37 +03:00
|
|
|
#include <gui/modules/byte_input.h>
|
2021-09-10 03:29:57 +03:00
|
|
|
#include <gui/modules/widget.h>
|
[FL-1610] SubGhz: scene based application, PT save and replay (#630)
* SubGhz: scene based application
* SubGhz: encoder/decoder separation, DMA streaming, update app and cli.
* SubGhz: 2 stage async tx complete, minor cleanup
* SubGhz: 2 stage async tx complete, FIX state pin end transmit
* SubGhz: Pricenton, receive TE signal
* SubGhz: Pricenton, add save data, add load data
* SubGhz: Add Read scene, Fix pricenton save, load funtion
* SubGhz: Add Read, Receiver, SaveName scene
* SubGhz: Read and Save (pricenton)
* SubGhz: add Load scence
* SubGhz: Fix select file scene, add load scene, add transmitter view, add send tx pricenton
* SubGhz: Fix pricenton encoder, fix transmitter send
* SubGhz: modified Pricenton Encoder (added guard time at the beginning), modified CC1101 config, code refactoring
* SubGhz: Fix pricenton encoder defalut TE
* Archive: Fix path and name SubGhz
* Archive: Fix name app SubGhz
* GubGhz: Came: add Save, Load key
* GubGhz: GateTX: add Save, Load key
* GubGhz: NeroSketch: add Save, Load key
* Github: better linters triggers
* SubGhz: adding fast loading keys Archive -> Run in app
* GubGhz: KeeLog: add Save, Load key, key generation from the serial number of the meter and the button
* SubGhz: format sources and fix compilation
* FuriHal: add subghz configuration description for AGC section
* SubGhz: save only protocols that can be saved. Cleanup.
* Github: lint on pull requests
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-12 17:42:56 +03:00
|
|
|
|
|
|
|
#include <subghz/scenes/subghz_scene.h>
|
|
|
|
#include <lib/subghz/subghz_worker.h>
|
2022-10-09 19:45:39 +03:00
|
|
|
#include <lib/subghz/subghz_file_encoder_worker.h>
|
2022-10-18 19:51:44 +03:00
|
|
|
#include <lib/subghz/subghz_setting.h>
|
2022-03-03 12:48:56 +03:00
|
|
|
#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 16:51:48 +03:00
|
|
|
#include "subghz_history.h"
|
2022-09-28 01:01:09 +03:00
|
|
|
#include "subghz_last_settings.h"
|
[FL-1610] SubGhz: scene based application, PT save and replay (#630)
* SubGhz: scene based application
* SubGhz: encoder/decoder separation, DMA streaming, update app and cli.
* SubGhz: 2 stage async tx complete, minor cleanup
* SubGhz: 2 stage async tx complete, FIX state pin end transmit
* SubGhz: Pricenton, receive TE signal
* SubGhz: Pricenton, add save data, add load data
* SubGhz: Add Read scene, Fix pricenton save, load funtion
* SubGhz: Add Read, Receiver, SaveName scene
* SubGhz: Read and Save (pricenton)
* SubGhz: add Load scence
* SubGhz: Fix select file scene, add load scene, add transmitter view, add send tx pricenton
* SubGhz: Fix pricenton encoder, fix transmitter send
* SubGhz: modified Pricenton Encoder (added guard time at the beginning), modified CC1101 config, code refactoring
* SubGhz: Fix pricenton encoder defalut TE
* Archive: Fix path and name SubGhz
* Archive: Fix name app SubGhz
* GubGhz: Came: add Save, Load key
* GubGhz: GateTX: add Save, Load key
* GubGhz: NeroSketch: add Save, Load key
* Github: better linters triggers
* SubGhz: adding fast loading keys Archive -> Run in app
* GubGhz: KeeLog: add Save, Load key, key generation from the serial number of the meter and the button
* SubGhz: format sources and fix compilation
* FuriHal: add subghz configuration description for AGC section
* SubGhz: save only protocols that can be saved. Cleanup.
* Github: lint on pull requests
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-12 17:42:56 +03:00
|
|
|
|
2022-01-05 19:10:18 +03:00
|
|
|
#include <gui/modules/variable_item_list.h>
|
2022-04-21 19:10:50 +03:00
|
|
|
#include <lib/toolbox/path.h>
|
2021-09-10 03:29:57 +03:00
|
|
|
|
2022-07-04 16:09:46 +03:00
|
|
|
#include "rpc/rpc_app.h"
|
|
|
|
|
2023-05-06 02:00:26 +03:00
|
|
|
#include "helpers/subghz_threshold_rssi.h"
|
|
|
|
|
2023-05-09 19:10:56 +03:00
|
|
|
#include "helpers/subghz_txrx.h"
|
2023-05-09 12:07:36 +03:00
|
|
|
|
2024-07-15 20:02:45 +03:00
|
|
|
#define SUBGHZ_MAX_LEN_NAME 64
|
|
|
|
#define SUBGHZ_EXT_PRESET_NAME true
|
2023-08-08 16:31:46 +03:00
|
|
|
#define SUBGHZ_RAW_THRESHOLD_MIN (-90.0f)
|
2024-07-15 20:02:45 +03:00
|
|
|
#define SUBGHZ_MEASURE_LOADING false
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2022-04-12 14:57:53 +03:00
|
|
|
typedef struct {
|
2022-04-19 00:32:25 +03:00
|
|
|
uint8_t fix[4];
|
2023-08-22 20:22:49 +03:00
|
|
|
uint8_t cnt[4];
|
2022-04-20 22:23:45 +03:00
|
|
|
uint8_t seed[4];
|
|
|
|
} SecureData;
|
2022-04-19 00:32:25 +03:00
|
|
|
|
2021-09-10 03:29:57 +03:00
|
|
|
struct SubGhz {
|
|
|
|
Gui* gui;
|
|
|
|
NotificationApp* notifications;
|
|
|
|
|
|
|
|
SubGhzTxRx* txrx;
|
[FL-1610] SubGhz: scene based application, PT save and replay (#630)
* SubGhz: scene based application
* SubGhz: encoder/decoder separation, DMA streaming, update app and cli.
* SubGhz: 2 stage async tx complete, minor cleanup
* SubGhz: 2 stage async tx complete, FIX state pin end transmit
* SubGhz: Pricenton, receive TE signal
* SubGhz: Pricenton, add save data, add load data
* SubGhz: Add Read scene, Fix pricenton save, load funtion
* SubGhz: Add Read, Receiver, SaveName scene
* SubGhz: Read and Save (pricenton)
* SubGhz: add Load scence
* SubGhz: Fix select file scene, add load scene, add transmitter view, add send tx pricenton
* SubGhz: Fix pricenton encoder, fix transmitter send
* SubGhz: modified Pricenton Encoder (added guard time at the beginning), modified CC1101 config, code refactoring
* SubGhz: Fix pricenton encoder defalut TE
* Archive: Fix path and name SubGhz
* Archive: Fix name app SubGhz
* GubGhz: Came: add Save, Load key
* GubGhz: GateTX: add Save, Load key
* GubGhz: NeroSketch: add Save, Load key
* Github: better linters triggers
* SubGhz: adding fast loading keys Archive -> Run in app
* GubGhz: KeeLog: add Save, Load key, key generation from the serial number of the meter and the button
* SubGhz: format sources and fix compilation
* FuriHal: add subghz configuration description for AGC section
* SubGhz: save only protocols that can be saved. Cleanup.
* Github: lint on pull requests
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-12 17:42:56 +03:00
|
|
|
|
|
|
|
SceneManager* scene_manager;
|
2021-03-31 20:52:26 +03:00
|
|
|
ViewDispatcher* view_dispatcher;
|
|
|
|
|
|
|
|
Submenu* submenu;
|
[FL-1610] SubGhz: scene based application, PT save and replay (#630)
* SubGhz: scene based application
* SubGhz: encoder/decoder separation, DMA streaming, update app and cli.
* SubGhz: 2 stage async tx complete, minor cleanup
* SubGhz: 2 stage async tx complete, FIX state pin end transmit
* SubGhz: Pricenton, receive TE signal
* SubGhz: Pricenton, add save data, add load data
* SubGhz: Add Read scene, Fix pricenton save, load funtion
* SubGhz: Add Read, Receiver, SaveName scene
* SubGhz: Read and Save (pricenton)
* SubGhz: add Load scence
* SubGhz: Fix select file scene, add load scene, add transmitter view, add send tx pricenton
* SubGhz: Fix pricenton encoder, fix transmitter send
* SubGhz: modified Pricenton Encoder (added guard time at the beginning), modified CC1101 config, code refactoring
* SubGhz: Fix pricenton encoder defalut TE
* Archive: Fix path and name SubGhz
* Archive: Fix name app SubGhz
* GubGhz: Came: add Save, Load key
* GubGhz: GateTX: add Save, Load key
* GubGhz: NeroSketch: add Save, Load key
* Github: better linters triggers
* SubGhz: adding fast loading keys Archive -> Run in app
* GubGhz: KeeLog: add Save, Load key, key generation from the serial number of the meter and the button
* SubGhz: format sources and fix compilation
* FuriHal: add subghz configuration description for AGC section
* SubGhz: save only protocols that can be saved. Cleanup.
* Github: lint on pull requests
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-12 17:42:56 +03:00
|
|
|
Popup* popup;
|
|
|
|
TextInput* text_input;
|
2022-04-10 22:47:37 +03:00
|
|
|
ByteInput* byte_input;
|
2021-09-10 03:29:57 +03:00
|
|
|
Widget* widget;
|
2021-11-11 15:49:19 +03:00
|
|
|
DialogsApp* dialogs;
|
2022-10-05 18:15:23 +03:00
|
|
|
FuriString* file_path;
|
|
|
|
FuriString* file_path_tmp;
|
2022-06-01 16:07:53 +03:00
|
|
|
char file_name_tmp[SUBGHZ_MAX_LEN_NAME];
|
2021-11-11 15:49:19 +03:00
|
|
|
SubGhzNotificationState state_notifications;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzViewReceiver* subghz_receiver;
|
|
|
|
SubGhzViewTransmitter* subghz_transmitter;
|
2021-09-10 03:29:57 +03:00
|
|
|
VariableItemList* variable_item_list;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzFrequencyAnalyzer* subghz_frequency_analyzer;
|
|
|
|
SubGhzReadRAW* subghz_read_raw;
|
2022-10-02 08:50:41 +03:00
|
|
|
bool raw_send_only;
|
2023-07-06 18:54:39 +03:00
|
|
|
|
2024-01-28 06:45:33 +03:00
|
|
|
bool save_datetime_set;
|
2024-02-15 14:08:10 +03:00
|
|
|
DateTime save_datetime;
|
2024-01-28 06:45:33 +03:00
|
|
|
|
2022-09-28 01:01:09 +03:00
|
|
|
SubGhzLastSettings* last_settings;
|
2023-05-06 17:56:10 +03:00
|
|
|
|
2023-05-09 15:58:56 +03:00
|
|
|
SubGhzProtocolFlag filter;
|
2023-06-14 01:24:05 +03:00
|
|
|
SubGhzProtocolFlag ignore_filter;
|
2023-05-06 17:56:10 +03:00
|
|
|
FuriString* error_str;
|
2022-07-03 21:01:23 +03:00
|
|
|
SubGhzLock lock;
|
2022-07-04 16:09:46 +03:00
|
|
|
|
2023-05-09 12:07:36 +03:00
|
|
|
SecureData* secure_data;
|
|
|
|
|
2022-10-09 19:45:39 +03:00
|
|
|
SubGhzFileEncoderWorker* decode_raw_file_worker_encoder;
|
|
|
|
|
2023-05-06 02:00:26 +03:00
|
|
|
SubGhzThresholdRssi* threshold_rssi;
|
2023-05-06 17:47:49 +03:00
|
|
|
SubGhzRxKeyState rx_key_state;
|
2023-05-09 15:11:54 +03:00
|
|
|
SubGhzHistory* history;
|
2023-05-06 02:00:26 +03:00
|
|
|
|
2023-05-09 12:07:36 +03:00
|
|
|
uint16_t idx_menu_chosen;
|
|
|
|
SubGhzLoadTypeFile load_type_file;
|
|
|
|
|
2022-07-04 16:09:46 +03:00
|
|
|
void* rpc_ctx;
|
2021-03-31 20:52:26 +03:00
|
|
|
};
|
|
|
|
|
2023-05-09 19:10:56 +03:00
|
|
|
void subghz_blink_start(SubGhz* subghz);
|
|
|
|
void subghz_blink_stop(SubGhz* subghz);
|
2022-08-02 15:54:12 +03:00
|
|
|
|
2023-05-09 19:50:01 +03:00
|
|
|
bool subghz_tx_start(SubGhz* subghz, FlipperFormat* flipper_format);
|
2023-06-20 14:28:03 +03:00
|
|
|
void subghz_dialog_message_freq_error(SubGhz* subghz, bool only_rx);
|
2023-05-09 19:33:45 +03:00
|
|
|
|
2022-07-04 16:09:46 +03:00
|
|
|
bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog);
|
2022-04-07 14:47:47 +03:00
|
|
|
bool subghz_get_next_name_file(SubGhz* subghz, uint8_t max_len);
|
2022-03-03 12:48:56 +03:00
|
|
|
bool subghz_save_protocol_to_file(
|
|
|
|
SubGhz* subghz,
|
|
|
|
FlipperFormat* flipper_format,
|
2022-04-21 19:10:50 +03:00
|
|
|
const char* dev_file_name);
|
2023-05-09 12:07:36 +03:00
|
|
|
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 16:51:48 +03:00
|
|
|
bool subghz_load_protocol_from_file(SubGhz* subghz);
|
2021-10-25 17:37:14 +03:00
|
|
|
bool subghz_rename_file(SubGhz* subghz);
|
2022-11-10 20:14:44 +03:00
|
|
|
bool subghz_file_available(SubGhz* subghz);
|
2021-09-28 03:05:40 +03:00
|
|
|
bool subghz_delete_file(SubGhz* subghz);
|
|
|
|
void subghz_file_name_clear(SubGhz* subghz);
|
2022-10-05 18:15:23 +03:00
|
|
|
bool subghz_path_is_file(FuriString* path);
|
2023-05-09 19:33:45 +03:00
|
|
|
SubGhzLoadTypeFile subghz_get_load_type_file(SubGhz* subghz);
|
2023-05-06 16:36:15 +03:00
|
|
|
|
2023-05-06 17:19:02 +03:00
|
|
|
void subghz_lock(SubGhz* subghz);
|
|
|
|
void subghz_unlock(SubGhz* subghz);
|
|
|
|
bool subghz_is_locked(SubGhz* subghz);
|
|
|
|
|
2023-05-06 17:47:49 +03:00
|
|
|
void subghz_rx_key_state_set(SubGhz* subghz, SubGhzRxKeyState state);
|
|
|
|
SubGhzRxKeyState subghz_rx_key_state_get(SubGhz* subghz);
|
|
|
|
|
2022-09-16 17:38:08 +03:00
|
|
|
extern const NotificationSequence subghz_sequence_rx;
|
|
|
|
extern const NotificationSequence subghz_sequence_rx_locked;
|