BLE Rx/Tx App Cleanup (#1570)

* Showing highest dB first
* Including namestring in search
* Using replace seems to work better.
* bletx cleanup
* removing pop
* pop is needed on this view.
* cleanup switching
* reduce to 1 entry list
* Setting to use the name of BLE with a toggle checkbox.
* Removed &nav reference.
* Removing const
* Fixed issue with memory being run out when switching from a previous app
* Fixed not setting updated progressbar for each new packet.
This commit is contained in:
Netro 2023-11-11 14:46:51 -05:00 committed by GitHub
parent f7f784c0f4
commit a3249cae26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 119 additions and 159 deletions

View file

@ -24,6 +24,8 @@
#ifndef __BLE_RX_APP_H__
#define __BLE_RX_APP_H__
#include "ble_tx_app.hpp"
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
@ -79,6 +81,7 @@ struct BleRecentEntry {
std::string timestamp;
std::string dataString;
std::string nameString;
bool include_name;
uint16_t numHits;
BleRecentEntry()
@ -93,6 +96,7 @@ struct BleRecentEntry {
timestamp{},
dataString{},
nameString{},
include_name{},
numHits{} {
}
@ -118,7 +122,7 @@ class BleRecentEntryDetailView : public View {
private:
NavigationView& nav_;
BleRecentEntry entry_{};
void launch_bletx(BleRecentEntry packetEntry);
BLETxPacket build_packet();
static constexpr uint8_t total_data_lines{5};
@ -167,7 +171,8 @@ class BLERxView : public View {
private:
void on_data(BlePacketData* packetData);
void on_switch_table(const std::string value);
void on_switch_table(std::string value);
void handle_entries_sort(uint8_t index);
void updateEntry(const BlePacketData* packet, BleRecentEntry& entry);
NavigationView& nav_;
@ -228,15 +233,21 @@ class BLERxView : public View {
{"Name", 4}}};
Button button_filter{
{12 * 8, 3 * 8, 4 * 8, 16},
{11 * 8, 3 * 8, 4 * 8, 16},
"Filter"};
Checkbox check_log{
{20 * 8, 3 * 8},
{17 * 8, 3 * 8},
3,
"Log",
true};
Checkbox check_name{
{23 * 8, 3 * 8},
3,
"Name",
true};
Console console{
{0, 4 * 16, 240, 240}};
@ -258,10 +269,7 @@ class BLERxView : public View {
{"dB", 4},
}};
BleRecentEntry entry_{};
BleRecentEntriesView recent_entries_view{columns, recent};
BleRecentEntriesView recent_entries_filter_view{columns, filterEntries};
BleRecentEntryDetailView recent_entry_detail_view{nav_, entry_};
MessageHandlerRegistration message_handler_packet{
Message::ID::BlePacket,