[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_test_carrier.h"
|
2021-06-30 00:19:20 +03:00
|
|
|
#include "../subghz_i.h"
|
2021-12-22 14:05:14 +03:00
|
|
|
#include "../helpers/subghz_testing.h"
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include <furi.h>
|
2022-01-05 19:10:18 +03:00
|
|
|
#include <furi_hal.h>
|
2021-03-31 20:52:26 +03:00
|
|
|
#include <input/input.h>
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
struct SubGhzTestCarrier {
|
2021-03-31 20:52:26 +03:00
|
|
|
View* view;
|
2021-12-21 15:16:25 +03:00
|
|
|
osTimerId_t timer;
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrierCallback callback;
|
2021-09-28 03:05:40 +03:00
|
|
|
void* context;
|
2021-03-31 20:52:26 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrierModelStatusRx,
|
|
|
|
SubGhzTestCarrierModelStatusTx,
|
|
|
|
} SubGhzTestCarrierModelStatus;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t frequency;
|
|
|
|
uint32_t real_frequency;
|
2021-08-08 21:03:25 +03:00
|
|
|
FuriHalSubGhzPath path;
|
2021-03-31 20:52:26 +03:00
|
|
|
float rssi;
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrierModelStatus status;
|
|
|
|
} SubGhzTestCarrierModel;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2021-09-28 03:05:40 +03:00
|
|
|
void subghz_test_carrier_set_callback(
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrier* subghz_test_carrier,
|
|
|
|
SubGhzTestCarrierCallback callback,
|
2021-09-28 03:05:40 +03:00
|
|
|
void* context) {
|
|
|
|
furi_assert(subghz_test_carrier);
|
|
|
|
furi_assert(callback);
|
|
|
|
subghz_test_carrier->callback = callback;
|
|
|
|
subghz_test_carrier->context = context;
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_test_carrier_draw(Canvas* canvas, SubGhzTestCarrierModel* model) {
|
2021-03-31 20:52:26 +03:00
|
|
|
char buffer[64];
|
|
|
|
|
|
|
|
canvas_set_color(canvas, ColorBlack);
|
|
|
|
canvas_set_font(canvas, FontPrimary);
|
2021-07-04 19:01:16 +03:00
|
|
|
canvas_draw_str(canvas, 0, 8, "CC1101 Basic Test");
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
canvas_set_font(canvas, FontSecondary);
|
|
|
|
// Frequency
|
|
|
|
snprintf(
|
|
|
|
buffer,
|
|
|
|
sizeof(buffer),
|
|
|
|
"Freq: %03ld.%03ld.%03ld Hz",
|
|
|
|
model->real_frequency / 1000000 % 1000,
|
|
|
|
model->real_frequency / 1000 % 1000,
|
|
|
|
model->real_frequency % 1000);
|
2021-07-04 19:01:16 +03:00
|
|
|
canvas_draw_str(canvas, 0, 20, buffer);
|
2021-03-31 20:52:26 +03:00
|
|
|
// Path
|
|
|
|
char* path_name = "Unknown";
|
2021-08-08 21:03:25 +03:00
|
|
|
if(model->path == FuriHalSubGhzPathIsolate) {
|
2021-03-31 20:52:26 +03:00
|
|
|
path_name = "isolate";
|
2021-08-08 21:03:25 +03:00
|
|
|
} else if(model->path == FuriHalSubGhzPath433) {
|
2021-03-31 20:52:26 +03:00
|
|
|
path_name = "433MHz";
|
2021-08-08 21:03:25 +03:00
|
|
|
} else if(model->path == FuriHalSubGhzPath315) {
|
2021-03-31 20:52:26 +03:00
|
|
|
path_name = "315MHz";
|
2021-08-08 21:03:25 +03:00
|
|
|
} else if(model->path == FuriHalSubGhzPath868) {
|
2021-03-31 20:52:26 +03:00
|
|
|
path_name = "868MHz";
|
|
|
|
}
|
|
|
|
snprintf(buffer, sizeof(buffer), "Path: %d - %s", model->path, path_name);
|
2021-07-04 19:01:16 +03:00
|
|
|
canvas_draw_str(canvas, 0, 31, buffer);
|
2022-03-03 12:48:56 +03:00
|
|
|
if(model->status == SubGhzTestCarrierModelStatusRx) {
|
2021-03-31 20:52:26 +03:00
|
|
|
snprintf(
|
|
|
|
buffer,
|
|
|
|
sizeof(buffer),
|
|
|
|
"RSSI: %ld.%ld dBm",
|
|
|
|
(int32_t)(model->rssi),
|
|
|
|
(int32_t)fabs(model->rssi * 10) % 10);
|
2021-07-04 19:01:16 +03:00
|
|
|
canvas_draw_str(canvas, 0, 42, buffer);
|
2021-03-31 20:52:26 +03:00
|
|
|
} else {
|
2021-07-04 19:01:16 +03:00
|
|
|
canvas_draw_str(canvas, 0, 42, "TX");
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[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
|
|
|
bool subghz_test_carrier_input(InputEvent* event, void* context) {
|
2021-03-31 20:52:26 +03:00
|
|
|
furi_assert(context);
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrier* subghz_test_carrier = context;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2021-08-24 02:52:59 +03:00
|
|
|
if(event->key == InputKeyBack || event->type != InputTypeShort) {
|
2021-03-31 20:52:26 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
with_view_model(
|
2022-03-03 12:48:56 +03:00
|
|
|
subghz_test_carrier->view, (SubGhzTestCarrierModel * model) {
|
2021-08-08 21:03:25 +03:00
|
|
|
furi_hal_subghz_idle();
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2021-08-24 02:52:59 +03:00
|
|
|
if(event->key == InputKeyLeft) {
|
|
|
|
if(model->frequency > 0) model->frequency--;
|
|
|
|
} else if(event->key == InputKeyRight) {
|
2021-12-22 14:05:14 +03:00
|
|
|
if(model->frequency < subghz_frequencies_count_testing - 1) model->frequency++;
|
2021-08-24 02:52:59 +03:00
|
|
|
} else if(event->key == InputKeyDown) {
|
|
|
|
if(model->path > 0) model->path--;
|
|
|
|
} else if(event->key == InputKeyUp) {
|
|
|
|
if(model->path < FuriHalSubGhzPath868) model->path++;
|
|
|
|
} else if(event->key == InputKeyOk) {
|
2022-03-03 12:48:56 +03:00
|
|
|
if(model->status == SubGhzTestCarrierModelStatusTx) {
|
|
|
|
model->status = SubGhzTestCarrierModelStatusRx;
|
2021-08-24 02:52:59 +03:00
|
|
|
} else {
|
2022-03-03 12:48:56 +03:00
|
|
|
model->status = SubGhzTestCarrierModelStatusTx;
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-24 02:52:59 +03:00
|
|
|
model->real_frequency =
|
2021-12-22 14:05:14 +03:00
|
|
|
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
|
2021-08-24 02:52:59 +03:00
|
|
|
furi_hal_subghz_set_path(model->path);
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
if(model->status == SubGhzTestCarrierModelStatusRx) {
|
2022-03-30 18:23:40 +03:00
|
|
|
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
|
2021-08-08 21:03:25 +03:00
|
|
|
furi_hal_subghz_rx();
|
2021-03-31 20:52:26 +03:00
|
|
|
} else {
|
2022-03-30 18:23:40 +03:00
|
|
|
furi_hal_gpio_init(
|
|
|
|
&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
|
|
|
furi_hal_gpio_write(&gpio_cc1101_g0, true);
|
2021-09-28 03:05:40 +03:00
|
|
|
if(!furi_hal_subghz_tx()) {
|
2022-03-30 18:23:40 +03:00
|
|
|
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
|
2021-09-28 03:05:40 +03:00
|
|
|
subghz_test_carrier->callback(
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrierEventOnlyRx, subghz_test_carrier->context);
|
2021-09-28 03:05:40 +03:00
|
|
|
}
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
|
|
|
|
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
|
|
|
void subghz_test_carrier_enter(void* context) {
|
2021-03-31 20:52:26 +03:00
|
|
|
furi_assert(context);
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrier* subghz_test_carrier = context;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2021-08-08 21:03:25 +03:00
|
|
|
furi_hal_subghz_reset();
|
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
|
|
|
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOok650Async);
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2022-03-30 18:23:40 +03:00
|
|
|
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
with_view_model(
|
2022-03-03 12:48:56 +03:00
|
|
|
subghz_test_carrier->view, (SubGhzTestCarrierModel * model) {
|
2021-12-22 14:05:14 +03:00
|
|
|
model->frequency = subghz_frequencies_433_92_testing; // 433
|
2021-03-31 20:52:26 +03:00
|
|
|
model->real_frequency =
|
2021-12-22 14:05:14 +03:00
|
|
|
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
|
2021-08-08 21:03:25 +03:00
|
|
|
model->path = FuriHalSubGhzPathIsolate; // isolate
|
2021-03-31 20:52:26 +03:00
|
|
|
model->rssi = 0.0f;
|
2022-03-03 12:48:56 +03:00
|
|
|
model->status = SubGhzTestCarrierModelStatusRx;
|
2021-03-31 20:52:26 +03:00
|
|
|
return true;
|
|
|
|
});
|
|
|
|
|
2021-08-08 21:03:25 +03:00
|
|
|
furi_hal_subghz_rx();
|
2021-03-31 20:52:26 +03:00
|
|
|
|
2021-11-22 21:49:57 +03:00
|
|
|
osTimerStart(subghz_test_carrier->timer, osKernelGetTickFreq() / 4);
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|
|
|
|
|
[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 subghz_test_carrier_exit(void* context) {
|
2021-03-31 20:52:26 +03:00
|
|
|
furi_assert(context);
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrier* subghz_test_carrier = context;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
[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
|
|
|
osTimerStop(subghz_test_carrier->timer);
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
// Reinitialize IC to default state
|
2021-08-08 21:03:25 +03:00
|
|
|
furi_hal_subghz_sleep();
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|
|
|
|
|
[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 subghz_test_carrier_rssi_timer_callback(void* context) {
|
2021-03-31 20:52:26 +03:00
|
|
|
furi_assert(context);
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrier* subghz_test_carrier = context;
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
with_view_model(
|
2022-03-03 12:48:56 +03:00
|
|
|
subghz_test_carrier->view, (SubGhzTestCarrierModel * model) {
|
|
|
|
if(model->status == SubGhzTestCarrierModelStatusRx) {
|
2021-08-24 02:52:59 +03:00
|
|
|
model->rssi = furi_hal_subghz_get_rssi();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2021-03-31 20:52:26 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
SubGhzTestCarrier* subghz_test_carrier_alloc() {
|
|
|
|
SubGhzTestCarrier* subghz_test_carrier = malloc(sizeof(SubGhzTestCarrier));
|
2021-03-31 20:52:26 +03:00
|
|
|
|
|
|
|
// View allocation and configuration
|
[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
|
|
|
subghz_test_carrier->view = view_alloc();
|
2021-03-31 20:52:26 +03:00
|
|
|
view_allocate_model(
|
2022-03-03 12:48:56 +03:00
|
|
|
subghz_test_carrier->view, ViewModelTypeLocking, sizeof(SubGhzTestCarrierModel));
|
[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_test_carrier->view, subghz_test_carrier);
|
|
|
|
view_set_draw_callback(subghz_test_carrier->view, (ViewDrawCallback)subghz_test_carrier_draw);
|
|
|
|
view_set_input_callback(subghz_test_carrier->view, subghz_test_carrier_input);
|
|
|
|
view_set_enter_callback(subghz_test_carrier->view, subghz_test_carrier_enter);
|
|
|
|
view_set_exit_callback(subghz_test_carrier->view, subghz_test_carrier_exit);
|
|
|
|
|
|
|
|
subghz_test_carrier->timer = osTimerNew(
|
|
|
|
subghz_test_carrier_rssi_timer_callback, osTimerPeriodic, subghz_test_carrier, NULL);
|
|
|
|
|
|
|
|
return subghz_test_carrier;
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
void subghz_test_carrier_free(SubGhzTestCarrier* subghz_test_carrier) {
|
[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_test_carrier);
|
|
|
|
osTimerDelete(subghz_test_carrier->timer);
|
|
|
|
view_free(subghz_test_carrier->view);
|
|
|
|
free(subghz_test_carrier);
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|
|
|
|
|
2022-03-03 12:48:56 +03:00
|
|
|
View* subghz_test_carrier_get_view(SubGhzTestCarrier* subghz_test_carrier) {
|
[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_test_carrier);
|
|
|
|
return subghz_test_carrier->view;
|
2021-03-31 20:52:26 +03:00
|
|
|
}
|