mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Started ADS-B TX UI and frame encoding
This commit is contained in:
parent
57dc1f7aa4
commit
bb6eefe2be
@ -162,7 +162,7 @@ set(CPPSRC
|
||||
ui_spectrum.cpp
|
||||
ui_about.cpp
|
||||
ui_nuoptix.cpp
|
||||
# ui_jammer.cpp
|
||||
ui_adsbtx.cpp
|
||||
ui_handwrite.cpp
|
||||
ui_afsksetup.cpp
|
||||
# ui_closecall.cpp
|
||||
@ -170,8 +170,9 @@ set(CPPSRC
|
||||
ui_rds.cpp
|
||||
ui_lcr.cpp
|
||||
ui_xylos.cpp
|
||||
ui_freqman.cpp
|
||||
# ui_freqman.cpp
|
||||
ui_encoders.cpp
|
||||
ui_jammer.cpp
|
||||
# ui_loadmodule.cpp
|
||||
recent_entries.cpp
|
||||
receiver_model.cpp
|
||||
|
@ -3582,6 +3582,30 @@ ui_about.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_about.cpp.s
|
||||
.PHONY : ui_about.cpp.s
|
||||
|
||||
ui_adsbtx.obj: ui_adsbtx.cpp.obj
|
||||
.PHONY : ui_adsbtx.obj
|
||||
|
||||
# target to build an object file
|
||||
ui_adsbtx.cpp.obj:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_adsbtx.cpp.obj
|
||||
.PHONY : ui_adsbtx.cpp.obj
|
||||
|
||||
ui_adsbtx.i: ui_adsbtx.cpp.i
|
||||
.PHONY : ui_adsbtx.i
|
||||
|
||||
# target to preprocess a source file
|
||||
ui_adsbtx.cpp.i:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_adsbtx.cpp.i
|
||||
.PHONY : ui_adsbtx.cpp.i
|
||||
|
||||
ui_adsbtx.s: ui_adsbtx.cpp.s
|
||||
.PHONY : ui_adsbtx.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
ui_adsbtx.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_adsbtx.cpp.s
|
||||
.PHONY : ui_adsbtx.cpp.s
|
||||
|
||||
ui_afsksetup.obj: ui_afsksetup.cpp.obj
|
||||
.PHONY : ui_afsksetup.obj
|
||||
|
||||
@ -3774,30 +3798,6 @@ ui_font_fixed_8x16.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_font_fixed_8x16.cpp.s
|
||||
.PHONY : ui_font_fixed_8x16.cpp.s
|
||||
|
||||
ui_freqman.obj: ui_freqman.cpp.obj
|
||||
.PHONY : ui_freqman.obj
|
||||
|
||||
# target to build an object file
|
||||
ui_freqman.cpp.obj:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_freqman.cpp.obj
|
||||
.PHONY : ui_freqman.cpp.obj
|
||||
|
||||
ui_freqman.i: ui_freqman.cpp.i
|
||||
.PHONY : ui_freqman.i
|
||||
|
||||
# target to preprocess a source file
|
||||
ui_freqman.cpp.i:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_freqman.cpp.i
|
||||
.PHONY : ui_freqman.cpp.i
|
||||
|
||||
ui_freqman.s: ui_freqman.cpp.s
|
||||
.PHONY : ui_freqman.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
ui_freqman.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_freqman.cpp.s
|
||||
.PHONY : ui_freqman.cpp.s
|
||||
|
||||
ui_handwrite.obj: ui_handwrite.cpp.obj
|
||||
.PHONY : ui_handwrite.obj
|
||||
|
||||
@ -3822,6 +3822,30 @@ ui_handwrite.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_handwrite.cpp.s
|
||||
.PHONY : ui_handwrite.cpp.s
|
||||
|
||||
ui_jammer.obj: ui_jammer.cpp.obj
|
||||
.PHONY : ui_jammer.obj
|
||||
|
||||
# target to build an object file
|
||||
ui_jammer.cpp.obj:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_jammer.cpp.obj
|
||||
.PHONY : ui_jammer.cpp.obj
|
||||
|
||||
ui_jammer.i: ui_jammer.cpp.i
|
||||
.PHONY : ui_jammer.i
|
||||
|
||||
# target to preprocess a source file
|
||||
ui_jammer.cpp.i:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_jammer.cpp.i
|
||||
.PHONY : ui_jammer.cpp.i
|
||||
|
||||
ui_jammer.s: ui_jammer.cpp.s
|
||||
.PHONY : ui_jammer.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
ui_jammer.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_jammer.cpp.s
|
||||
.PHONY : ui_jammer.cpp.s
|
||||
|
||||
ui_lcr.obj: ui_lcr.cpp.obj
|
||||
.PHONY : ui_lcr.obj
|
||||
|
||||
@ -4648,6 +4672,9 @@ help:
|
||||
@echo "... ui_about.obj"
|
||||
@echo "... ui_about.i"
|
||||
@echo "... ui_about.s"
|
||||
@echo "... ui_adsbtx.obj"
|
||||
@echo "... ui_adsbtx.i"
|
||||
@echo "... ui_adsbtx.s"
|
||||
@echo "... ui_afsksetup.obj"
|
||||
@echo "... ui_afsksetup.i"
|
||||
@echo "... ui_afsksetup.s"
|
||||
@ -4672,12 +4699,12 @@ help:
|
||||
@echo "... ui_font_fixed_8x16.obj"
|
||||
@echo "... ui_font_fixed_8x16.i"
|
||||
@echo "... ui_font_fixed_8x16.s"
|
||||
@echo "... ui_freqman.obj"
|
||||
@echo "... ui_freqman.i"
|
||||
@echo "... ui_freqman.s"
|
||||
@echo "... ui_handwrite.obj"
|
||||
@echo "... ui_handwrite.i"
|
||||
@echo "... ui_handwrite.s"
|
||||
@echo "... ui_jammer.obj"
|
||||
@echo "... ui_jammer.i"
|
||||
@echo "... ui_jammer.s"
|
||||
@echo "... ui_lcr.obj"
|
||||
@echo "... ui_lcr.i"
|
||||
@echo "... ui_lcr.s"
|
||||
|
@ -23,9 +23,14 @@
|
||||
// Bitmaps generated with:
|
||||
// Gimp image > indexed colors (16), then "xxd -i *.bmp"
|
||||
|
||||
//BUG: Unistroke text entry screen doesn't care about string max length parameter
|
||||
//BUG (fixed ?): No audio in about when shown second time
|
||||
//BUG: POCSAG RX sometimes misses the first codeword after SYNC
|
||||
|
||||
//TODO: Use ModalMessageView with yes/no for TX
|
||||
//TODO: Show address/data bit fields in OOK TX
|
||||
//TODO: Scan for OOK TX
|
||||
//TODO: Check more OOK encoders
|
||||
//TODO: POCSAG 512 and 2400 (all 3 at the same time, or parameter ?)
|
||||
//TODO: Check AFSK transmit end, skips last bits ?
|
||||
//TODO: Check jammer bandwidths
|
||||
@ -36,7 +41,8 @@
|
||||
|
||||
//Multimon-style stuff:
|
||||
//TODO: AFSK receiver
|
||||
//TODO: Xylos (CCIR) receiver
|
||||
//TODO: CTCSS detector
|
||||
//TODO: DMR detector
|
||||
|
||||
//TODO: Closecall wide range fix
|
||||
//TODO: SD card wiper
|
||||
@ -54,6 +60,7 @@
|
||||
//TODO: Hide statusview when playing dead
|
||||
//TODO: Persistent playdead !
|
||||
|
||||
//In case of disaster:
|
||||
//TODO: Show MD5 mismatches for modules not found, etc...
|
||||
//TODO: Module name/filename in modules.hpp to indicate requirement in case it's not found ui_loadmodule
|
||||
//BUG: Description doesn't show up first time going to system>module info (UI drawn on top)
|
||||
|
@ -97,7 +97,7 @@ std::string to_string_dec_int(
|
||||
return q;
|
||||
}
|
||||
|
||||
static void to_string_hex_internal(char* p, const uint32_t n, const int32_t l) {
|
||||
static void to_string_hex_internal(char* p, const uint64_t n, const int32_t l) {
|
||||
const uint32_t d = n & 0xf;
|
||||
p[l] = (d > 9) ? (d + 55) : (d + 48);
|
||||
if( l > 0 ) {
|
||||
@ -105,8 +105,8 @@ static void to_string_hex_internal(char* p, const uint32_t n, const int32_t l) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string to_string_hex(const uint32_t n, const int32_t l) {
|
||||
char p[16];
|
||||
std::string to_string_hex(const uint64_t n, const int32_t l) {
|
||||
char p[32];
|
||||
to_string_hex_internal(p, n, l - 1);
|
||||
p[l] = 0;
|
||||
return p;
|
||||
|
@ -32,7 +32,7 @@ using namespace lpc43xx;
|
||||
// TODO: Allow l=0 to not fill/justify? Already using this way in ui_spectrum.hpp...
|
||||
std::string to_string_dec_uint(const uint32_t n, const int32_t l = 0, const char fill = 0);
|
||||
std::string to_string_dec_int(const int32_t n, const int32_t l = 0, const char fill = 0);
|
||||
std::string to_string_hex(const uint32_t n, const int32_t l = 0);
|
||||
std::string to_string_hex(const uint64_t n, const int32_t l = 0);
|
||||
|
||||
std::string to_string_datetime(const rtc::RTC& value);
|
||||
std::string to_string_time(const rtc::RTC& value);
|
||||
|
209
firmware/application/ui_adsbtx.cpp
Normal file
209
firmware/application/ui_adsbtx.cpp
Normal file
@ -0,0 +1,209 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2016 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ui_adsbtx.hpp"
|
||||
#include "ui_alphanum.hpp"
|
||||
|
||||
#include "string_format.hpp"
|
||||
#include "portapack.hpp"
|
||||
#include "baseband_api.hpp"
|
||||
#include "portapack_persistent_memory.hpp"
|
||||
|
||||
#include <cstring>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace portapack;
|
||||
|
||||
namespace ui {
|
||||
|
||||
void ADSBTxView::focus() {
|
||||
button_transmit.focus();
|
||||
}
|
||||
|
||||
ADSBTxView::~ADSBTxView() {
|
||||
transmitter_model.disable();
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void ADSBTxView::paint(Painter& painter) {
|
||||
button_callsign.set_text(callsign);
|
||||
}
|
||||
|
||||
void ADSBTxView::generate_frame() {
|
||||
uint8_t b, c, s, bitn;
|
||||
char ch;
|
||||
std::string callsign_formatted(8, '_');
|
||||
uint64_t callsign_coded = 0;
|
||||
uint8_t adsb_crc[14]; // Temp buffer
|
||||
// 1 00100000 01011111 11111111
|
||||
uint32_t crc_poly = 0x1205FFF;
|
||||
|
||||
// Init frame
|
||||
//memset(adsb_frame, 0, 120);
|
||||
|
||||
adsb_frame[0] = (options_format.selected_index_value() << 3) | 5; // DF and CA
|
||||
adsb_frame[1] = 0x48; // ICAO24
|
||||
adsb_frame[2] = 0x40;
|
||||
adsb_frame[3] = 0xD6;
|
||||
adsb_frame[4] = 0x20; // TC
|
||||
|
||||
adsb_frame[11] = 0x00; // Clear CRC
|
||||
adsb_frame[12] = 0x00;
|
||||
adsb_frame[13] = 0x00;
|
||||
|
||||
// Translate and code callsign
|
||||
for (c = 0; c < 8; c++) {
|
||||
ch = callsign[c];
|
||||
for (s = 0; s < 64; s++) {
|
||||
if (ch == icao_id_lut[s]) break;
|
||||
}
|
||||
if (s < 64) {
|
||||
ch = icao_id_lut[s];
|
||||
} else {
|
||||
ch = ' ';
|
||||
s = 32;
|
||||
}
|
||||
callsign_coded |= ((uint64_t)s << ((7 - c) * 6));
|
||||
callsign_formatted[c] = ch;
|
||||
}
|
||||
|
||||
// Insert callsign in frame
|
||||
for (c = 0; c < 6; c++)
|
||||
adsb_frame[c + 5] = (callsign_coded >> ((5 - c) * 8)) & 0xFF;
|
||||
|
||||
// Compute CRC
|
||||
memcpy(adsb_crc, adsb_frames, 14);
|
||||
for (c = 0; c < 11; c++) {
|
||||
for (b = 0; b < 8; b++) {
|
||||
if ((adsb_crc[c] << b) & 0x80) {
|
||||
for (s = 0; s < 25; s++) {
|
||||
bitn = (c * 8) + b + s;
|
||||
if ((crc_poly >> s) & 1) adsb_crc[bitn >> 3] ^= (0x80 >> (bitn & 7));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Insert CRC in frame
|
||||
for (c = 0; c < 3; c++)
|
||||
adsb_frame[c + 11] = adsb_crc[c + 11];
|
||||
|
||||
// Display as text
|
||||
text_message.set(to_string_hex((adsb_frame[11] << 16) + (adsb_frame[12] << 8) + adsb_frame[13], 6));
|
||||
//text_message.set(callsign_formatted);
|
||||
|
||||
//ascii_to_ccir(ccir_message);
|
||||
}
|
||||
|
||||
void ADSBTxView::start_tx() {
|
||||
transmitter_model.set_tuning_frequency(450000000); // FOR TESTING - DEBUG
|
||||
transmitter_model.set_baseband_configuration({
|
||||
.mode = 0,
|
||||
.sampling_rate = 1536000U, // CHANGE !
|
||||
.decimation_factor = 1,
|
||||
});
|
||||
transmitter_model.set_rf_amp(true);
|
||||
transmitter_model.set_lna(40);
|
||||
transmitter_model.set_vga(40);
|
||||
transmitter_model.set_baseband_bandwidth(1750000);
|
||||
transmitter_model.enable();
|
||||
|
||||
//memcpy(shared_memory.tx_data, adsb_frame, 112);
|
||||
//baseband::set_adsb_data(1);
|
||||
}
|
||||
|
||||
// ASCII to frequency LUT index
|
||||
void ADSBTxView::ascii_to_ccir(char *ascii) {
|
||||
uint8_t c;
|
||||
|
||||
for (c = 0; c < 20; c++) {
|
||||
if (ascii[c] > '9')
|
||||
ascii[c] -= 0x37;
|
||||
else
|
||||
ascii[c] -= 0x30;
|
||||
}
|
||||
|
||||
// EOM code for baseband
|
||||
ascii[20] = 0xFF;
|
||||
}
|
||||
|
||||
void ADSBTxView::on_txdone(const int n) {
|
||||
size_t sr;
|
||||
|
||||
if (n == 200) {
|
||||
transmitter_model.disable();
|
||||
progress.set_value(0);
|
||||
|
||||
tx_mode = IDLE;
|
||||
button_transmit.set_style(&style_val);
|
||||
button_transmit.set_text("START");
|
||||
} else {
|
||||
progress.set_value(n);
|
||||
}
|
||||
}
|
||||
|
||||
ADSBTxView::ADSBTxView(NavigationView& nav) {
|
||||
(void)nav;
|
||||
|
||||
baseband::run_image(portapack::spi_flash::image_tag_xylos);
|
||||
|
||||
add_children({ {
|
||||
&text_format,
|
||||
&options_format,
|
||||
&text_icaolabel,
|
||||
&button_icao,
|
||||
&text_callsign,
|
||||
&button_callsign,
|
||||
&progress,
|
||||
&text_message,
|
||||
&button_transmit
|
||||
} });
|
||||
|
||||
options_format.set_by_value(17); // Mode S
|
||||
|
||||
progress.set_max(122);
|
||||
|
||||
options_format.on_change = [this](size_t i, int32_t v) {
|
||||
(void)i;
|
||||
(void)v;
|
||||
generate_frame();
|
||||
};
|
||||
button_callsign.on_select = [this, &nav](Button&) {
|
||||
textentry(nav, callsign, 9);
|
||||
};
|
||||
|
||||
button_transmit.set_style(&style_val);
|
||||
|
||||
generate_frame();
|
||||
|
||||
// Single transmit
|
||||
button_transmit.on_select = [this,&nav](Button&) {
|
||||
if (tx_mode == IDLE) {
|
||||
tx_mode = SINGLE;
|
||||
button_transmit.set_style(&style_cancel);
|
||||
button_transmit.set_text("Wait");
|
||||
generate_frame();
|
||||
start_tx();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} /* namespace ui */
|
136
firmware/application/ui_adsbtx.hpp
Normal file
136
firmware/application/ui_adsbtx.hpp
Normal file
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2016 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ui.hpp"
|
||||
#include "ui_textentry.hpp"
|
||||
#include "ui_widget.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
|
||||
#include "message.hpp"
|
||||
#include "transmitter_model.hpp"
|
||||
#include "portapack.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
class ADSBTxView : public View {
|
||||
public:
|
||||
ADSBTxView(NavigationView& nav);
|
||||
~ADSBTxView();
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "ADS-B transmit"; };
|
||||
|
||||
private:
|
||||
enum tx_modes {
|
||||
IDLE = 0,
|
||||
SINGLE,
|
||||
SEQUENCE
|
||||
};
|
||||
|
||||
tx_modes tx_mode = IDLE;
|
||||
|
||||
char callsign[9] = "KLM1023 ";
|
||||
|
||||
uint8_t adsb_frame[14]; // 112 bit data block as 14 bytes
|
||||
|
||||
const char icao_id_lut[65] = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ##### ###############0123456789######";
|
||||
|
||||
void ascii_to_ccir(char *ascii);
|
||||
void start_tx();
|
||||
void generate_frame();
|
||||
void on_txdone(const int n);
|
||||
|
||||
const Style style_val {
|
||||
.font = font::fixed_8x16,
|
||||
.background = Color::green(),
|
||||
.foreground = Color::black(),
|
||||
};
|
||||
const Style style_cancel {
|
||||
.font = font::fixed_8x16,
|
||||
.background = Color::red(),
|
||||
.foreground = Color::black(),
|
||||
};
|
||||
const Style style_grey {
|
||||
.font = font::fixed_8x16,
|
||||
.background = Color::black(),
|
||||
.foreground = Color::grey(),
|
||||
};
|
||||
|
||||
Text text_format {
|
||||
{ 4 * 8, 1 * 16, 7 * 8, 16 },
|
||||
"Format:"
|
||||
};
|
||||
OptionsField options_format {
|
||||
{ 12 * 8, 1 * 16 },
|
||||
10,
|
||||
{
|
||||
{ "17: ADS-B", 17 },
|
||||
{ "18: TIS-B", 18 },
|
||||
{ "19: Don't.", 19 },
|
||||
}
|
||||
};
|
||||
|
||||
Text text_icaolabel {
|
||||
{ 4 * 8, 3 * 16, 7 * 8, 16 },
|
||||
"ICAO24:"
|
||||
};
|
||||
Button button_icao {
|
||||
{ 12 * 8, 2 * 16 + 12, 8 * 8, 24 },
|
||||
"012345" // 7277A9
|
||||
};
|
||||
|
||||
Text text_callsign {
|
||||
{ 4 * 8, 4 * 16 + 8, 3 * 8, 16 },
|
||||
"ID:"
|
||||
};
|
||||
Button button_callsign {
|
||||
{ 8 * 8, 4 * 16 + 4, 10 * 8, 24 },
|
||||
"" // "KOR151 "
|
||||
};
|
||||
|
||||
ProgressBar progress {
|
||||
{ 5 * 8, 13 * 16, 20 * 8, 16 },
|
||||
};
|
||||
Text text_message {
|
||||
{ 5 * 8, 14 * 16, 20 * 8, 16 },
|
||||
"--------------------"
|
||||
};
|
||||
|
||||
Button button_transmit {
|
||||
{ 2 * 8, 16 * 16, 64, 32 },
|
||||
"START"
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_tx_done {
|
||||
Message::ID::TXDone,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const TXDoneMessage*>(p);
|
||||
this->on_txdone(message.n);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
@ -22,7 +22,8 @@
|
||||
|
||||
#include "ui.hpp"
|
||||
#include "ui_widget.hpp"
|
||||
#include "ui_textentry.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
#include "message.hpp"
|
||||
#include "transmitter_model.hpp"
|
||||
|
||||
@ -199,7 +200,7 @@ private:
|
||||
9, "SAAAAADDDD",
|
||||
"000000000000000000",
|
||||
455000, 2,
|
||||
10 // ?
|
||||
2
|
||||
},
|
||||
|
||||
// HT6*** TODO: Add individual variations
|
||||
@ -210,7 +211,7 @@ private:
|
||||
{ "011011", "001001", "001011" },
|
||||
18, "SAAAAAAAAAAAADDDDDD",
|
||||
"0000000000000000000000000000000000001011001011001",
|
||||
100000, 3,
|
||||
80000, 3,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
|
@ -48,7 +48,8 @@
|
||||
#include "ui_lcr.hpp"
|
||||
#include "analog_audio_app.hpp"
|
||||
//#include "ui_audiotx.hpp" // DEBUG
|
||||
//#include "ui_jammer.hpp" // DEBUG
|
||||
#include "ui_adsbtx.hpp"
|
||||
#include "ui_jammer.hpp"
|
||||
|
||||
#include "analog_audio_app.hpp"
|
||||
#include "ais_app.hpp"
|
||||
@ -220,7 +221,8 @@ void NavigationView::focus() {
|
||||
/* TranspondersMenuView **************************************************/
|
||||
|
||||
TranspondersMenuView::TranspondersMenuView(NavigationView& nav) {
|
||||
add_items<3>({ {
|
||||
add_items<4>({ {
|
||||
{ "ADS-B: Planes", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } },
|
||||
{ "AIS: Boats", ui::Color::white(), [&nav](){ nav.push<AISAppView>(); } },
|
||||
{ "ERT: Utility Meters", ui::Color::white(), [&nav](){ nav.push<ERTAppView>(); } },
|
||||
{ "TPMS: Cars", ui::Color::white(), [&nav](){ nav.push<TPMSAppView>(); } },
|
||||
@ -231,10 +233,41 @@ TranspondersMenuView::TranspondersMenuView(NavigationView& nav) {
|
||||
/* ReceiverMenuView ******************************************************/
|
||||
|
||||
ReceiverMenuView::ReceiverMenuView(NavigationView& nav) {
|
||||
add_items<3>({ {
|
||||
{ "Audio", ui::Color::white(), [&nav](){ nav.push<AnalogAudioView>(); } },
|
||||
{ "Transponders", ui::Color::white(), [&nav](){ nav.push<TranspondersMenuView>(); } },
|
||||
{ "POCSAG", ui::Color::cyan(), [&nav](){ nav.push<POCSAGAppView>(); } },
|
||||
add_items<7>({ {
|
||||
{ "Audio", ui::Color::green(), [&nav](){ nav.push<AnalogAudioView>(); } },
|
||||
{ "Transponders", ui::Color::green(), [&nav](){ nav.push<TranspondersMenuView>(); } },
|
||||
{ "POCSAG 1200", ui::Color::cyan(), [&nav](){ nav.push<POCSAGAppView>(); } },
|
||||
{ "Nordic/BTLE", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } },
|
||||
{ "SIGFOX", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } }, // SIGFRXView
|
||||
{ "CCIR", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } }, // XylosRXView
|
||||
{ "AFSK", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } }, // AFSKRXView
|
||||
} });
|
||||
on_left = [&nav](){ nav.pop(); };
|
||||
}
|
||||
|
||||
/* TransmitterCodedMenuView ******************************************************/
|
||||
|
||||
TransmitterCodedMenuView::TransmitterCodedMenuView(NavigationView& nav) {
|
||||
add_items<7>({ {
|
||||
{ "ADS-B Mode S", ui::Color::yellow(), [&nav](){ nav.push<ADSBTxView>(); } },
|
||||
{ "BHT Epar", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } },
|
||||
{ "BHT Xylos", ui::Color::yellow(), [&nav](){ nav.push<XylosView>(); } },
|
||||
{ "Nuoptix DTMF timecode", ui::Color::green(), [&nav](){ nav.push<NuoptixView>(); } },
|
||||
{ "OOK remote encoders", ui::Color::green(), [&nav](){ nav.push<EncodersView>(); } },
|
||||
{ "RDS", ui::Color::orange(), [&nav](){ nav.push<RDSView>(); } },
|
||||
{ "TEDI/LCR AFSK", ui::Color::green(), [&nav](){ nav.push<LCRView>(); } },
|
||||
} });
|
||||
on_left = [&nav](){ nav.pop(); };
|
||||
}
|
||||
|
||||
/* TransmitterAudioMenuView ******************************************************/
|
||||
|
||||
TransmitterAudioMenuView::TransmitterAudioMenuView(NavigationView& nav) {
|
||||
add_items<4>({ {
|
||||
{ "Soundboard", ui::Color::yellow(), [&nav](){ nav.push<SoundBoardView>(); } },
|
||||
{ "Numbers station", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } }, //nav.push<NumbersStationView>();
|
||||
{ "Microphone", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } },
|
||||
{ "Whistle", ui::Color::grey(), [&nav](){ nav.push<NotImplementedView>(); } },
|
||||
} });
|
||||
on_left = [&nav](){ nav.pop(); };
|
||||
}
|
||||
@ -242,37 +275,22 @@ ReceiverMenuView::ReceiverMenuView(NavigationView& nav) {
|
||||
/* SystemMenuView ********************************************************/
|
||||
|
||||
SystemMenuView::SystemMenuView(NavigationView& nav) {
|
||||
add_items<13>({ {
|
||||
add_items<10>({ {
|
||||
{ "Play dead", ui::Color::red(), [&nav](){ nav.push<PlayDeadView>(false); } },
|
||||
{ "Receiver RX", ui::Color::cyan(), [&nav](){ nav.push<ReceiverMenuView>(); } },
|
||||
{ "Capture RX", ui::Color::cyan(), [&nav](){ nav.push<CaptureAppView>(); } },
|
||||
{ "Receivers", ui::Color::cyan(), [&nav](){ nav.push<ReceiverMenuView>(); } },
|
||||
{ "Capture", ui::Color::cyan(), [&nav](){ nav.push<CaptureAppView>(); } },
|
||||
{ "Code transmitters", ui::Color::purple(), [&nav](){ nav.push<TransmitterCodedMenuView>(); } },
|
||||
{ "Audio transmitters", ui::Color::purple(), [&nav](){ nav.push<TransmitterAudioMenuView>(); } },
|
||||
//{ "Close Call RX", ui::Color::cyan(), [&nav](){ nav.push<CloseCallView>(); } },
|
||||
//{ "Numbers station TX", ui::Color::purple(), [&nav](){ nav.push<NotImplementedView>(); } }, //nav.push<NumbersStationView>();
|
||||
//{ "Pokemon GO Away TX", ui::Color::blue(), [&nav](){ nav.push<JammerView>(); } },
|
||||
{ "Soundboard TX", ui::Color::yellow(), [&nav](){ nav.push<SoundBoardView>(); } },
|
||||
//{ "Audio TX", ui::Color::yellow(), [&nav](){ nav.push<LoadModuleView>(md5_baseband_tx, AudioTX); } },
|
||||
{ "Jammer", ui::Color::orange(), [&nav](){ nav.push<JammerView>(); } },
|
||||
//{ "Frequency manager", ui::Color::white(), [&nav](){ nav.push<FreqManView>(); } },
|
||||
//{ "EPAR TX", ui::Color::green(), [&nav](){ nav.push<LoadModuleView>(md5_baseband_tx, EPAR); } },
|
||||
{ "Xylos TX", ui::Color::green(), [&nav](){ nav.push<XylosView>(); } },
|
||||
{ "TEDI/LCR TX", ui::Color::yellow(), [&nav](){ nav.push<LCRView>(); } },
|
||||
{ "OOK encoders TX", ui::Color::orange(), [&nav](){ nav.push<EncodersView>(); } },
|
||||
{ "Nuoptix DTMF sync TX", ui::Color::purple(), [&nav](){ nav.push<NuoptixView>(); } },
|
||||
{ "RDS TX", ui::Color::red(), [&nav](){ nav.push<RDSView>(); } },
|
||||
//{ "Analyze", ui::Color::white(), [&nav](){ nav.push<NotImplementedView>(); } },
|
||||
{ "Setup", ui::Color::white(), [&nav](){ nav.push<SetupMenuView>(); } },
|
||||
{ "Debug", ui::Color::white(), [&nav](){ nav.push<DebugMenuView>(); } },
|
||||
{ "HackRF", ui::Color::white(), [&nav](){ nav.push<HackRFFirmwareView>(); } },
|
||||
{ "About", ui::Color::white(), [&nav](){ nav.push<AboutView>(); } }
|
||||
} });
|
||||
|
||||
//{ "Nordic/BTLE RX", ui::Color::cyan(), [&nav](){ nav.push(new NotImplementedView { nav }); } },
|
||||
//{ "Jammer", ui::Color::white(), [&nav](){ nav.push<LoadModuleView>(md5_baseband, new JammerView(nav)); } },
|
||||
//{ "Audio file TX", ui::Color::white(), [&nav](){ nav.push(new NotImplementedView { nav }); } },
|
||||
//{ "Whistle", ui::Color::purple(), [&nav](){ nav.push(new LoadModuleView { nav, md5_baseband, new WhistleView { nav, transmitter_model }}); } },
|
||||
//{ "SIGFOX RX", ui::Color::orange(), [&nav](){ nav.push(new LoadModuleView { nav, md5_baseband, new SIGFRXView { nav, receiver_model }}); } },
|
||||
//{ "Xylos RX", ui::Color::green(), [&nav](){ nav.push(new LoadModuleView { nav, md5_baseband_tx, new XylosRXView { nav, receiver_model }}); } },
|
||||
//{ "AFSK RX", ui::Color::cyan(), [&nav](){ nav.push(new LoadModuleView { nav, md5_baseband, new AFSKRXView { nav, receiver_model }}); } },
|
||||
|
||||
}
|
||||
|
||||
/* SystemView ************************************************************/
|
||||
@ -291,8 +309,6 @@ SystemView::SystemView(
|
||||
{
|
||||
set_style(&style_default);
|
||||
|
||||
//char debugtxt[21]; // DEBUG
|
||||
|
||||
constexpr ui::Dim status_view_height = 16;
|
||||
|
||||
add_child(&status_view);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2016 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
@ -176,6 +177,19 @@ private:
|
||||
class ReceiverMenuView : public MenuView {
|
||||
public:
|
||||
ReceiverMenuView(NavigationView& nav);
|
||||
std::string title() const override { return "Receivers"; };
|
||||
};
|
||||
|
||||
class TransmitterCodedMenuView : public MenuView {
|
||||
public:
|
||||
TransmitterCodedMenuView(NavigationView& nav);
|
||||
std::string title() const override { return "Coded TX"; };
|
||||
};
|
||||
|
||||
class TransmitterAudioMenuView : public MenuView {
|
||||
public:
|
||||
TransmitterAudioMenuView(NavigationView& nav);
|
||||
std::string title() const override { return "Audio TX"; };
|
||||
};
|
||||
|
||||
class SystemMenuView : public MenuView {
|
||||
|
@ -550,13 +550,11 @@ public:
|
||||
class RetuneMessage : public Message {
|
||||
public:
|
||||
constexpr RetuneMessage(
|
||||
const int64_t freq
|
||||
) : Message { ID::Retune },
|
||||
freq(freq)
|
||||
) : Message { ID::Retune }
|
||||
{
|
||||
}
|
||||
|
||||
const int64_t freq = 0;
|
||||
int64_t freq = 0;
|
||||
};
|
||||
|
||||
class AudioTXConfigMessage : public Message {
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user