mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-18 05:51:49 +00:00
BLE List improvements (#1595)
* WIP on add to save list * Added rewriting existing lines and appending new to same file. * format * not looking on new file. * Added temp list due to some issue of recent being updated during save I was receiving a system halt and this seems to fix it. Needs more testing though. * clang format * Stored entries backward. Fix. * Update file working, need to replace temp file though.
This commit is contained in:
@@ -85,6 +85,7 @@ struct BleRecentEntry {
|
||||
uint16_t numHits;
|
||||
ADV_PDU_TYPE pduType;
|
||||
uint8_t channelNumber;
|
||||
bool entryFound;
|
||||
|
||||
BleRecentEntry()
|
||||
: BleRecentEntry{0} {
|
||||
@@ -101,7 +102,8 @@ struct BleRecentEntry {
|
||||
include_name{},
|
||||
numHits{},
|
||||
pduType{},
|
||||
channelNumber{} {
|
||||
channelNumber{},
|
||||
entryFound{} {
|
||||
}
|
||||
|
||||
Key key() const {
|
||||
@@ -188,6 +190,7 @@ class BLERxView : public View {
|
||||
std::string title() const override { return "BLE RX"; };
|
||||
|
||||
private:
|
||||
std::string build_line_str(BleRecentEntry entry);
|
||||
void on_save_file(const std::string value);
|
||||
bool saveFile(const std::filesystem::path& path);
|
||||
void on_data(BlePacketData* packetData);
|
||||
@@ -212,6 +215,8 @@ class BLERxView : public View {
|
||||
std::string filterBuffer{};
|
||||
std::string filter{};
|
||||
std::string listFileBuffer{};
|
||||
std::string headerStr = "Timestamp, MAC Address, Name, Packet Type, Data, Hits, dB, Channel";
|
||||
uint16_t maxLineLength = 140;
|
||||
|
||||
static constexpr auto header_height = 3 * 16;
|
||||
static constexpr auto switch_button_height = 3 * 16;
|
||||
@@ -292,6 +297,7 @@ class BLERxView : public View {
|
||||
std::unique_ptr<BLELogger> logger{};
|
||||
|
||||
BleRecentEntries recent{};
|
||||
BleRecentEntries tempList{};
|
||||
|
||||
const RecentEntriesColumns columns{{
|
||||
{"Mac Address", 17},
|
||||
|
Reference in New Issue
Block a user