mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-28 11:12:26 -04:00
ADS-B TX works well enough for dump1090 and gr-air-modes
Hooked ADS-B RX to baseband instead of debug IQ file, not tested
This commit is contained in:
parent
b57b41753f
commit
5a67a7080a
23 changed files with 949 additions and 437 deletions
|
@ -26,12 +26,48 @@
|
|||
//#include "ui_widget.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
#include "recent_entries.hpp"
|
||||
|
||||
#include "message.hpp"
|
||||
#include "portapack.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
struct ADSBRecentEntry {
|
||||
using Key = uint32_t;
|
||||
|
||||
static constexpr Key invalid_key = 0xffffffff;
|
||||
|
||||
uint32_t ICAO_address;
|
||||
uint8_t raw_data[14] { }; // 112 bits at most
|
||||
std::string time { "" };
|
||||
|
||||
ADSBRecentEntry(
|
||||
) : ADSBRecentEntry { 0 }
|
||||
{
|
||||
}
|
||||
|
||||
ADSBRecentEntry(
|
||||
const uint32_t ICAO_address
|
||||
) : ICAO_address { ICAO_address }
|
||||
{
|
||||
}
|
||||
|
||||
Key key() const {
|
||||
return ICAO_address;
|
||||
}
|
||||
|
||||
void set_time(std::string& new_time) {
|
||||
time = new_time;
|
||||
}
|
||||
|
||||
void set_raw(uint8_t * raw_ptr) {
|
||||
memcpy(raw_data, raw_ptr, 14);
|
||||
}
|
||||
};
|
||||
|
||||
using ADSBRecentEntries = RecentEntries<ADSBRecentEntry>;
|
||||
|
||||
class ADSBRxView : public View {
|
||||
public:
|
||||
ADSBRxView(NavigationView& nav);
|
||||
|
@ -42,16 +78,24 @@ public:
|
|||
std::string title() const override { return "ADS-B debug"; };
|
||||
|
||||
private:
|
||||
static constexpr float k = 1.0f / 128.0f;
|
||||
//static constexpr float k = 1.0f / 128.0f;
|
||||
|
||||
File iq_file { };
|
||||
size_t f_offset { 0 };
|
||||
//File iq_file { };
|
||||
//size_t f_offset { 0 };
|
||||
|
||||
bool analyze(uint64_t offset);
|
||||
//bool analyze(uint64_t offset);
|
||||
void on_frame(const ADSBFrameMessage * message);
|
||||
|
||||
Labels labels {
|
||||
const RecentEntriesColumns columns { {
|
||||
{ "Raw", 21 },
|
||||
{ "Time", 8 },
|
||||
} };
|
||||
ADSBRecentEntries recent { };
|
||||
RecentEntriesView<RecentEntries<ADSBRecentEntry>> recent_entries_view { columns, recent };
|
||||
|
||||
/*Labels labels {
|
||||
{ { 0 * 8, 0 * 8 }, "Test", Color::light_grey() }
|
||||
};
|
||||
};*/
|
||||
|
||||
NumberField offset_field {
|
||||
{ 0, 0 },
|
||||
|
@ -60,10 +104,6 @@ private:
|
|||
1,
|
||||
'0'
|
||||
};
|
||||
Text text_debug_e {
|
||||
{ 7 * 8, 0 * 16, 14 * 8, 16 },
|
||||
"-"
|
||||
};
|
||||
|
||||
Text text_debug_a {
|
||||
{ 0 * 8, 1 * 16, 30 * 8, 16 },
|
||||
|
@ -77,24 +117,19 @@ private:
|
|||
{ 0 * 8, 3 * 16, 30 * 8, 16 },
|
||||
"-"
|
||||
};
|
||||
Text text_debug_d {
|
||||
{ 0 * 8, 4 * 16, 30 * 8, 16 },
|
||||
"-"
|
||||
};
|
||||
|
||||
Button button_ffw {
|
||||
/*Button button_ffw {
|
||||
{ 184, 0 * 16, 56, 16 },
|
||||
"FFW"
|
||||
};
|
||||
|
||||
/*
|
||||
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.done);
|
||||
}
|
||||
};*/
|
||||
|
||||
MessageHandlerRegistration message_handler_frame {
|
||||
Message::ID::ADSBFrame,
|
||||
[this](Message* const p) {
|
||||
const auto message = static_cast<const ADSBFrameMessage*>(p);
|
||||
this->on_frame(message);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue