mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-18 00:33:09 +00:00
update unirf
added gui message if frequency is outside of range
This commit is contained in:
parent
03f741468c
commit
2ed40068a0
1 changed files with 21 additions and 7 deletions
|
@ -59,6 +59,7 @@ typedef struct {
|
||||||
int button;
|
int button;
|
||||||
|
|
||||||
int file_result;
|
int file_result;
|
||||||
|
bool tx_not_allowed;
|
||||||
int file_blank;
|
int file_blank;
|
||||||
|
|
||||||
string_t signal;
|
string_t signal;
|
||||||
|
@ -473,16 +474,20 @@ static void unirfremix_send_signal(
|
||||||
uint32_t frequency,
|
uint32_t frequency,
|
||||||
string_t signal,
|
string_t signal,
|
||||||
string_t protocol) {
|
string_t protocol) {
|
||||||
for(int x = 1; x <= app->repeat; x++) {
|
|
||||||
frequency = frequency ? frequency : 433920000;
|
|
||||||
FURI_LOG_E(TAG, "file to send: %s", string_get_cstr(signal));
|
|
||||||
if(!furi_hal_subghz_is_tx_allowed(frequency)) {
|
if(!furi_hal_subghz_is_tx_allowed(frequency)) {
|
||||||
printf(
|
printf(
|
||||||
"In your settings, only reception on this frequency (%lu) is allowed,\r\n"
|
"In your settings, only reception on this frequency (%lu) is allowed,\r\n"
|
||||||
"the actual operation of the unirf app is not possible\r\n ",
|
"the actual operation of the unirf app is not possible\r\n ",
|
||||||
frequency);
|
frequency);
|
||||||
break;
|
app->tx_not_allowed = true;
|
||||||
|
unirfremix_end_send(app);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
app->tx_not_allowed = false;
|
||||||
}
|
}
|
||||||
|
for(int x = 1; x <= app->repeat; x++) {
|
||||||
|
frequency = frequency ? frequency : 433920000;
|
||||||
|
FURI_LOG_E(TAG, "file to send: %s", string_get_cstr(signal));
|
||||||
string_t flipper_format_string;
|
string_t flipper_format_string;
|
||||||
|
|
||||||
if(strcmp(string_get_cstr(protocol), "RAW") == 0) {
|
if(strcmp(string_get_cstr(protocol), "RAW") == 0) {
|
||||||
|
@ -588,6 +593,15 @@ static void render_callback(Canvas* canvas, void* ctx) {
|
||||||
canvas_set_font(canvas, FontSecondary);
|
canvas_set_font(canvas, FontSecondary);
|
||||||
canvas_draw_str_aligned(canvas, 62, 30, AlignCenter, AlignTop, "Please configure map.");
|
canvas_draw_str_aligned(canvas, 62, 30, AlignCenter, AlignTop, "Please configure map.");
|
||||||
canvas_draw_str_aligned(canvas, 62, 60, AlignCenter, AlignBottom, "Hold Back to Exit.");
|
canvas_draw_str_aligned(canvas, 62, 60, AlignCenter, AlignBottom, "Hold Back to Exit.");
|
||||||
|
} else if(app->tx_not_allowed) {
|
||||||
|
canvas_clear(canvas);
|
||||||
|
canvas_set_font(canvas, FontPrimary);
|
||||||
|
canvas_draw_str_aligned(canvas, 62, 5, AlignCenter, AlignTop, "Transmission is blocked.");
|
||||||
|
canvas_set_font(canvas, FontSecondary);
|
||||||
|
canvas_draw_str_aligned(canvas, 62, 15, AlignCenter, AlignTop, "Frequency is outside of");
|
||||||
|
canvas_draw_str_aligned(canvas, 62, 25, AlignCenter, AlignTop, "default range.");
|
||||||
|
canvas_draw_str_aligned(canvas, 62, 35, AlignCenter, AlignTop, "Check docs.");
|
||||||
|
canvas_draw_str_aligned(canvas, 62, 60, AlignCenter, AlignBottom, "Hold Back to Exit.");
|
||||||
} else {
|
} else {
|
||||||
//map found, draw all the things
|
//map found, draw all the things
|
||||||
canvas_clear(canvas);
|
canvas_clear(canvas);
|
||||||
|
|
Loading…
Reference in a new issue