Merge pull request #461 from notpike/touchtunes

Touchtunes EW Mode Feature
This commit is contained in:
Erwin Ried
2022-01-04 10:55:22 +01:00
committed by GitHub
10 changed files with 330 additions and 258 deletions

View File

@@ -6,7 +6,8 @@ namespace ui
{
add_children({&console, &button_ok});
button_ok.on_select = [&nav](Button &) {
button_ok.on_select = [&nav](Button &)
{
nav.pop();
};
@@ -34,6 +35,7 @@ namespace ui
console.writeln("zhang00963,RedFox-Fr,aldude999");
console.writeln("East2West,fossum,ArjanOnwezen");
console.writeln("vXxOinvizioNxX,teixeluis");
console.writeln("Brumi-2021,texasyojimbo");
console.writeln("heurist1,intoxsick");
console.writeln("");
break;
@@ -41,7 +43,7 @@ namespace ui
case 2:
// 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("furrtek,mrmookie,notpike");
console.writeln("furrtek,mrmookie,NotPike");
console.writeln("mjwaxios,ImDroided,Giorgiofox");
console.writeln("F4GEV,z4ziggy,xmycroftx");
console.writeln("troussos,silascutler");

View File

@@ -1,7 +1,7 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek
* Copyright (C) 2017 NotPike
* Copyright (C) 2022 NotPike
*
* This file is part of PortaPack.
*
@@ -27,6 +27,7 @@
#include "baseband_api.hpp"
#include "string_format.hpp"
using namespace portapack;
using namespace encoders;
@@ -45,7 +46,13 @@ void TouchTunesView::stop_tx() {
transmitter_model.disable();
tx_mode = IDLE;
progressbar.set_value(0);
text_status.set("Ready");
// EW Mode Check
if(check_ew.value()) {
start_ew();
} else {
text_status.set("Ready");
}
}
void TouchTunesView::on_tx_progress(const uint32_t progress, const bool done) {
@@ -72,7 +79,43 @@ void TouchTunesView::on_tx_progress(const uint32_t progress, const bool done) {
}
}
// EW (Electronic Warfare) Mode will jam the receiving jukebox
// while still alowing you (the hacker) to send commands
// to the target jukebox.
// EW Mode works by transmitting a CW on 433.92MHz inbetween
// transmission events.
void TouchTunesView::start_ew() {
// Radio
transmitter_model.set_tuning_frequency(433920000);
transmitter_model.set_sampling_rate(3072000U);
transmitter_model.set_rf_amp(true);
transmitter_model.set_baseband_bandwidth(3500000U);
transmitter_model.set_tx_gain(47);
transmitter_model.enable();
//UI
text_status.set("Jamming...");
progressbar.set_max(1);
progressbar.set_value(1);
}
void TouchTunesView::stop_ew() {
// Radio
transmitter_model.disable();
// UI
text_status.set("Ready");
progressbar.set_value(0);
}
void TouchTunesView::start_tx(const uint32_t button_index) {
// Check EW Mode
if(check_ew.value()) {
stop_ew();
}
std::string fragments = { "" };
size_t bit;
uint64_t frame_data;
@@ -136,6 +179,7 @@ TouchTunesView::TouchTunesView(
&labels,
&field_pin,
&check_scan,
&check_ew,
&text_status,
&progressbar
});
@@ -145,6 +189,15 @@ TouchTunesView::TouchTunesView(
field_pin.on_change = [this](int32_t 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) {
start_tx(button.id);

View File

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