mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 14:12:31 -04:00
BLE Rx improvements. (#1550)
* Added parsing for ble name added focus for ble tx play button. * Added sort by name * Fixed issue where we were pushing too early before pop was finished. * Fix ordering * Fix field location. * truncating entries to stop memory overflow * Added Number of Hits. * Limiting number of hits to uint16_t, as any higher would overflow screen * Limiting number of hits to uint16_t due to possible screen overflow. * Stop creating a log every time app starts. Cluttering log folder.
This commit is contained in:
parent
1639348b94
commit
b178462e47
3 changed files with 128 additions and 46 deletions
|
@ -78,6 +78,8 @@ struct BleRecentEntry {
|
|||
BlePacketData packetData;
|
||||
std::string timestamp;
|
||||
std::string dataString;
|
||||
std::string nameString;
|
||||
uint16_t numHits;
|
||||
|
||||
BleRecentEntry()
|
||||
: BleRecentEntry{0} {
|
||||
|
@ -89,7 +91,9 @@ struct BleRecentEntry {
|
|||
dbValue{},
|
||||
packetData{},
|
||||
timestamp{},
|
||||
dataString{} {
|
||||
dataString{},
|
||||
nameString{},
|
||||
numHits{} {
|
||||
}
|
||||
|
||||
Key key() const {
|
||||
|
@ -117,10 +121,17 @@ class BleRecentEntryDetailView : public View {
|
|||
|
||||
static constexpr uint8_t total_data_lines{5};
|
||||
|
||||
Labels label_mac_address{
|
||||
{{0 * 8, 0 * 16}, "Mac Address:", Color::light_grey()}};
|
||||
|
||||
Text text_mac_address{
|
||||
{12 * 8, 0 * 16, 17 * 8, 16},
|
||||
"-"};
|
||||
|
||||
Labels labels{
|
||||
{{0 * 8, 0 * 16}, "Len", Color::light_grey()},
|
||||
{{5 * 8, 0 * 16}, "Type", Color::light_grey()},
|
||||
{{10 * 8, 0 * 16}, "Value", Color::light_grey()},
|
||||
{{0 * 8, 2 * 16}, "Len", Color::light_grey()},
|
||||
{{5 * 8, 2 * 16}, "Type", Color::light_grey()},
|
||||
{{10 * 8, 2 * 16}, "Value", Color::light_grey()},
|
||||
};
|
||||
|
||||
Button button_done{
|
||||
|
@ -199,26 +210,28 @@ class BLERxView : public View {
|
|||
Channel channel{
|
||||
{24 * 8, 5, 6 * 8, 4}};
|
||||
|
||||
Labels label_sort{
|
||||
{{0 * 8, 3 * 8}, "Sort:", Color::light_grey()}};
|
||||
|
||||
OptionsField options_sort{
|
||||
{5 * 8, 3 * 8},
|
||||
4,
|
||||
{{"MAC", 0},
|
||||
{"Hits", 1},
|
||||
{"dB", 2},
|
||||
{"Time", 3},
|
||||
{"Name", 4}}};
|
||||
|
||||
Button button_filter{
|
||||
{12 * 8, 3 * 8, 4 * 8, 16},
|
||||
"Filter"};
|
||||
|
||||
Checkbox check_log{
|
||||
{0 * 8, 3 * 8},
|
||||
{20 * 8, 3 * 8},
|
||||
3,
|
||||
"Log",
|
||||
true};
|
||||
|
||||
Labels label_sort{
|
||||
{{6 * 8, 3 * 8}, "Sort:", Color::light_grey()}};
|
||||
|
||||
OptionsField options_sort{
|
||||
{12 * 8, 3 * 8},
|
||||
6,
|
||||
{{"MAC", 0},
|
||||
{"dB", 1},
|
||||
{"Recent", 2}}};
|
||||
|
||||
Button button_message{
|
||||
{22 * 8, 3 * 8, 4 * 8, 16},
|
||||
"Filter"};
|
||||
|
||||
Console console{
|
||||
{0, 4 * 16, 240, 240}};
|
||||
|
||||
|
@ -231,17 +244,13 @@ class BLERxView : public View {
|
|||
|
||||
std::unique_ptr<BLELogger> logger{};
|
||||
|
||||
// const RecentEntriesColumns columns{{{"Source", 9},
|
||||
// {"Loc", 6},
|
||||
// {"Hits", 4},
|
||||
// {"Time", 8}}};
|
||||
|
||||
BleRecentEntries recent{};
|
||||
BleRecentEntries filterEntries{};
|
||||
|
||||
const RecentEntriesColumns columns{{
|
||||
{"Mac Address", 20},
|
||||
{"dB", 20},
|
||||
{"Mac Address", 17},
|
||||
{"Hits", 7},
|
||||
{"dB", 4},
|
||||
}};
|
||||
|
||||
BleRecentEntry entry_{};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue