TouchTunes new functions

This commit is contained in:
notpike 2022-01-03 19:14:05 -08:00
parent a07683b2a6
commit 47014b35ad
3 changed files with 31 additions and 4 deletions

View File

@ -43,7 +43,7 @@ namespace ui
case 2: case 2:
// https://github.com/eried/portapack-mayhem/graphs/contributors?to=2020-04-12&from=2015-07-31&type=c // https://github.com/eried/portapack-mayhem/graphs/contributors?to=2020-04-12&from=2015-07-31&type=c
console.writeln("\x1B\x06Havoc:\x1B\x10"); console.writeln("\x1B\x06Havoc:\x1B\x10");
console.writeln("furrtek,mrmookie,notpike"); console.writeln("furrtek,mrmookie,NotPike");
console.writeln("mjwaxios,ImDroided,Giorgiofox"); console.writeln("mjwaxios,ImDroided,Giorgiofox");
console.writeln("F4GEV,z4ziggy,xmycroftx"); console.writeln("F4GEV,z4ziggy,xmycroftx");
console.writeln("troussos,silascutler"); console.writeln("troussos,silascutler");

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek * Copyright (C) 2017 Furrtek
* Copyright (C) 2017 NotPike * Copyright (C) 2022 NotPike
* *
* This file is part of PortaPack. * This file is part of PortaPack.
* *
@ -27,6 +27,7 @@
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "string_format.hpp" #include "string_format.hpp"
using namespace portapack; using namespace portapack;
using namespace encoders; using namespace encoders;
@ -72,6 +73,14 @@ void TouchTunesView::on_tx_progress(const uint32_t progress, const bool done) {
} }
} }
void TouchTunesView::start_ew() {
text_status.set("Jamming...");
}
void TouchTunesView::stop_ew() {
text_status.set("Ready");
}
void TouchTunesView::start_tx(const uint32_t button_index) { void TouchTunesView::start_tx(const uint32_t button_index) {
std::string fragments = { "" }; std::string fragments = { "" };
size_t bit; size_t bit;
@ -136,6 +145,7 @@ TouchTunesView::TouchTunesView(
&labels, &labels,
&field_pin, &field_pin,
&check_scan, &check_scan,
&check_ew,
&text_status, &text_status,
&progressbar &progressbar
}); });
@ -145,6 +155,15 @@ TouchTunesView::TouchTunesView(
field_pin.on_change = [this](int32_t v) { field_pin.on_change = [this](int32_t v) {
pin = v; pin = v;
}; };
// EW Mode
check_ew.on_select = [this](Checkbox&, bool v) {
if(v){
start_ew();
} else {
stop_ew();
}
};
const auto button_fn = [this](Button& button) { const auto button_fn = [this](Button& button) {
start_tx(button.id); start_tx(button.id);

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek * Copyright (C) 2017 Furrtek
* Copyright (C) 2018 NotPike * Copyright (C) 2022 NotPike
* *
* This file is part of PortaPack. * This file is part of PortaPack.
* *
@ -127,6 +127,8 @@ private:
void start_tx(const uint32_t button_index); void start_tx(const uint32_t button_index);
void stop_tx(); void stop_tx();
void on_tx_progress(const uint32_t progress, const bool done); void on_tx_progress(const uint32_t progress, const bool done);
void start_ew();
void stop_ew();
struct remote_layout_t { struct remote_layout_t {
Point position; Point position;
@ -191,11 +193,17 @@ private:
}; };
Checkbox check_scan { Checkbox check_scan {
{ 2 * 8, 27 * 8 }, { 2 * 8, 25 * 8 },
4, 4,
"Scan" "Scan"
}; };
Checkbox check_ew {
{ 2 * 8, 29 * 8 },
4,
"EW Mode"
};
Text text_status { Text text_status {
{ 2 * 8, 33 * 8, 128, 16 }, { 2 * 8, 33 * 8, 128, 16 },
"Ready" "Ready"