2022-03-03 12:48:56 +03:00
|
|
|
#include "transmitter.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_i.h"
|
|
|
|
|
|
|
|
#include <input/input.h>
|
|
|
|
#include <gui/elements.h>
|
|
|
|
|
2023-04-01 21:37:04 +03:00
|
|
|
#include <lib/subghz/blocks/custom_btn.h>
|
2023-02-25 22:28:35 +03:00
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
struct SubGhzViewTransmitter {
|
[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
|
|
|
View* view;
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzViewTransmitterCallback callback;
|
[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
|
|
|
void* context;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
2022-10-05 18:15:23 +03:00
|
|
|
FuriString* frequency_str;
|
|
|
|
FuriString* preset_str;
|
|
|
|
FuriString* key_str;
|
2023-05-05 02:09:21 +03:00
|
|
|
bool show_button;
|
2023-02-25 22:28:35 +03:00
|
|
|
FuriString* temp_button_id;
|
|
|
|
bool draw_temp_button;
|
2022-03-03 12:48:56 +03:00
|
|
|
} SubGhzViewTransmitterModel;
|
[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-03-03 12:48:56 +03:00
|
|
|
void subghz_view_transmitter_set_callback(
|
|
|
|
SubGhzViewTransmitter* subghz_transmitter,
|
|
|
|
SubGhzViewTransmitterCallback callback,
|
[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
|
|
|
void* context) {
|
|
|
|
furi_assert(subghz_transmitter);
|
|
|
|
|
|
|
|
subghz_transmitter->callback = callback;
|
|
|
|
subghz_transmitter->context = context;
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_view_transmitter_add_data_to_show(
|
|
|
|
SubGhzViewTransmitter* subghz_transmitter,
|
2021-09-10 03:29:57 +03:00
|
|
|
const char* key_str,
|
|
|
|
const char* frequency_str,
|
|
|
|
const char* preset_str,
|
2023-05-05 02:09:21 +03:00
|
|
|
bool show_button) {
|
2021-09-10 03:29:57 +03:00
|
|
|
furi_assert(subghz_transmitter);
|
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
|
|
|
with_view_model(
|
2022-10-08 20:38:29 +03:00
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_set(model->key_str, key_str);
|
|
|
|
furi_string_set(model->frequency_str, frequency_str);
|
|
|
|
furi_string_set(model->preset_str, preset_str);
|
2021-09-10 03:29:57 +03:00
|
|
|
model->show_button = show_button;
|
2022-10-08 20:38:29 +03:00
|
|
|
},
|
|
|
|
true);
|
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
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
static void subghz_view_transmitter_button_right(Canvas* canvas, const char* str) {
|
2022-09-20 23:13:15 +03:00
|
|
|
const uint8_t button_height = 12;
|
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
|
|
|
const uint8_t vertical_offset = 3;
|
|
|
|
const uint8_t horizontal_offset = 1;
|
|
|
|
const uint8_t string_width = canvas_string_width(canvas, str);
|
|
|
|
const Icon* icon = &I_ButtonCenter_7x7;
|
|
|
|
const uint8_t icon_offset = 3;
|
2021-08-30 23:05:09 +03:00
|
|
|
const uint8_t icon_width_with_offset = icon_get_width(icon) + icon_offset;
|
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
|
|
|
const uint8_t button_width = string_width + horizontal_offset * 2 + icon_width_with_offset;
|
|
|
|
|
|
|
|
const uint8_t x = (canvas_width(canvas) - button_width) / 2 + 40;
|
|
|
|
const uint8_t y = canvas_height(canvas);
|
|
|
|
|
|
|
|
canvas_draw_box(canvas, x, y - button_height, button_width, button_height);
|
|
|
|
|
|
|
|
canvas_draw_line(canvas, x - 1, y, x - 1, y - button_height + 0);
|
|
|
|
canvas_draw_line(canvas, x - 2, y, x - 2, y - button_height + 1);
|
|
|
|
canvas_draw_line(canvas, x - 3, y, x - 3, y - button_height + 2);
|
|
|
|
|
|
|
|
canvas_draw_line(canvas, x + button_width + 0, y, x + button_width + 0, y - button_height + 0);
|
|
|
|
canvas_draw_line(canvas, x + button_width + 1, y, x + button_width + 1, y - button_height + 1);
|
|
|
|
canvas_draw_line(canvas, x + button_width + 2, y, x + button_width + 2, y - button_height + 2);
|
|
|
|
|
|
|
|
canvas_invert_color(canvas);
|
|
|
|
canvas_draw_icon(
|
2022-09-20 23:13:15 +03:00
|
|
|
canvas,
|
|
|
|
x + horizontal_offset,
|
|
|
|
y - button_height + vertical_offset - 1,
|
|
|
|
&I_ButtonCenter_7x7);
|
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
|
|
|
canvas_draw_str(
|
|
|
|
canvas, x + horizontal_offset + icon_width_with_offset, y - vertical_offset, str);
|
|
|
|
canvas_invert_color(canvas);
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_view_transmitter_draw(Canvas* canvas, SubGhzViewTransmitterModel* model) {
|
[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
|
|
|
canvas_clear(canvas);
|
|
|
|
canvas_set_color(canvas, ColorBlack);
|
|
|
|
canvas_set_font(canvas, FontSecondary);
|
2023-02-09 07:48:06 +03:00
|
|
|
elements_multiline_text_aligned(
|
|
|
|
canvas, 0, 0, AlignLeft, AlignTop, furi_string_get_cstr(model->key_str));
|
2023-02-03 15:39:02 +03:00
|
|
|
canvas_draw_str(canvas, 78, 7, furi_string_get_cstr(model->frequency_str));
|
|
|
|
canvas_draw_str(canvas, 113, 7, furi_string_get_cstr(model->preset_str));
|
|
|
|
|
2023-02-25 22:28:35 +03:00
|
|
|
if(model->draw_temp_button) {
|
|
|
|
canvas_set_font(canvas, FontBatteryPercent);
|
|
|
|
canvas_draw_str(canvas, 117, 40, furi_string_get_cstr(model->temp_button_id));
|
|
|
|
canvas_set_font(canvas, FontSecondary);
|
|
|
|
}
|
|
|
|
|
2023-02-03 15:39:02 +03:00
|
|
|
if(model->show_button) {
|
|
|
|
canvas_draw_str(canvas, 58, 62, furi_hal_subghz_get_radio_type() ? "R: Ext" : "R: Int");
|
|
|
|
subghz_view_transmitter_button_right(canvas, "Send");
|
|
|
|
}
|
[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-03-03 12:48:56 +03:00
|
|
|
bool subghz_view_transmitter_input(InputEvent* event, void* context) {
|
[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
|
|
|
furi_assert(context);
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzViewTransmitter* subghz_transmitter = context;
|
2021-09-02 00:05:00 +03:00
|
|
|
bool can_be_sent = false;
|
|
|
|
|
2021-09-10 03:29:57 +03:00
|
|
|
if(event->key == InputKeyBack && event->type == InputTypeShort) {
|
|
|
|
with_view_model(
|
2022-10-08 20:38:29 +03:00
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_reset(model->frequency_str);
|
|
|
|
furi_string_reset(model->preset_str);
|
|
|
|
furi_string_reset(model->key_str);
|
2023-02-25 22:28:35 +03:00
|
|
|
furi_string_reset(model->temp_button_id);
|
2023-05-05 02:09:21 +03:00
|
|
|
model->show_button = false;
|
2023-02-25 22:28:35 +03:00
|
|
|
model->draw_temp_button = false;
|
2022-10-08 20:38:29 +03:00
|
|
|
},
|
|
|
|
false);
|
2021-09-02 00:05:00 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
SubGhz: read and save static remotes. Create new static and dynamic remotes. (#646)
* SubGhz: the functions of saving loading KeeLog have been modified, saving KeeLog is prohibited
* SubGhz: Fix displaying Nice FlorS in the Raed scene
* SubGhz: Fix displaying Faac SLH in the Raed scene
* SubGhz: Fix displaying iDo in the Raed scene
* SubGhz: Fix displaying Star Line in the Raed scene
* SubGhz: Fix displaying Nice Flo in the Raed scene, added save and load functions. (testing needed, no remote control)
* SubGhz: subghz_beginadded common encoder upload signal
* SubGhz: add Came encoder
* SubGhz: modified pricenton encoder, fix view transmitter hide the "Send" button if there is no encoder
* SubGhz: add nice flo encoder, need testing no remote control
* SubGhz: add gate_tx encoder
* SubGhz: add nero_sketch encoder
* SubGhz: add keelog encoder
* SubGhz: add long upload upload while the button is pressed while releasing the transfer is over, with a check for sticking (maximum 200 upload repetitions)
* SubGhz: fix max upload
* SubGhz: Fix structure subghz add encoder
* SubGhz: add generating and sending a dynamic keelog key, refactoring the code
* SubGhz: add notifications
* SubGhz: add creating a new remote control (Pricenton, Nice Flo 12bit, Nice Flo 24bit, CAME 12bit, CAME 24bit, Gate TX, DoorHan)
* SubGhz: Fix load file, fix scene start
* Subghz: Fix show key
* SubGhz: Fix subghz_cli
* SubGhz: Fix furi-hal-subghz
* Format sources
* SubGhz: standard notification scheme, fix broken assert in DMA.
* SubGhz: move level alignment logic to furi-hal-subghz, fix spelling, cleanup.
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-16 22:56:23 +03:00
|
|
|
with_view_model(
|
2022-10-08 20:38:29 +03:00
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
2021-09-10 03:29:57 +03:00
|
|
|
if(model->show_button) {
|
2021-09-02 00:05:00 +03:00
|
|
|
can_be_sent = true;
|
|
|
|
}
|
2022-10-08 20:38:29 +03:00
|
|
|
},
|
|
|
|
true);
|
[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
|
|
|
|
2021-09-02 00:05:00 +03:00
|
|
|
if(can_be_sent && event->key == InputKeyOk && event->type == InputTypePress) {
|
2023-05-13 14:43:11 +03:00
|
|
|
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_OK);
|
2023-02-25 22:28:35 +03:00
|
|
|
with_view_model(
|
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
|
|
|
furi_string_reset(model->temp_button_id);
|
|
|
|
model->draw_temp_button = false;
|
|
|
|
},
|
|
|
|
true);
|
2021-10-25 17:37:14 +03:00
|
|
|
subghz_transmitter->callback(
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzCustomEventViewTransmitterSendStart, subghz_transmitter->context);
|
SubGhz: read and save static remotes. Create new static and dynamic remotes. (#646)
* SubGhz: the functions of saving loading KeeLog have been modified, saving KeeLog is prohibited
* SubGhz: Fix displaying Nice FlorS in the Raed scene
* SubGhz: Fix displaying Faac SLH in the Raed scene
* SubGhz: Fix displaying iDo in the Raed scene
* SubGhz: Fix displaying Star Line in the Raed scene
* SubGhz: Fix displaying Nice Flo in the Raed scene, added save and load functions. (testing needed, no remote control)
* SubGhz: subghz_beginadded common encoder upload signal
* SubGhz: add Came encoder
* SubGhz: modified pricenton encoder, fix view transmitter hide the "Send" button if there is no encoder
* SubGhz: add nice flo encoder, need testing no remote control
* SubGhz: add gate_tx encoder
* SubGhz: add nero_sketch encoder
* SubGhz: add keelog encoder
* SubGhz: add long upload upload while the button is pressed while releasing the transfer is over, with a check for sticking (maximum 200 upload repetitions)
* SubGhz: fix max upload
* SubGhz: Fix structure subghz add encoder
* SubGhz: add generating and sending a dynamic keelog key, refactoring the code
* SubGhz: add notifications
* SubGhz: add creating a new remote control (Pricenton, Nice Flo 12bit, Nice Flo 24bit, CAME 12bit, CAME 24bit, Gate TX, DoorHan)
* SubGhz: Fix load file, fix scene start
* Subghz: Fix show key
* SubGhz: Fix subghz_cli
* SubGhz: Fix furi-hal-subghz
* Format sources
* SubGhz: standard notification scheme, fix broken assert in DMA.
* SubGhz: move level alignment logic to furi-hal-subghz, fix spelling, cleanup.
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-08-16 22:56:23 +03:00
|
|
|
return true;
|
2021-09-02 00:05:00 +03:00
|
|
|
} else if(can_be_sent && event->key == InputKeyOk && event->type == InputTypeRelease) {
|
2021-10-25 17:37:14 +03:00
|
|
|
subghz_transmitter->callback(
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzCustomEventViewTransmitterSendStop, subghz_transmitter->context);
|
[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
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2023-02-25 22:28:35 +03:00
|
|
|
// Temp Buttons (UP)
|
|
|
|
if(can_be_sent && event->key == InputKeyUp && event->type == InputTypePress) {
|
2023-05-13 14:43:11 +03:00
|
|
|
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_UP);
|
2023-02-25 22:28:35 +03:00
|
|
|
with_view_model(
|
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
|
|
|
furi_string_reset(model->temp_button_id);
|
2023-04-01 21:37:04 +03:00
|
|
|
if(subghz_custom_btn_get_original() != 0) {
|
2023-05-13 14:43:11 +03:00
|
|
|
if(subghz_custom_btn_get() == SUBGHZ_CUSTOM_BTN_UP) {
|
2023-04-01 21:37:04 +03:00
|
|
|
furi_string_printf(
|
|
|
|
model->temp_button_id, "%01X", subghz_custom_btn_get_original());
|
|
|
|
model->draw_temp_button = true;
|
|
|
|
}
|
2023-02-25 22:28:35 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
true);
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStart, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
} else if(can_be_sent && event->key == InputKeyUp && event->type == InputTypeRelease) {
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStop, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// Down
|
|
|
|
if(can_be_sent && event->key == InputKeyDown && event->type == InputTypePress) {
|
2023-05-13 14:43:11 +03:00
|
|
|
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_DOWN);
|
2023-02-25 22:28:35 +03:00
|
|
|
with_view_model(
|
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
|
|
|
furi_string_reset(model->temp_button_id);
|
2023-04-01 21:37:04 +03:00
|
|
|
if(subghz_custom_btn_get_original() != 0) {
|
2023-05-13 14:43:11 +03:00
|
|
|
if(subghz_custom_btn_get() == SUBGHZ_CUSTOM_BTN_DOWN) {
|
2023-04-01 21:37:04 +03:00
|
|
|
furi_string_printf(
|
|
|
|
model->temp_button_id, "%01X", subghz_custom_btn_get_original());
|
|
|
|
model->draw_temp_button = true;
|
|
|
|
}
|
2023-02-25 22:28:35 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
true);
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStart, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
} else if(can_be_sent && event->key == InputKeyDown && event->type == InputTypeRelease) {
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStop, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// Left
|
|
|
|
if(can_be_sent && event->key == InputKeyLeft && event->type == InputTypePress) {
|
2023-05-13 14:43:11 +03:00
|
|
|
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_LEFT);
|
2023-02-25 22:28:35 +03:00
|
|
|
with_view_model(
|
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
|
|
|
furi_string_reset(model->temp_button_id);
|
2023-04-01 21:37:04 +03:00
|
|
|
if(subghz_custom_btn_get_original() != 0) {
|
2023-05-13 14:43:11 +03:00
|
|
|
if(subghz_custom_btn_get() == SUBGHZ_CUSTOM_BTN_LEFT) {
|
2023-04-01 21:37:04 +03:00
|
|
|
furi_string_printf(
|
|
|
|
model->temp_button_id, "%01X", subghz_custom_btn_get_original());
|
|
|
|
model->draw_temp_button = true;
|
|
|
|
}
|
2023-02-25 22:28:35 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
true);
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStart, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
} else if(can_be_sent && event->key == InputKeyLeft && event->type == InputTypeRelease) {
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStop, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
// Right
|
|
|
|
if(can_be_sent && event->key == InputKeyRight && event->type == InputTypePress) {
|
2023-05-13 14:43:11 +03:00
|
|
|
subghz_custom_btn_set(SUBGHZ_CUSTOM_BTN_RIGHT);
|
2023-02-25 22:28:35 +03:00
|
|
|
with_view_model(
|
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
|
|
|
furi_string_reset(model->temp_button_id);
|
2023-04-01 21:37:04 +03:00
|
|
|
if(subghz_custom_btn_get_original() != 0) {
|
2023-05-13 14:43:11 +03:00
|
|
|
if(subghz_custom_btn_get() == SUBGHZ_CUSTOM_BTN_RIGHT) {
|
2023-04-01 21:37:04 +03:00
|
|
|
furi_string_printf(
|
|
|
|
model->temp_button_id, "%01X", subghz_custom_btn_get_original());
|
|
|
|
model->draw_temp_button = true;
|
|
|
|
}
|
2023-02-25 22:28:35 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
true);
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStart, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
} else if(can_be_sent && event->key == InputKeyRight && event->type == InputTypeRelease) {
|
|
|
|
subghz_transmitter->callback(
|
|
|
|
SubGhzCustomEventViewTransmitterSendStop, subghz_transmitter->context);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
[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
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_view_transmitter_enter(void* context) {
|
[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
|
|
|
furi_assert(context);
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_view_transmitter_exit(void* context) {
|
[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
|
|
|
furi_assert(context);
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzViewTransmitter* subghz_view_transmitter_alloc() {
|
|
|
|
SubGhzViewTransmitter* subghz_transmitter = malloc(sizeof(SubGhzViewTransmitter));
|
[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
|
|
|
|
|
|
|
// View allocation and configuration
|
|
|
|
subghz_transmitter->view = view_alloc();
|
|
|
|
view_allocate_model(
|
2022-03-03 12:48:56 +03:00
|
|
|
subghz_transmitter->view, ViewModelTypeLocking, sizeof(SubGhzViewTransmitterModel));
|
[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
|
|
|
view_set_context(subghz_transmitter->view, subghz_transmitter);
|
2022-03-03 12:48:56 +03:00
|
|
|
view_set_draw_callback(
|
|
|
|
subghz_transmitter->view, (ViewDrawCallback)subghz_view_transmitter_draw);
|
|
|
|
view_set_input_callback(subghz_transmitter->view, subghz_view_transmitter_input);
|
|
|
|
view_set_enter_callback(subghz_transmitter->view, subghz_view_transmitter_enter);
|
|
|
|
view_set_exit_callback(subghz_transmitter->view, subghz_view_transmitter_exit);
|
[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
|
|
|
|
|
|
|
with_view_model(
|
2022-10-08 20:38:29 +03:00
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
2022-10-05 18:15:23 +03:00
|
|
|
model->frequency_str = furi_string_alloc();
|
|
|
|
model->preset_str = furi_string_alloc();
|
|
|
|
model->key_str = furi_string_alloc();
|
2023-02-25 22:28:35 +03:00
|
|
|
model->temp_button_id = furi_string_alloc();
|
2022-10-08 20:38:29 +03:00
|
|
|
},
|
|
|
|
true);
|
[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
|
|
|
return subghz_transmitter;
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_view_transmitter_free(SubGhzViewTransmitter* subghz_transmitter) {
|
[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
|
|
|
furi_assert(subghz_transmitter);
|
|
|
|
|
|
|
|
with_view_model(
|
2022-10-08 20:38:29 +03:00
|
|
|
subghz_transmitter->view,
|
|
|
|
SubGhzViewTransmitterModel * model,
|
|
|
|
{
|
2022-10-05 18:15:23 +03:00
|
|
|
furi_string_free(model->frequency_str);
|
|
|
|
furi_string_free(model->preset_str);
|
|
|
|
furi_string_free(model->key_str);
|
2023-02-25 22:28:35 +03:00
|
|
|
furi_string_free(model->temp_button_id);
|
2022-10-08 20:38:29 +03:00
|
|
|
},
|
|
|
|
true);
|
[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
|
|
|
view_free(subghz_transmitter->view);
|
|
|
|
free(subghz_transmitter);
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
View* subghz_view_transmitter_get_view(SubGhzViewTransmitter* subghz_transmitter) {
|
[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
|
|
|
furi_assert(subghz_transmitter);
|
|
|
|
return subghz_transmitter->view;
|
|
|
|
}
|