Compare commits

...

14 Commits

Author SHA1 Message Date
Mark Thompson 1cbe5cb293 Save TPMS units in App Settings and tune frequency (#1598) 2023-11-21 18:44:10 +01:00
gullradriel df6003c08f fix button label (#1597)
Co-authored-by: GullCode <gullradriel@hotmail.com>
2023-11-20 12:09:47 -05:00
Netro 50fcbf0f5a BLE: added deleting and renaming temp file (#1596) 2023-11-20 08:37:56 +01:00
Netro 5a1676a0b9 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.
2023-11-19 20:53:53 -05:00
gullradriel 309f2fbd2c support for a sdcard speed option (#1594)
* support for a sdcard speed option

* trying to link sdio_cclk_set from file

* changed io to IO in checkbox text

* changed order so high speed option is read after pmem is restored from sd

* test button

* took out unneeded comment

* force behavior of test button

---------

Co-authored-by: GullCode <gullradriel@hotmail.com>
2023-11-19 08:08:29 -06:00
gullradriel 650aacfaa7 BLE RX: added clear list button (#1593)
* added clear list button

* Bigger buttons and text

* Change case on labels

---------

Co-authored-by: GullCode <gullradriel@hotmail.com>
2023-11-18 16:32:52 -05:00
Mark Thompson 8655027a5b Fixed SPI Read timing issue affecting MAX283x chips (#1590)
* Slowed SPI timing to MAX283x by 20%

* Fix temperature scaling
2023-11-18 09:50:57 -06:00
Mark Thompson de937f02d4 Added Memory Dump app for Debug (#1588)
* Add files via upload

* Add files via upload

* Added single word read/write support

* Add files via upload
2023-11-18 07:16:56 -06:00
Mark Thompson 2c0446e83d Improved Focus Manager navigation (#1589)
* Focus manager navigation fix

* Add files via upload
2023-11-18 06:58:38 -06:00
Netro 9e6699d8cc Fixed name. (#1586) 2023-11-17 13:28:09 -05:00
Mark Thompson ef92c5bc0a Enhanced Debug -> Peripherals app to allow direct register modification (#1584)
* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Clang

* Clang

* Tweak position of field on screen

* Reverted text on Write button per reviewer feedback
2023-11-17 12:10:11 -06:00
Netro 10f6600f52 No need limit to 50 since we moved to min 16ms send times. (#1583) 2023-11-16 21:28:22 +01:00
Netro aeb607e73b BLE Rx Save List / Save packet from BLE Rx (#1582)
* Added Tx Save from Rx Details View
* Added saving of current list
2023-11-16 20:00:52 +01:00
Netro 8479d2edf0 BLE Comm WIP (#1578)
* Initial BLE Comm commit.
* SCAN_RSP MAC was reversed.
* Added Auto Channel Hop.
* Improvements to Tx to better handle timers.
* Auto channel and more work on timers.
* more advertisement numbers.
2023-11-16 14:46:45 +01:00
38 changed files with 2335 additions and 740 deletions
+1
View File
@@ -244,6 +244,7 @@ set(CPPSRC
apps/ais_app.cpp
apps/analog_audio_app.cpp
apps/analog_tv_app.cpp
apps/ble_comm_app.cpp
apps/ble_rx_app.cpp
apps/ble_tx_app.cpp
apps/capture_app.cpp
+331
View File
@@ -0,0 +1,331 @@
/*
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek
* Copyright (C) 2023 TJ Baginski
*
* 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 "ble_comm_app.hpp"
#include "ui_modemsetup.hpp"
#include "modems.hpp"
#include "audio.hpp"
#include "rtc_time.hpp"
#include "baseband_api.hpp"
#include "string_format.hpp"
#include "portapack_persistent_memory.hpp"
#include "ui_text.hpp"
using namespace portapack;
using namespace modems;
void BLECommLogger::log_raw_data(const std::string& data) {
log_file.write_entry(data);
}
namespace ui {
static std::uint64_t get_freq_by_channel_number(uint8_t channel_number) {
uint64_t freq_hz;
switch (channel_number) {
case 37:
freq_hz = 2'402'000'000ull;
break;
case 38:
freq_hz = 2'426'000'000ull;
break;
case 39:
freq_hz = 2'480'000'000ull;
break;
case 0 ... 10:
freq_hz = 2'404'000'000ull + channel_number * 2'000'000ull;
break;
case 11 ... 36:
freq_hz = 2'428'000'000ull + (channel_number - 11) * 2'000'000ull;
break;
default:
freq_hz = UINT64_MAX;
}
return freq_hz;
}
void BLECommView::focus() {
options_channel.focus();
}
BLECommView::BLECommView(NavigationView& nav)
: nav_{nav} {
add_children({&rssi,
&channel,
&field_rf_amp,
&field_lna,
&field_vga,
&options_channel,
&field_frequency,
&label_send_adv,
&button_send_adv,
&check_log,
&label_packets_sent,
&text_packets_sent,
&console});
field_frequency.set_step(0);
button_send_adv.on_select = [this](ImageButton&) {
this->toggle();
};
check_log.set_value(logging);
check_log.on_select = [this](Checkbox&, bool v) {
str_log = "";
logging = v;
if (logger && logging)
logger->append(LOG_ROOT_DIR "/BLELOG_" + to_string_timestamp(rtc_time::now()) + ".TXT");
};
options_channel.on_change = [this](size_t, int32_t i) {
// If we selected Auto don't do anything and Auto will handle changing.
if (i == 40) {
auto_channel = true;
return;
} else {
auto_channel = false;
}
field_frequency.set_value(get_freq_by_channel_number(i));
channel_number_rx = i;
channel_number_tx = i;
};
options_channel.set_selected_index(3, true);
logger = std::make_unique<BLECommLogger>();
// Generate new random Mac Address upon each new startup.
generateRandomMacAddress(randomMac);
// Setup Initial Advertise Packet.
advertisePacket = build_adv_packet();
}
void BLECommView::set_parent_rect(const Rect new_parent_rect) {
View::set_parent_rect(new_parent_rect);
const Rect content_rect{0, header_height, new_parent_rect.width(), new_parent_rect.height() - header_height};
console.set_parent_rect(content_rect);
}
BLECommView::~BLECommView() {
receiver_model.disable();
transmitter_model.disable();
baseband::shutdown();
}
bool BLECommView::in_tx_mode() const {
return (bool)is_running_tx;
}
void BLECommView::toggle() {
if (in_tx_mode()) {
sendAdvertisement(false);
} else {
sendAdvertisement(true);
}
}
BLETxPacket BLECommView::build_adv_packet() {
BLETxPacket bleTxPacket;
memset(&bleTxPacket, 0, sizeof(BLETxPacket));
std::string dataString = "11094861636b524620506f7274617061636b";
strncpy(bleTxPacket.macAddress, randomMac, 12);
strncpy(bleTxPacket.advertisementData, dataString.c_str(), dataString.length());
// Duty cycle of 40% per 100ms advertisment periods.
strncpy(bleTxPacket.packetCount, "80", 3);
bleTxPacket.packet_count = 80;
bleTxPacket.packetType = PKT_TYPE_DISCOVERY;
return bleTxPacket;
}
void BLECommView::sendAdvertisement(bool enable) {
if (enable) {
startTx(advertisePacket);
is_adv = true;
} else {
is_adv = false;
stopTx();
}
}
void BLECommView::startTx(BLETxPacket packetToSend) {
int randomChannel = channel_number_tx;
if (auto_channel) {
int min = 37;
int max = 39;
randomChannel = min + std::rand() % (max - min + 1);
field_frequency.set_value(get_freq_by_channel_number(randomChannel));
}
if (!in_tx_mode()) {
switch_rx_tx(false);
currentPacket = packetToSend;
packet_counter = currentPacket.packet_count;
button_send_adv.set_bitmap(&bitmap_stop);
baseband::set_btletx(randomChannel, currentPacket.macAddress, currentPacket.advertisementData, currentPacket.packetType);
transmitter_model.set_tx_gain(47);
transmitter_model.enable();
is_running_tx = true;
} else {
baseband::set_btletx(randomChannel, currentPacket.macAddress, currentPacket.advertisementData, currentPacket.packetType);
}
if ((packet_counter % 10) == 0) {
text_packets_sent.set(to_string_dec_uint(packet_counter));
}
is_sending = true;
packet_counter--;
}
void BLECommView::stopTx() {
button_send_adv.set_bitmap(&bitmap_play);
text_packets_sent.set(to_string_dec_uint(packet_counter));
switch_rx_tx(true);
baseband::set_btlerx(channel_number_rx);
receiver_model.enable();
is_running_tx = false;
}
void BLECommView::switch_rx_tx(bool inRxMode) {
if (inRxMode) {
// Start Rx
transmitter_model.disable();
baseband::shutdown();
baseband::run_image(portapack::spi_flash::image_tag_btle_rx);
} else {
// Start Tx
receiver_model.disable();
baseband::shutdown();
baseband::run_image(portapack::spi_flash::image_tag_btle_tx);
}
}
void BLECommView::on_data(BlePacketData* packet) {
parse_received_packet(packet, (ADV_PDU_TYPE)packet->type);
}
// called each 1/60th of second, so 6 = 100ms
void BLECommView::on_timer() {
// Send advertise burst only once every 100ms
if (++timer_counter == timer_period) {
timer_counter = 0;
if (!is_adv) {
sendAdvertisement(true);
}
}
}
void BLECommView::on_tx_progress(const bool done) {
if (done) {
if (in_tx_mode()) {
is_sending = false;
if (packet_counter == 0) {
if (is_adv) {
sendAdvertisement(false);
} else {
stopTx();
}
} else {
startTx(currentPacket);
}
}
}
}
void BLECommView::parse_received_packet(const BlePacketData* packet, ADV_PDU_TYPE pdu_type) {
std::string data_string;
int i;
for (i = 0; i < packet->dataLen; i++) {
data_string += to_string_hex(packet->data[i], 2);
}
receivedPacket.dbValue = packet->max_dB;
receivedPacket.timestamp = to_string_timestamp(rtc_time::now());
receivedPacket.dataString = data_string;
receivedPacket.packetData.type = packet->type;
receivedPacket.packetData.size = packet->size;
receivedPacket.packetData.dataLen = packet->dataLen;
receivedPacket.packetData.macAddress[0] = packet->macAddress[0];
receivedPacket.packetData.macAddress[1] = packet->macAddress[1];
receivedPacket.packetData.macAddress[2] = packet->macAddress[2];
receivedPacket.packetData.macAddress[3] = packet->macAddress[3];
receivedPacket.packetData.macAddress[4] = packet->macAddress[4];
receivedPacket.packetData.macAddress[5] = packet->macAddress[5];
receivedPacket.numHits++;
for (int i = 0; i < packet->dataLen; i++) {
receivedPacket.packetData.data[i] = packet->data[i];
}
if (pdu_type == SCAN_REQ || pdu_type == CONNECT_REQ) {
ADV_PDU_PAYLOAD_TYPE_1_3* directed_mac_data = (ADV_PDU_PAYLOAD_TYPE_1_3*)packet->data;
std::reverse(directed_mac_data->A1, directed_mac_data->A1 + 6);
console.clear(true);
std::string str_console = "";
std::string pduTypeStr = "";
if (pdu_type == SCAN_REQ) {
pduTypeStr += "SCAN_REQ";
} else if (pdu_type == CONNECT_REQ) {
pduTypeStr += "CONNECT_REQ";
}
str_console += "PACKET TYPE:" + pduTypeStr + "\n";
str_console += "MY MAC:" + to_string_formatted_mac_address(randomMac) + "\n";
str_console += "SCAN MAC:" + to_string_mac_address(directed_mac_data->A1, 6, false) + "\n";
console.write(str_console);
}
}
} /* namespace ui */
+203
View File
@@ -0,0 +1,203 @@
/*
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek
* Copyright (C) 2023 TJ Baginski
*
* 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.
*/
#ifndef __BLE_COMM_APP_H__
#define __BLE_COMM_APP_H__
#include "ble_rx_app.hpp"
#include "ble_tx_app.hpp"
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_receiver.hpp"
#include "ui_transmitter.hpp"
#include "ui_freq_field.hpp"
#include "ui_record_view.hpp"
#include "app_settings.hpp"
#include "radio_state.hpp"
#include "log_file.hpp"
#include "utility.hpp"
#include "recent_entries.hpp"
class BLECommLogger {
public:
Optional<File::Error> append(const std::string& filename) {
return log_file.append(filename);
}
void log_raw_data(const std::string& data);
private:
LogFile log_file{};
};
namespace ui {
class BLECommView : public View {
public:
BLECommView(NavigationView& nav);
~BLECommView();
void set_parent_rect(const Rect new_parent_rect) override;
void paint(Painter&) override{};
void focus() override;
std::string title() const override { return "BLE Comm"; };
private:
BLETxPacket build_adv_packet();
void switch_rx_tx(bool inRxMode);
void startTx(BLETxPacket packetToSend);
void stopTx();
void toggle();
bool in_tx_mode() const;
void on_timer();
void on_data(BlePacketData* packetData);
void on_tx_progress(const bool done);
void parse_received_packet(const BlePacketData* packet, ADV_PDU_TYPE pdu_type);
void sendAdvertisement(bool enable);
NavigationView& nav_;
RxRadioState radio_state_rx_{
2'402'000'000 /* frequency */,
4'000'000 /* bandwidth */,
4'000'000 /* sampling rate */,
ReceiverModel::Mode::WidebandFMAudio};
TxRadioState radio_state_tx_{
2'402'000'000 /* frequency */,
4'000'000 /* bandwidth */,
4'000'000 /* sampling rate */
};
app_settings::SettingsManager settings_{
"BLE Comm Tx", app_settings::Mode::RX_TX};
uint8_t console_color{0};
uint32_t prev_value{0};
uint8_t channel_number_tx = 37;
uint8_t channel_number_rx = 37;
bool auto_channel = false;
char randomMac[13] = "010203040506";
bool is_running_tx = false;
bool is_sending = false;
bool is_adv = false;
int16_t timer_period{6}; // Delay each packet by 16ms.
int16_t timer_counter = 0;
int16_t timer_rx_counter = 0;
int16_t timer_rx_period{12}; // Poll Rx for at least 200ms. (TBD)
uint32_t packet_counter{0};
BLETxPacket advertisePacket{};
BLETxPacket currentPacket{};
BleRecentEntry receivedPacket{};
static constexpr auto header_height = 5 * 16;
OptionsField options_channel{
{0 * 8, 0 * 8},
5,
{{"Ch.37 ", 37},
{"Ch.38", 38},
{"Ch.39", 39},
{"Auto", 40}}};
RxFrequencyField field_frequency{
{6 * 8, 0 * 16},
nav_};
RFAmpField field_rf_amp{
{16 * 8, 0 * 16}};
LNAGainField field_lna{
{18 * 8, 0 * 16}};
VGAGainField field_vga{
{21 * 8, 0 * 16}};
RSSI rssi{
{24 * 8, 0, 6 * 8, 4}};
Channel channel{
{24 * 8, 5, 6 * 8, 4}};
Labels label_send_adv{
{{0 * 8, 2 * 8}, "Send Advertisement:", Color::light_grey()}};
ImageButton button_send_adv{
{21 * 8, 1 * 16, 10 * 8, 2 * 16},
&bitmap_play,
Color::green(),
Color::black()};
Checkbox check_log{
{24 * 8, 2 * 8},
3,
"Log",
true};
Labels label_packets_sent{
{{0 * 8, 4 * 8}, "Packets Left:", Color::light_grey()}};
Text text_packets_sent{
{13 * 8, 2 * 16, 12 * 8, 16},
"-"};
Console console{
{0, 4 * 16, 240, 240}};
std::string str_log{""};
bool logging{false};
std::unique_ptr<BLECommLogger> logger{};
MessageHandlerRegistration message_handler_packet{
Message::ID::BlePacket,
[this](Message* const p) {
const auto message = static_cast<const BLEPacketMessage*>(p);
this->on_data(message->packet);
}};
MessageHandlerRegistration message_handler_tx_progress{
Message::ID::TXProgress,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
this->on_tx_progress(message.done);
}};
MessageHandlerRegistration message_handler_frame_sync{
Message::ID::DisplayFrameSync,
[this](const Message* const) {
this->on_timer();
}};
};
} /* namespace ui */
#endif /*__UI_AFSK_RX_H__*/
+247
View File
@@ -56,6 +56,22 @@ uint64_t copy_mac_address_to_uint64(const uint8_t* macAddress) {
return result;
}
void reverse_byte_array(uint8_t* arr, int length) {
int start = 0;
int end = length - 1;
while (start < end) {
// Swap elements at start and end
uint8_t temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
// Move the indices towards the center
start++;
end--;
}
}
namespace ui {
std::string pdu_type_to_string(ADV_PDU_TYPE type) {
@@ -146,6 +162,7 @@ BleRecentEntryDetailView::BleRecentEntryDetailView(NavigationView& nav, const Bl
entry_{entry} {
add_children({&button_done,
&button_send,
&button_save,
&label_mac_address,
&text_mac_address,
&label_pdu_type,
@@ -166,6 +183,47 @@ BleRecentEntryDetailView::BleRecentEntryDetailView(NavigationView& nav, const Bl
});
nav.pop();
};
button_save.on_select = [this, &nav](const ui::Button&) {
auto packetToSave = build_packet();
packetFileBuffer = "";
text_prompt(
nav,
packetFileBuffer,
64,
[this, packetToSave](std::string& buffer) {
on_save_file(buffer, packetToSave);
});
};
}
void BleRecentEntryDetailView::on_save_file(const std::string value, BLETxPacket packetToSave) {
std::filesystem::path packet_save_path{u"BLERX/Packets/????.TXT"};
ensure_directory(packet_save_path);
auto folder = packet_save_path.parent_path();
auto ext = packet_save_path.extension();
auto new_path = folder / value + ext;
saveFile(new_path, packetToSave);
}
bool BleRecentEntryDetailView::saveFile(const std::filesystem::path& path, BLETxPacket packetToSave) {
File f;
auto error = f.create(path);
if (error)
return false;
std::string macAddressStr = packetToSave.macAddress;
std::string advertisementDataStr = packetToSave.advertisementData;
std::string packetCountStr = packetToSave.packetCount;
std::string packetString = macAddressStr + ' ' + advertisementDataStr + ' ' + packetCountStr;
f.write(packetString.c_str(), packetString.length());
return true;
}
void BleRecentEntryDetailView::update_data() {
@@ -361,6 +419,8 @@ BLERxView::BLERxView(NavigationView& nav)
&label_sort,
&options_sort,
&button_filter,
&button_save_list,
&button_clear_list,
&button_switch,
&recent_entries_view});
@@ -378,6 +438,21 @@ BLERxView::BLERxView(NavigationView& nav)
});
};
button_save_list.on_select = [this, &nav](const ui::Button&) {
listFileBuffer = "";
text_prompt(
nav,
listFileBuffer,
64,
[this](std::string& buffer) {
on_save_file(buffer);
});
};
button_clear_list.on_select = [this](Button&) {
recent.clear();
};
button_switch.on_select = [&nav](Button&) {
nav.replace<BLETxView>();
};
@@ -402,6 +477,14 @@ BLERxView::BLERxView(NavigationView& nav)
};
options_channel.on_change = [this](size_t, int32_t i) {
// If we selected Auto don't do anything and Auto will handle changing.
if (i == 40) {
auto_channel = true;
return;
} else {
auto_channel = false;
}
field_frequency.set_value(get_freq_by_channel_number(i));
channel_number = i;
@@ -423,7 +506,167 @@ BLERxView::BLERxView(NavigationView& nav)
receiver_model.enable();
}
std::string BLERxView::build_line_str(BleRecentEntry entry) {
std::string macAddressStr = to_string_mac_address(entry.packetData.macAddress, 6, false) + ",";
std::string timestameStr = entry.timestamp + ",";
std::string nameStr = entry.nameString + ",";
std::string pduStr = pdu_type_to_string(entry.pduType) + ",";
std::string dataStr = "0x" + entry.dataString + ",";
std::string hitsStr = to_string_dec_int(entry.numHits) + ",";
std::string dbStr = to_string_dec_int(entry.dbValue) + ",";
std::string channelStr = to_string_dec_int(entry.channelNumber) + ",";
std::string lineStr = timestameStr + macAddressStr + nameStr + pduStr + dataStr + hitsStr + dbStr + channelStr;
lineStr += pad_string_with_spaces(maxLineLength - lineStr.length());
return lineStr;
}
void BLERxView::on_save_file(const std::string value) {
std::filesystem::path packet_save_path{u"BLERX/Lists/????.csv"};
ensure_directory(packet_save_path);
auto folder = packet_save_path.parent_path();
auto ext = packet_save_path.extension();
auto new_path = folder / value + ext;
saveFile(new_path);
}
bool BLERxView::saveFile(const std::filesystem::path& path) {
// Check to see if file was previously saved.
bool file_existed = file_exists(path);
// Attempt to open, if it can't be opened. Create new.
auto src = std::make_unique<File>();
auto error = src->open(path, false, true);
if (error) {
return false;
}
for (const auto& entry : recent) {
tempList.emplace_back(entry);
}
if (!file_existed) {
src->write_line(headerStr.c_str());
auto it = tempList.begin();
while (it != tempList.end()) {
BleRecentEntry entry = (BleRecentEntry)*it;
src->write_line(build_line_str(entry).c_str());
it++;
}
} else {
// Check file for macAddressStr before adding.
char currentLine[maxLineLength];
uint64_t startPos = headerStr.length();
uint64_t bytesRead = 0;
uint64_t bytePos = 0;
File::Size currentSize = src->size();
auto dst = std::make_unique<File>();
const std::filesystem::path tempFilePath = path + "~";
auto error = dst->open(tempFilePath, false, true);
if (error) {
return false;
}
dst->write_line(headerStr.c_str());
src->seek(startPos);
// Look for ones found and rewrite.
do {
memset(currentLine, 0, maxLineLength);
bytesRead = readUntil(*src, currentLine, currentSize, '\n');
if (!bytesRead) {
break;
}
bytePos += bytesRead;
std::string lineStr = "";
std::string macAddressStr = "";
BleRecentEntry foundEntry;
char* token;
token = strtok(currentLine, ",");
while (token != NULL) {
auto it = tempList.begin();
while (it != tempList.end()) {
BleRecentEntry& entry = reinterpret_cast<BleRecentEntry&>(*it);
macAddressStr = to_string_mac_address(entry.packetData.macAddress, 6, false);
if (strstr(token, macAddressStr.c_str()) != NULL) {
entry.entryFound = true;
foundEntry = entry;
break;
}
it++;
}
if (foundEntry.entryFound) {
break;
}
token = strtok(NULL, ",");
}
if (foundEntry.entryFound) {
dst->write_line(build_line_str(foundEntry).c_str());
}
} while (bytePos <= currentSize);
// Write the ones not found.
auto it = tempList.begin();
while (it != tempList.end()) {
BleRecentEntry entry = (BleRecentEntry)*it;
if (!entry.entryFound) {
dst->write_line(build_line_str(entry).c_str());
}
it++;
}
// Close files before renaming/deleting.
src.reset();
dst.reset();
// Delete original and overwrite with temp file.
delete_file(path);
rename_file(tempFilePath, path);
}
tempList.clear();
return true;
}
void BLERxView::on_data(BlePacketData* packet) {
if (auto_channel) {
int min = 37;
int max = 39;
int randomChannel = min + std::rand() % (max - min + 1);
field_frequency.set_value(get_freq_by_channel_number(randomChannel));
baseband::set_btlerx(randomChannel);
}
std::string str_console = "";
if (!logging) {
@@ -550,6 +793,7 @@ void BLERxView::updateEntry(const BlePacketData* packet, BleRecentEntry& entry,
entry.numHits++;
entry.pduType = pdu_type;
entry.channelNumber = channel_number;
// Parse Data Section into buffer to be interpretted later.
for (int i = 0; i < packet->dataLen; i++) {
@@ -583,6 +827,9 @@ void BLERxView::updateEntry(const BlePacketData* packet, BleRecentEntry& entry,
break;
}
}
} else if (pdu_type == ADV_DIRECT_IND || pdu_type == SCAN_REQ) {
ADV_PDU_PAYLOAD_TYPE_1_3* directed_mac_data = (ADV_PDU_PAYLOAD_TYPE_1_3*)entry.packetData.data;
reverse_byte_array(directed_mac_data->A1, 6);
}
}
+32 -5
View File
@@ -84,6 +84,8 @@ struct BleRecentEntry {
bool include_name;
uint16_t numHits;
ADV_PDU_TYPE pduType;
uint8_t channelNumber;
bool entryFound;
BleRecentEntry()
: BleRecentEntry{0} {
@@ -99,7 +101,9 @@ struct BleRecentEntry {
nameString{},
include_name{},
numHits{},
pduType{} {
pduType{},
channelNumber{},
entryFound{} {
}
Key key() const {
@@ -125,6 +129,9 @@ class BleRecentEntryDetailView : public View {
NavigationView& nav_;
BleRecentEntry entry_{};
BLETxPacket build_packet();
void on_save_file(const std::string value, BLETxPacket packetToSave);
bool saveFile(const std::filesystem::path& path, BLETxPacket packetToSave);
std::string packetFileBuffer{};
static constexpr uint8_t total_data_lines{5};
@@ -156,6 +163,10 @@ class BleRecentEntryDetailView : public View {
{125, 224, 96, 24},
"Done"};
Button button_save{
{72, 264, 96, 24},
"Save"};
bool send_updates{false};
Rect draw_field(
@@ -179,6 +190,9 @@ 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);
void on_filter_change(std::string value);
void handle_entries_sort(uint8_t index);
@@ -196,9 +210,13 @@ class BLERxView : public View {
uint8_t console_color{0};
uint32_t prev_value{0};
uint8_t channel_number = 37;
bool auto_channel = false;
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;
@@ -208,7 +226,8 @@ class BLERxView : public View {
5,
{{"Ch.37 ", 37},
{"Ch.38", 38},
{"Ch.39", 39}}};
{"Ch.39", 39},
{"Auto", 40}}};
RxFrequencyField field_frequency{
{6 * 8, 0 * 16},
@@ -260,9 +279,17 @@ class BLERxView : public View {
Console console{
{0, 4 * 16, 240, 240}};
Button button_clear_list{
{2 * 8, 320 - (16 + 32), 7 * 8, 32},
"Clear"};
Button button_save_list{
{11 * 8, 320 - (16 + 32), 11 * 8, 32},
"Export CSV"};
Button button_switch{
{8 * 8, 16 * 16, 14 * 8, 2 * 16},
"Switch to Tx"};
{240 - 6 * 8, 320 - (16 + 32), 4 * 8, 32},
"Tx"};
std::string str_log{""};
bool logging{false};
@@ -270,7 +297,7 @@ class BLERxView : public View {
std::unique_ptr<BLELogger> logger{};
BleRecentEntries recent{};
BleRecentEntries filterEntries{};
BleRecentEntries tempList{};
const RecentEntriesColumns columns{{
{"Mac Address", 17},
+48 -60
View File
@@ -94,44 +94,6 @@ uint32_t stringToUint32(const std::string& str) {
return result;
}
void readUntil(File& file, char* result, std::size_t maxBufferSize, char delimiter) {
std::size_t bytesRead = 0;
while (true) {
char ch;
File::Result<File::Size> readResult = file.read(&ch, 1);
if (readResult.is_ok() && readResult.value() > 0) {
if (ch == delimiter) {
// Found a space character, stop reading
break;
} else if (bytesRead < maxBufferSize) {
// Append the character to the result if there's space
result[bytesRead++] = ch;
} else {
// Buffer is full, break to prevent overflow
break;
}
} else {
break; // End of file or error
}
}
// Null-terminate the result string
result[bytesRead] = '\0';
}
void generateRandomMacAddress(char* macAddress) {
const char hexDigits[] = "0123456789ABCDEF";
// Generate 12 random hexadecimal characters
for (int i = 0; i < 12; i++) {
int randomIndex = rand() % 16;
macAddress[i] = hexDigits[randomIndex];
}
macAddress[12] = '\0'; // Null-terminate the string
}
static std::uint64_t get_freq_by_channel_number(uint8_t channel_number) {
uint64_t freq_hz;
@@ -205,11 +167,22 @@ void BLETxView::toggle() {
}
void BLETxView::start() {
int randomChannel = channel_number;
if (auto_channel) {
int min = 37;
int max = 39;
randomChannel = min + std::rand() % (max - min + 1);
field_frequency.set_value(get_freq_by_channel_number(randomChannel));
}
// Generate new random Mac Address.
generateRandomMacAddress(randomMac);
// If this is our first run, check file.
if (!is_active()) {
// Check if file is present before continuing.
File data_file;
auto error = data_file.open(file_path);
@@ -217,22 +190,19 @@ void BLETxView::start() {
file_error();
check_loop.set_value(false);
return;
} else {
// Send first or single packet.
progressbar.set_max(packets[0].packet_count);
button_play.set_bitmap(&bitmap_stop);
baseband::set_btletx(channel_number, random_mac ? randomMac : packets[0].macAddress, packets[0].advertisementData, pduType);
transmitter_model.enable();
is_running = true;
}
} else {
// Send next packet.
progressbar.set_max(packets[current_packet].packet_count);
baseband::set_btletx(channel_number, random_mac ? randomMac : packets[current_packet].macAddress, packets[current_packet].advertisementData, pduType);
transmitter_model.enable();
button_play.set_bitmap(&bitmap_stop);
is_running = true;
}
// Send next packet.
progressbar.set_max(packets[current_packet].packet_count);
baseband::set_btletx(randomChannel, random_mac ? randomMac : packets[current_packet].macAddress, packets[current_packet].advertisementData, pduType);
is_sending = true;
if ((packet_counter % 10) == 0) {
text_packets_sent.set(to_string_dec_uint(packet_counter));
}
@@ -252,9 +222,12 @@ void BLETxView::stop() {
is_running = false;
}
void BLETxView::on_tx_progress(const bool done) {
if (done) {
if (is_active()) {
// called each 1/60th of second, so 6 = 100ms
void BLETxView::on_timer() {
if (++mscounter == timer_period) {
mscounter = 0;
if (is_active() && !is_sending) {
// Reached end of current packet repeats.
if (packet_counter == 0) {
// Done sending all packets.
@@ -262,20 +235,26 @@ void BLETxView::on_tx_progress(const bool done) {
// If looping, restart from beginning.
if (check_loop.value()) {
update_current_packet(packets[current_packet], 0);
start();
} else {
stop();
}
} else {
current_packet++;
update_current_packet(packets[current_packet], current_packet);
}
} else {
if ((timer_count % timer_period) == 0) {
start();
}
} else {
start();
}
}
}
}
timer_count++;
void BLETxView::on_tx_progress(const bool done) {
if (done) {
if (is_active()) {
is_sending = false;
}
}
}
@@ -316,12 +295,21 @@ BLETxView::BLETxView(NavigationView& nav)
};
options_channel.on_change = [this](size_t, int32_t i) {
// If we selected Auto don't do anything and Auto will handle changing.
if (i == 40) {
auto_channel = true;
return;
} else {
auto_channel = false;
}
field_frequency.set_value(get_freq_by_channel_number(i));
channel_number = i;
};
options_speed.on_change = [this](size_t, int32_t i) {
timer_period = i;
mscounter = 0;
};
options_adv_type.on_change = [this](size_t, int32_t i) {
@@ -400,7 +388,7 @@ void BLETxView::on_file_changed(const fs::path& new_file_path) {
// Verify Data.
if ((macAddressSize == mac_address_size_str) && (advertisementDataSize < max_packet_size_str) && (packetCountSize < max_packet_repeat_str) &&
hasValidHexPairs(packets[num_packets].macAddress, macAddressSize / 2) && hasValidHexPairs(packets[num_packets].advertisementData, advertisementDataSize / 2) && (packets[num_packets].packet_count >= 50) && (packets[num_packets].packet_count < max_packet_repeat_count)) {
hasValidHexPairs(packets[num_packets].macAddress, macAddressSize / 2) && hasValidHexPairs(packets[num_packets].advertisementData, advertisementDataSize / 2) && (packets[num_packets].packet_count >= 1) && (packets[num_packets].packet_count < max_packet_repeat_count)) {
text_filename.set(truncate(file_path.filename().string(), 12));
} else {
+58 -46
View File
@@ -55,11 +55,42 @@ class BLELoggerTx {
namespace ui {
enum PKT_TYPE {
PKT_TYPE_INVALID_TYPE,
PKT_TYPE_RAW,
PKT_TYPE_DISCOVERY,
PKT_TYPE_IBEACON,
PKT_TYPE_ADV_IND,
PKT_TYPE_ADV_DIRECT_IND,
PKT_TYPE_ADV_NONCONN_IND,
PKT_TYPE_ADV_SCAN_IND,
PKT_TYPE_SCAN_REQ,
PKT_TYPE_SCAN_RSP,
PKT_TYPE_CONNECT_REQ,
PKT_TYPE_LL_DATA,
PKT_TYPE_LL_CONNECTION_UPDATE_REQ,
PKT_TYPE_LL_CHANNEL_MAP_REQ,
PKT_TYPE_LL_TERMINATE_IND,
PKT_TYPE_LL_ENC_REQ,
PKT_TYPE_LL_ENC_RSP,
PKT_TYPE_LL_START_ENC_REQ,
PKT_TYPE_LL_START_ENC_RSP,
PKT_TYPE_LL_UNKNOWN_RSP,
PKT_TYPE_LL_FEATURE_REQ,
PKT_TYPE_LL_FEATURE_RSP,
PKT_TYPE_LL_PAUSE_ENC_REQ,
PKT_TYPE_LL_PAUSE_ENC_RSP,
PKT_TYPE_LL_VERSION_IND,
PKT_TYPE_LL_REJECT_IND,
PKT_TYPE_NUM_PKT_TYPE
};
struct BLETxPacket {
char macAddress[13];
char advertisementData[63];
char packetCount[11];
uint32_t packet_count;
PKT_TYPE packetType;
};
class BLETxView : public View {
@@ -84,6 +115,7 @@ class BLETxView : public View {
std::string title() const override { return "BLE TX"; };
private:
void on_timer();
void on_data(uint32_t value, bool is_data);
void on_file_changed(const std::filesystem::path& new_file_path);
void on_save_file(const std::string value);
@@ -105,12 +137,14 @@ class BLETxView : public View {
std::filesystem::path file_path{};
std::filesystem::path packet_save_path{u"BLETX/BLETX_????.TXT"};
uint8_t channel_number = 37;
bool auto_channel = false;
char randomMac[13] = "010203040506";
bool is_running = false;
bool is_sending = false;
uint64_t timer_count{0};
uint64_t timer_period{256};
int16_t timer_period{1};
bool repeatLoop = false;
uint32_t packet_counter{0};
uint32_t num_packets{0};
@@ -118,45 +152,16 @@ class BLETxView : public View {
bool random_mac = false;
bool file_override = false;
enum PKT_TYPE {
INVALID_TYPE,
RAW,
DISCOVERY,
IBEACON,
ADV_IND,
ADV_DIRECT_IND,
ADV_NONCONN_IND,
ADV_SCAN_IND,
SCAN_REQ,
SCAN_RSP,
CONNECT_REQ,
LL_DATA,
LL_CONNECTION_UPDATE_REQ,
LL_CHANNEL_MAP_REQ,
LL_TERMINATE_IND,
LL_ENC_REQ,
LL_ENC_RSP,
LL_START_ENC_REQ,
LL_START_ENC_RSP,
LL_UNKNOWN_RSP,
LL_FEATURE_REQ,
LL_FEATURE_RSP,
LL_PAUSE_ENC_REQ,
LL_PAUSE_ENC_RSP,
LL_VERSION_IND,
LL_REJECT_IND,
NUM_PKT_TYPE
};
static constexpr uint8_t mac_address_size_str{12};
static constexpr uint8_t max_packet_size_str{62};
static constexpr uint8_t max_packet_repeat_str{10};
static constexpr uint32_t max_packet_repeat_count{UINT32_MAX};
static constexpr uint32_t max_num_packets{32};
int16_t mscounter = 0;
BLETxPacket packets[max_num_packets];
PKT_TYPE pduType = {DISCOVERY};
PKT_TYPE pduType = {PKT_TYPE_DISCOVERY};
static constexpr auto header_height = 9 * 16;
static constexpr auto switch_button_height = 3 * 16;
@@ -204,30 +209,31 @@ class BLETxView : public View {
OptionsField options_speed{
{7 * 8, 6 * 8},
3,
{{"1 ", 256},
{"2 ", 128},
{"3 ", 64},
{"4 ", 32},
{"5 ", 16}}};
{{"1 ", 1}, // 16ms
{"2 ", 2}, // 32ms
{"3 ", 3}, // 48ms
{"4 ", 6}, // 100ms
{"5 ", 12}}}; // 200ms
OptionsField options_channel{
{11 * 8, 6 * 8},
5,
{{"Ch.37 ", 37},
{"Ch.38", 38},
{"Ch.39", 39}}};
{"Ch.39", 39},
{"Auto", 40}}};
OptionsField options_adv_type{
{17 * 8, 6 * 8},
14,
{{"DISCOVERY ", DISCOVERY},
{"ADV_IND", ADV_IND},
{"ADV_DIRECT", ADV_DIRECT_IND},
{"ADV_NONCONN", ADV_NONCONN_IND},
{"ADV_SCAN_IND", ADV_SCAN_IND},
{"SCAN_REQ", SCAN_REQ},
{"SCAN_RSP", SCAN_RSP},
{"CONNECT_REQ", CONNECT_REQ}}};
{{"DISCOVERY ", PKT_TYPE_DISCOVERY},
{"ADV_IND", PKT_TYPE_ADV_IND},
{"ADV_DIRECT", PKT_TYPE_ADV_DIRECT_IND},
{"ADV_NONCONN", PKT_TYPE_ADV_NONCONN_IND},
{"ADV_SCAN_IND", PKT_TYPE_ADV_SCAN_IND},
{"SCAN_REQ", PKT_TYPE_SCAN_REQ},
{"SCAN_RSP", PKT_TYPE_SCAN_RSP},
{"CONNECT_REQ", PKT_TYPE_CONNECT_REQ}}};
Labels label_packet_index{
{{0 * 8, 10 * 8}, "Packet Index:", Color::light_grey()}};
@@ -284,6 +290,12 @@ class BLETxView : public View {
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
this->on_tx_progress(message.done);
}};
MessageHandlerRegistration message_handler_frame_sync{
Message::ID::DisplayFrameSync,
[this](const Message* const) {
this->on_timer();
}};
};
} /* namespace ui */
+6 -11
View File
@@ -34,9 +34,6 @@ namespace tpms {
namespace format {
static bool use_kpa = true;
static bool use_celsius = true;
std::string type(Reading::Type type) {
return to_string_dec_uint(toUType(type), 2);
}
@@ -46,11 +43,11 @@ std::string id(TransponderID id) {
}
std::string pressure(Pressure pressure) {
return to_string_dec_int(use_kpa ? pressure.kilopascal() : pressure.psi(), 3);
return to_string_dec_int(units_psi ? pressure.psi() : pressure.kilopascal(), 3);
}
std::string temperature(Temperature temperature) {
return to_string_dec_int(use_celsius ? temperature.celsius() : temperature.fahrenheit(), 3);
return to_string_dec_int(units_fahr ? temperature.fahrenheit() : temperature.celsius(), 3);
}
std::string flags(Flags flags) {
@@ -165,18 +162,16 @@ TPMSAppView::TPMSAppView(NavigationView&) {
options_band.set_by_value(receiver_model.target_frequency());
options_pressure.on_change = [this](size_t, int32_t i) {
tpms::format::use_kpa = !i;
tpms::format::units_psi = (bool)i;
update_view();
};
options_pressure.set_selected_index(0, true);
options_pressure.set_selected_index(tpms::format::units_psi, true);
options_temperature.on_change = [this](size_t, int32_t i) {
tpms::format::use_celsius = !i;
tpms::format::units_fahr = (bool)i;
update_view();
};
options_temperature.set_selected_index(0, true);
options_temperature.set_selected_index(tpms::format::units_fahr, true);
logger = std::make_unique<TPMSLogger>();
if (logger) {
+21 -3
View File
@@ -37,6 +37,17 @@
#include "tpms_packet.hpp"
namespace tpms {
namespace format {
static bool units_psi{false};
static bool units_fahr{false};
} /* namespace format */
} /* namespace tpms */
namespace std {
} /* namespace std */
@@ -103,11 +114,17 @@ class TPMSAppView : public View {
private:
RxRadioState radio_state_{
315000000 /* frequency*/,
314950000 /* frequency*/,
1750000 /* bandwidth */,
2457600 /* sampling rate */};
app_settings::SettingsManager settings_{
"rx_tpms", app_settings::Mode::RX};
"rx_tpms",
app_settings::Mode::RX,
{
{"units_psi"sv, &tpms::format::units_psi},
{"units_fahr"sv, &tpms::format::units_fahr},
}};
MessageHandlerRegistration message_handler_packet{
Message::ID::TPMSPacket,
@@ -129,11 +146,12 @@ class TPMSAppView : public View {
{21 * 8, 5, 6 * 8, 4},
};
// "315 MHz" TPMS sensors transmit at either 314.9 or 315 MHz but we should pick up either
OptionsField options_band{
{0 * 8, 0 * 16},
3,
{
{"315", 315000000},
{"315", 314950000},
{"434", 433920000},
}};
+112 -50
View File
@@ -159,11 +159,8 @@ void TemperatureView::focus() {
/* RegistersWidget *******************************************************/
RegistersWidget::RegistersWidget(
RegistersWidgetConfig&& config,
std::function<uint32_t(const size_t register_number)>&& reader)
: Widget{},
config(std::move(config)),
reader(std::move(reader)) {
RegistersWidgetConfig&& config)
: Widget{}, config(std::move(config)), page_number(0) {
}
void RegistersWidget::update() {
@@ -180,7 +177,7 @@ void RegistersWidget::paint(Painter& painter) {
void RegistersWidget::draw_legend(const Coord left, Painter& painter) {
const auto pos = screen_pos();
for (size_t i = 0; i < config.registers_count; i += config.registers_per_row()) {
for (uint32_t i = 0; i < config.registers_count; i += config.registers_per_row()) {
const Point offset{
left, static_cast<int>((i / config.registers_per_row()) * row_height)};
@@ -197,12 +194,12 @@ void RegistersWidget::draw_values(
Painter& painter) {
const auto pos = screen_pos();
for (size_t i = 0; i < config.registers_count; i++) {
for (uint32_t i = 0; i < config.registers_count; i++) {
const Point offset = {
static_cast<int>(left + config.legend_width() + 8 + (i % config.registers_per_row()) * (config.value_width() + 8)),
static_cast<int>((i / config.registers_per_row()) * row_height)};
const auto value = reader(i);
const auto value = reg_read(i);
const auto text = to_string_hex(value, config.value_length());
painter.draw_string(
@@ -212,19 +209,61 @@ void RegistersWidget::draw_values(
}
}
uint32_t RegistersWidget::reg_read(const uint32_t register_number) {
if (register_number < config.registers_count) {
switch (config.chip_type) {
case CT_PMEM:
return portapack::persistent_memory::pmem_data_word((page_number * config.registers_count + register_number) / 4) >> (register_number % 4 * 8);
case CT_RFFC5072:
return radio::debug::first_if::register_read(register_number);
case CT_MAX283X:
return radio::debug::second_if::register_read(register_number);
case CT_SI5351:
return portapack::clock_generator.read_register(register_number);
case CT_AUDIO:
return audio::debug::reg_read(register_number);
}
}
return 0xFFFF;
}
void RegistersWidget::reg_write(const uint32_t register_number, const uint32_t value) {
if (register_number < config.registers_count) {
switch (config.chip_type) {
case CT_PMEM:
break;
case CT_RFFC5072:
radio::debug::first_if::register_write(register_number, value);
break;
case CT_MAX283X:
radio::debug::second_if::register_write(register_number, value);
break;
case CT_SI5351:
portapack::clock_generator.write_register(register_number, value);
break;
case CT_AUDIO:
audio::debug::reg_write(register_number, value);
break;
}
}
}
/* RegistersView *********************************************************/
RegistersView::RegistersView(
NavigationView& nav,
const std::string& title,
RegistersWidgetConfig&& config,
std::function<uint32_t(const size_t register_number)>&& reader)
: registers_widget{std::move(config), std::move(reader)} {
RegistersWidgetConfig&& config)
: registers_widget{std::move(config)} {
add_children({
&text_title,
&registers_widget,
&button_update,
&button_done,
&labels,
&field_write_reg_num,
&field_write_data_val,
&button_write,
});
button_update.on_select = [this](Button&) {
@@ -237,6 +276,20 @@ RegistersView::RegistersView(
text_title.set_parent_rect({(240 - static_cast<int>(title.size()) * 8) / 2, 16,
static_cast<int>(title.size()) * 8, 16});
text_title.set(title);
field_write_reg_num.on_change = [this](SymField&) {
field_write_data_val.set_value(this->registers_widget.reg_read(field_write_reg_num.to_integer()));
field_write_data_val.set_dirty();
};
const auto value = registers_widget.reg_read(0);
field_write_data_val.set_value(value);
button_write.set_style(&Styles::red);
button_write.on_select = [this](Button&) {
this->registers_widget.reg_write(field_write_reg_num.to_integer(), field_write_data_val.to_integer());
this->registers_widget.update();
};
}
void RegistersView::focus() {
@@ -376,18 +429,10 @@ DebugPeripheralsMenuView::DebugPeripheralsMenuView(NavigationView& nav) {
const char* max283x = hackrf_r9 ? "MAX2839" : "MAX2837";
const char* si5351x = hackrf_r9 ? "Si5351A" : "Si5351C";
add_items({
{"RFFC5072", ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav]() { nav.push<RegistersView>(
"RFFC5072", RegistersWidgetConfig{31, 16},
[](const size_t register_number) { return radio::debug::first_if::register_read(register_number); }); }},
{max283x, ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav, max283x]() { nav.push<RegistersView>(
max283x, RegistersWidgetConfig{32, 10},
[](const size_t register_number) { return radio::debug::second_if::register_read(register_number); }); }},
{si5351x, ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav, si5351x]() { nav.push<RegistersView>(
si5351x, RegistersWidgetConfig{96, 8},
[](const size_t register_number) { return portapack::clock_generator.read_register(register_number); }); }},
{audio::debug::codec_name(), ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav]() { nav.push<RegistersView>(
audio::debug::codec_name(), RegistersWidgetConfig{audio::debug::reg_count(), audio::debug::reg_bits()},
[](const size_t register_number) { return audio::debug::reg_read(register_number); }); }},
{"RFFC5072", ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav]() { nav.push<RegistersView>("RFFC5072", RegistersWidgetConfig{CT_RFFC5072, 31, 16}); }},
{max283x, ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav, max283x]() { nav.push<RegistersView>(max283x, RegistersWidgetConfig{CT_MAX283X, 32, 10}); }},
{si5351x, ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav, si5351x]() { nav.push<RegistersView>(si5351x, RegistersWidgetConfig{CT_SI5351, 96, 8}); }},
{audio::debug::codec_name(), ui::Color::dark_cyan(), &bitmap_icon_peripherals_details, [&nav]() { nav.push<RegistersView>(audio::debug::codec_name(), RegistersWidgetConfig{CT_AUDIO, audio::debug::reg_count(), audio::debug::reg_bits()}); }},
});
set_max_rows(2); // allow wider buttons
}
@@ -402,9 +447,10 @@ DebugMenuView::DebugMenuView(NavigationView& nav) {
{"Buttons Test", ui::Color::dark_cyan(), &bitmap_icon_controls, [&nav]() { nav.push<DebugControlsView>(); }},
{"Debug Dump", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { portapack::persistent_memory::debug_dump(); }},
{"M0 Stack Dump", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { stack_dump(); }},
{"Memory", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push<DebugMemoryView>(); }},
{"P.Memory", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push<DebugPmemView>(); }},
{"Memory Dump", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push<DebugMemoryDumpView>(); }},
{"Memory Usage", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push<DebugMemoryView>(); }},
{"Peripherals", ui::Color::dark_cyan(), &bitmap_icon_peripherals, [&nav]() { nav.push<DebugPeripheralsMenuView>(); }},
{"Pers. Memory", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push<DebugPmemView>(); }},
//{ "Radio State", ui::Color::white(), nullptr, [&nav](){ nav.push<NotImplementedView>(); } },
{"SD Card", ui::Color::dark_cyan(), &bitmap_icon_sdcard, [&nav]() { nav.push<SDCardDebugView>(); }},
{"Temperature", ui::Color::dark_cyan(), &bitmap_icon_temperature, [&nav]() { nav.push<TemperatureView>(); }},
@@ -418,30 +464,53 @@ DebugMenuView::DebugMenuView(NavigationView& nav) {
set_max_rows(2); // allow wider buttons
}
/* DebugPmemView *********************************************************/
/* DebugMemoryDumpView *********************************************************/
uint32_t pmem_checksum(volatile const uint32_t data[63]) {
CRC<32> crc{0x04c11db7, 0xffffffff, 0xffffffff};
for (size_t i = 0; i < 63; i++) {
const auto word = data[i];
crc.process_byte((word >> 0) & 0xff);
crc.process_byte((word >> 8) & 0xff);
crc.process_byte((word >> 16) & 0xff);
crc.process_byte((word >> 24) & 0xff);
}
return crc.checksum();
DebugMemoryDumpView::DebugMemoryDumpView(NavigationView& nav) {
add_children({
&button_dump,
&button_read,
&button_write,
&button_done,
&labels,
&field_starting_address,
&field_byte_count,
&field_rw_address,
&field_data_value,
});
button_done.on_select = [&nav](Button&) { nav.pop(); };
button_dump.on_select = [this](Button&) {
if (field_byte_count.to_integer() != 0)
memory_dump((uint32_t*)field_starting_address.to_integer(), ((uint32_t)field_byte_count.to_integer() + 3) / 4, false);
};
button_read.on_select = [this](Button&) {
field_data_value.set_value(*(uint32_t*)field_rw_address.to_integer());
field_data_value.set_dirty();
};
button_write.set_style(&Styles::red);
button_write.on_select = [this](Button&) {
*(uint32_t*)field_rw_address.to_integer() = (uint32_t)field_data_value.to_integer();
};
}
DebugPmemView::DebugPmemView(NavigationView& nav)
: data{*reinterpret_cast<pmem_data*>(memory::map::backup_ram.base())}, registers_widget(RegistersWidgetConfig{page_size, 8}, std::bind(&DebugPmemView::registers_widget_feed, this, std::placeholders::_1)) {
static_assert(sizeof(pmem_data) == memory::map::backup_ram.size());
void DebugMemoryDumpView::focus() {
button_done.focus();
}
/* DebugPmemView *********************************************************/
DebugPmemView::DebugPmemView(NavigationView& nav)
: registers_widget(RegistersWidgetConfig{CT_PMEM, page_size, 8}) {
add_children({&text_page, &registers_widget, &text_checksum, &text_checksum2, &button_ok});
registers_widget.set_parent_rect({0, 32, 240, 192});
text_checksum.set("Size: " + to_string_dec_uint(portapack::persistent_memory::data_size(), 3) + " CRC: " + to_string_hex(data.check_value, 8));
text_checksum2.set("Calculated CRC: " + to_string_hex(pmem_checksum(data.regfile), 8));
text_checksum.set("Size: " + to_string_dec_uint(portapack::persistent_memory::data_size(), 3) + " CRC: " + to_string_hex(portapack::persistent_memory::pmem_stored_checksum(), 8));
text_checksum2.set("Calculated CRC: " + to_string_hex(portapack::persistent_memory::pmem_calculated_checksum(), 8));
button_ok.on_select = [&nav](Button&) {
nav.pop();
@@ -451,7 +520,7 @@ DebugPmemView::DebugPmemView(NavigationView& nav)
}
bool DebugPmemView::on_encoder(const EncoderEvent delta) {
page = std::max(0l, std::min((int32_t)page_max, page + delta));
registers_widget.set_page(std::max(0ul, std::min((uint32_t)page_count - 1, registers_widget.page() + delta)));
update();
@@ -463,17 +532,10 @@ void DebugPmemView::focus() {
}
void DebugPmemView::update() {
text_page.set(to_string_hex(page_size * page, 2) + "+");
text_page.set(to_string_hex(registers_widget.page() * page_size, 2) + "+");
registers_widget.update();
}
uint32_t DebugPmemView::registers_widget_feed(const size_t register_number) {
if (page_size * page + register_number >= memory::map::backup_ram.size()) {
return 0xff;
}
return data.regfile[(page_size * page + register_number) / 4] >> (register_number % 4 * 8);
}
/* DebugScreenTest ****************************************************/
DebugScreenTest::DebugScreenTest(NavigationView& nav)
+95 -26
View File
@@ -48,8 +48,8 @@ class DebugMemoryView : public View {
private:
Text text_title{
{96, 96, 48, 16},
"Memory",
{72, 96, 96, 16},
"Memory Usage",
};
Text text_label_m0_core_free{
@@ -131,9 +131,18 @@ class TemperatureView : public View {
"Done"};
};
typedef enum {
CT_PMEM,
CT_RFFC5072,
CT_MAX283X,
CT_SI5351,
CT_AUDIO,
} chip_type_t;
struct RegistersWidgetConfig {
size_t registers_count;
size_t register_bits;
chip_type_t chip_type;
uint32_t registers_count;
uint32_t register_bits;
constexpr size_t legend_length() const {
return (registers_count >= 0x10) ? 2 : 1;
@@ -174,17 +183,21 @@ struct RegistersWidgetConfig {
class RegistersWidget : public Widget {
public:
RegistersWidget(
RegistersWidgetConfig&& config,
std::function<uint32_t(const size_t register_number)>&& reader);
RegistersWidget(RegistersWidgetConfig&& config);
void update();
void paint(Painter& painter) override;
uint32_t reg_read(const uint32_t register_number);
void reg_write(const uint32_t register_number, const uint32_t value);
void set_page(int32_t value) { page_number = value; }
uint32_t page(void) { return page_number; }
private:
const RegistersWidgetConfig config;
const std::function<uint32_t(const size_t register_number)> reader;
uint32_t page_number;
static constexpr size_t row_height = 16;
@@ -194,11 +207,7 @@ class RegistersWidget : public Widget {
class RegistersView : public View {
public:
RegistersView(
NavigationView& nav,
const std::string& title,
RegistersWidgetConfig&& config,
std::function<uint32_t(const size_t register_number)>&& reader);
RegistersView(NavigationView& nav, const std::string& title, RegistersWidgetConfig&& config);
void focus();
@@ -208,12 +217,30 @@ class RegistersView : public View {
RegistersWidget registers_widget;
Button button_update{
{16, 256, 96, 24},
{16, 280, 96, 24},
"Update"};
Button button_done{
{128, 256, 96, 24},
{128, 280, 96, 24},
"Done"};
Button button_write{
{144, 248, 80, 20},
"Write"};
Labels labels{
{{1 * 8, 248}, "Reg:", Color::light_grey()},
{{8 * 8, 248}, "Data:", Color::light_grey()}};
SymField field_write_reg_num{
{5 * 8, 248},
2,
SymField::Type::Hex};
SymField field_write_data_val{
{13 * 8, 248},
4,
SymField::Type::Hex};
};
class ControlsSwitchesWidget : public Widget {
@@ -274,6 +301,58 @@ class DebugControlsView : public View {
"Done"};
};
class DebugMemoryDumpView : public View {
public:
DebugMemoryDumpView(NavigationView& nav);
void focus() override;
std::string title() const override { return "Memory Dump"; };
private:
Button button_dump{
{72, 4 * 16, 96, 24},
"Dump"};
Button button_read{
{16, 11 * 16, 96, 24},
"Read"};
Button button_write{
{128, 11 * 16, 96, 24},
"Write"};
Button button_done{
{128, 240, 96, 24},
"Done"};
Labels labels{
{{5 * 8, 1 * 16}, "Dump Range to File", Color::yellow()},
{{0 * 8, 2 * 16}, "Starting Address: 0x", Color::light_grey()},
{{0 * 8, 3 * 16}, "Byte Count: 0x", Color::light_grey()},
{{3 * 8, 8 * 16}, "Read/Write Single Word", Color::yellow()},
{{0 * 8, 9 * 16}, "Memory Address: 0x", Color::light_grey()},
{{0 * 8, 10 * 16}, "Data Value: 0x", Color::light_grey()}};
SymField field_starting_address{
{20 * 8, 2 * 16},
8,
SymField::Type::Hex};
SymField field_byte_count{
{20 * 8, 3 * 16},
8,
SymField::Type::Hex};
SymField field_rw_address{
{20 * 8, 9 * 16},
8,
SymField::Type::Hex};
SymField field_data_value{
{20 * 8, 10 * 16},
8,
SymField::Type::Hex};
};
class DebugPmemView : public View {
public:
DebugPmemView(NavigationView& nav);
@@ -282,17 +361,8 @@ class DebugPmemView : public View {
std::string title() const override { return "P.Mem Debug"; }
private:
struct pmem_data {
uint32_t regfile[63];
uint32_t check_value;
};
static constexpr uint8_t page_size{96}; // Must be multiply of 4 otherwise bit shifting for register view wont work properly
static constexpr uint8_t page_max{(portapack::memory::map::backup_ram.size() + page_size - 1) / page_size - 1};
int32_t page{0};
volatile const pmem_data& data;
static constexpr uint8_t page_count{(portapack::memory::map::backup_ram.size() + page_size - 1) / page_size};
Text text_page{{16, 16, 208, 16}};
@@ -307,7 +377,6 @@ class DebugPmemView : public View {
};
void update();
uint32_t registers_widget_feed(const size_t register_number);
};
class DebugScreenTest : public View {
+33
View File
@@ -343,6 +343,38 @@ void SetUIView::focus() {
button_save.focus();
}
/* SetSDCardView *********************************************/
SetSDCardView::SetSDCardView(NavigationView& nav) {
add_children({&labels,
&checkbox_sdcard_speed,
&button_test_sdcard_high_speed,
&text_sdcard_test_status,
&button_save,
&button_cancel});
checkbox_sdcard_speed.set_value(pmem::config_sdcard_high_speed_io());
button_test_sdcard_high_speed.on_select = [&nav, this](Button&) {
pmem::set_config_sdcard_high_speed_io(true, false);
text_sdcard_test_status.set("!! HIGH SPEED MODE ON !!");
};
button_save.on_select = [&nav, this](Button&) {
pmem::set_config_sdcard_high_speed_io(checkbox_sdcard_speed.value(), true);
send_system_refresh();
nav.pop();
};
button_cancel.on_select = [&nav, this](Button&) {
nav.pop();
};
}
void SetSDCardView::focus() {
button_save.focus();
}
/* SetConverterSettingsView ******************************/
SetConverterSettingsView::SetConverterSettingsView(NavigationView& nav) {
@@ -636,6 +668,7 @@ SettingsMenuView::SettingsMenuView(NavigationView& nav) {
{"QR Code", ui::Color::dark_cyan(), &bitmap_icon_qr_code, [&nav]() { nav.push<SetQRCodeView>(); }},
{"Radio", ui::Color::dark_cyan(), &bitmap_icon_options_radio, [&nav]() { nav.push<SetRadioView>(); }},
{"User Interface", ui::Color::dark_cyan(), &bitmap_icon_options_ui, [&nav]() { nav.push<SetUIView>(); }},
{"SD Card", ui::Color::dark_cyan(), &bitmap_icon_sdcard, [&nav]() { nav.push<SetSDCardView>(); }},
});
set_max_rows(2); // allow wider buttons
}
+37 -2
View File
@@ -306,8 +306,43 @@ class SetUIView : public View {
Button button_cancel{
{16 * 8, 16 * 16, 12 * 8, 32},
"Cancel",
};
"Cancel"};
};
class SetSDCardView : public View {
public:
SetSDCardView(NavigationView& nav);
void focus() override;
std::string title() const override { return "SD Card"; };
private:
Labels labels{
// 01234567890123456789012345678
{{1 * 8, 120 - 48}, " HIGH SPEED SDCARD IO ", Color::light_grey()},
{{1 * 8, 120 - 32}, " May or may not work !! ", Color::light_grey()}};
Checkbox checkbox_sdcard_speed{
{2 * 8, 120},
20,
"enable high speed IO"};
Button button_test_sdcard_high_speed{
{2 * 8, 152, 27 * 8, 32},
"TEST BUTTON (NO PMEM SAVE)"};
Text text_sdcard_test_status{
{2 * 8, 198, 28 * 8, 16},
""};
Button button_save{
{2 * 8, 16 * 16, 12 * 8, 32},
"Save"};
Button button_cancel{
{16 * 8, 16 * 16, 12 * 8, 32},
"Cancel"};
};
class SetConverterSettingsView : public View {
+4
View File
@@ -240,6 +240,10 @@ uint32_t reg_read(const size_t register_number) {
return audio_codec->reg_read(register_number);
}
void reg_write(const size_t register_number, uint32_t value) {
audio_codec->reg_write(register_number, value);
}
std::string codec_name() {
return audio_codec->name();
}
+2
View File
@@ -59,6 +59,7 @@ class Codec {
virtual size_t reg_count() const = 0;
virtual size_t reg_bits() const = 0;
virtual uint32_t reg_read(const size_t register_number) = 0;
virtual void reg_write(const size_t register_number, const uint32_t value) = 0;
};
namespace output {
@@ -107,6 +108,7 @@ namespace debug {
size_t reg_count();
uint32_t reg_read(const size_t register_number);
void reg_write(const size_t register_number, uint32_t value);
std::string codec_name();
size_t reg_bits();
+18 -13
View File
@@ -258,38 +258,43 @@ void draw_stack_dump() {
}
}
// Disk I/O in this function doesn't work after a fault
// Using the stack while dumping the stack isn't ideal, but hopefully anything imporant is still on the call stack.
bool stack_dump() {
uint32_t num_words = &__process_stack_end__ - &__process_stack_base__;
return memory_dump(&__process_stack_base__, num_words, true);
}
bool memory_dump(uint32_t* addr_start, uint32_t num_words, bool stack_flag) {
Painter painter;
std::string debug_dir = "DEBUG";
std::filesystem::path filename{};
File stack_dump_file{};
File dump_file{};
bool error;
std::string str;
uint32_t* addr_end;
uint32_t* p;
int n{0};
bool data_found{false};
make_new_directory(debug_dir);
filename = next_filename_matching_pattern(debug_dir + "/STACK_DUMP_????.TXT");
filename = next_filename_matching_pattern(debug_dir + "/" + (stack_flag ? "STACK" : "MEMORY") + "_DUMP_????.TXT");
error = filename.empty();
if (!error)
error = stack_dump_file.create(filename) != 0;
error = dump_file.create(filename) != 0;
if (error) {
painter.draw_string({16, 320 - 32}, ui::Styles::red, "ERROR DUMPING " + filename.filename().string() + "!");
return false;
}
for (p = &__process_stack_base__; p < &__process_stack_end__; p++) {
addr_end = addr_start + num_words;
for (p = addr_start; p < addr_end; p++) {
// skip past unused stack words
if (!data_found) {
if (stack_flag && !data_found) {
if (*p == CRT0_STACKS_FILL_PATTERN)
continue;
else {
data_found = true;
auto stack_space_left = p - &__process_stack_base__;
stack_dump_file.write_line(to_string_hex((uint32_t)&__process_stack_base__, 8) + ": Unused words " + to_string_dec_uint(stack_space_left));
auto stack_space_left = p - addr_start;
dump_file.write_line(to_string_hex((uint32_t)addr_start, 8) + ": Unused words " + to_string_dec_uint(stack_space_left));
// align subsequent lines to start on 16-byte boundaries
p -= (stack_space_left & 3);
@@ -299,20 +304,20 @@ bool stack_dump() {
// write address
if (n++ == 0) {
str = to_string_hex((uint32_t)p, 8) + ":";
stack_dump_file.write(str.data(), 9);
dump_file.write(str.data(), 9);
}
// write stack dword
str = " " + to_string_hex(*p, 8);
stack_dump_file.write(str.data(), 9);
dump_file.write(str.data(), 9);
if (n == 4) {
stack_dump_file.write("\r\n", 2);
dump_file.write("\r\n", 2);
n = 0;
}
}
painter.draw_string({16, 320 - 32}, ui::Styles::green, filename.filename().string() + " dumped!");
painter.draw_string({0, 320 - 16}, ui::Styles::green, filename.filename().string() + " dumped!");
return true;
}
+1
View File
@@ -48,5 +48,6 @@ inline uint32_t get_free_stack_space() {
}
bool stack_dump();
bool memory_dump(uint32_t* addr_start, uint32_t num_words, bool stack_flag);
#endif /*__DEBUG_H__*/
+1 -1
View File
@@ -342,7 +342,7 @@ int8_t MAX2837::temp_sense() {
_map.r.rx_top.ts_adc_trigger = 0;
flush_one(Register::RX_TOP);
return value * 4.31 - 6; // reg value is 0 to 31; possible return range is -6 C to 127 C
return std::min(127, (int)(value * 4.31 - 40)); // reg value is 0 to 31; possible return range is -40 C to 127 C
}
} // namespace max2837
+1 -2
View File
@@ -836,6 +836,7 @@ class MAX2837 : public MAX283x {
int8_t temp_sense() override;
reg_t read(const address_t reg_num) override;
void write(const address_t reg_num, const reg_t value) override;
private:
spi::arbiter::Target& _target;
@@ -845,8 +846,6 @@ class MAX2837 : public MAX283x {
void flush_one(const Register reg);
void write(const address_t reg_num, const reg_t value);
void write(const Register reg, const reg_t value);
reg_t read(const Register reg);
+1 -1
View File
@@ -372,7 +372,7 @@ int8_t MAX2839::temp_sense() {
_map.r.rx_top_2.ts_adc_trigger = 0;
flush_one(Register::RX_TOP_2);
return value * 4.31 - 75; // reg value is 0 to 31; possible return range is -75 C to 58 C
return std::min(127, (int)(value * 4.31 - 40)); // reg value is 0 to 31; possible return range is -40 C to 127 C
}
} // namespace max2839
+1 -2
View File
@@ -695,6 +695,7 @@ class MAX2839 : public MAX283x {
int8_t temp_sense() override;
reg_t read(const address_t reg_num) override;
void write(const address_t reg_num, const reg_t value) override;
private:
spi::arbiter::Target& _target;
@@ -704,8 +705,6 @@ class MAX2839 : public MAX283x {
void flush_one(const Register reg);
void write(const address_t reg_num, const reg_t value);
void write(const Register reg, const reg_t value);
reg_t read(const Register reg);
+1
View File
@@ -134,6 +134,7 @@ class MAX283x {
virtual int8_t temp_sense();
virtual reg_t read(const address_t reg_num);
virtual void write(const address_t reg_num, const reg_t value);
};
} // namespace max283x
+1 -2
View File
@@ -841,6 +841,7 @@ class RFFC507x {
void set_gpo1(const bool new_value);
reg_t read(const address_t reg_num);
void write(const address_t reg_num, const reg_t value);
private:
spi::SPI _bus{};
@@ -848,8 +849,6 @@ class RFFC507x {
RegisterMap _map{default_hackrf_one};
DirtyRegisters<Register, reg_count> _dirty{};
void write(const address_t reg_num, const reg_t value);
void write(const Register reg, const reg_t value);
reg_t read(const Register reg);
+9 -1
View File
@@ -61,7 +61,7 @@ static constexpr SPIConfig ssp_config_max283x = {
.ssport = gpio_max283x_select.port(),
.sspad = gpio_max283x_select.pad(),
.cr0 =
CR0_CLOCKRATE(ssp_scr(ssp1_pclk_f, ssp1_cpsr, max283x_spi_f)) | CR0_FRFSPI | CR0_DSS16BIT,
CR0_CLOCKRATE(ssp_scr(ssp1_pclk_f, ssp1_cpsr, max283x_spi_f) + 1) | CR0_FRFSPI | CR0_DSS16BIT,
.cpsr = ssp1_cpsr,
};
@@ -287,6 +287,10 @@ uint32_t register_read(const size_t register_number) {
return radio::first_if.read(register_number);
}
void register_write(const size_t register_number, uint32_t value) {
radio::first_if.write(register_number, value);
}
} /* namespace first_if */
namespace second_if {
@@ -295,6 +299,10 @@ uint32_t register_read(const size_t register_number) {
return radio::second_if->read(register_number);
}
void register_write(const size_t register_number, uint32_t value) {
radio::second_if->write(register_number, value);
}
int8_t temp_sense() {
return radio::second_if->temp_sense();
}
+2
View File
@@ -65,12 +65,14 @@ namespace debug {
namespace first_if {
uint32_t register_read(const size_t register_number);
void register_write(const size_t register_number, uint32_t value);
} /* namespace first_if */
namespace second_if {
uint32_t register_read(const size_t register_number);
void register_write(const size_t register_number, uint32_t value);
// TODO: This belongs somewhere else.
int8_t temp_sense();
+40
View File
@@ -337,6 +337,46 @@ std::string to_string_formatted_mac_address(const char* macAddress) {
return formattedAddress;
}
void generateRandomMacAddress(char* macAddress) {
const char hexDigits[] = "0123456789ABCDEF";
// Generate 12 random hexadecimal characters
for (int i = 0; i < 12; i++) {
int randomIndex = rand() % 16;
macAddress[i] = hexDigits[randomIndex];
}
macAddress[12] = '\0'; // Null-terminate the string
}
uint64_t readUntil(File& file, char* result, std::size_t maxBufferSize, char delimiter) {
std::size_t bytesRead = 0;
while (true) {
char ch;
File::Result<File::Size> readResult = file.read(&ch, 1);
if (readResult.is_ok() && readResult.value() > 0) {
if (ch == delimiter) {
// Found a space character, stop reading
break;
} else if (bytesRead < maxBufferSize) {
// Append the character to the result if there's space
result[bytesRead++] = ch;
} else {
// Buffer is full, break to prevent overflow
break;
}
} else {
break; // End of file or error
}
}
// Null-terminate the result string
result[bytesRead] = '\0';
return bytesRead;
}
std::string unit_auto_scale(double n, const uint32_t base_unit, uint32_t precision) {
const uint32_t powers_of_ten[5] = {1, 10, 100, 1000, 10000};
std::string string{""};
+3
View File
@@ -79,6 +79,9 @@ std::string to_string_file_size(uint32_t file_size);
// Converts Mac Address to string.
std::string to_string_mac_address(const uint8_t* macAddress, uint8_t length, bool noColon);
std::string to_string_formatted_mac_address(const char* macAddress);
void generateRandomMacAddress(char* macAddress);
uint64_t readUntil(File& file, char* result, std::size_t maxBufferSize, char delimiter);
/* Scales 'n' to be a value less than 1000. 'base_unit' is the index of the unit from
* 'unit_prefix' that 'n' is in initially. 3 is the index of the '1s' unit. */
+5
View File
@@ -86,6 +86,7 @@
#include "ais_app.hpp"
#include "analog_audio_app.hpp"
#include "analog_tv_app.hpp"
#include "ble_comm_app.hpp"
#include "ble_rx_app.hpp"
#include "ble_tx_app.hpp"
#include "capture_app.hpp"
@@ -170,6 +171,9 @@ SystemStatusView::SystemStatusView(
pmem::load_persistent_settings_from_file();
}
// force apply of selected sdcard speed override at UI startup
pmem::set_config_sdcard_high_speed_io(pmem::config_sdcard_high_speed_io(), false);
button_back.id = -1; // Special ID used by FocusManager
title.set_style(&Styles::bg_dark_grey);
@@ -551,6 +555,7 @@ ReceiversMenuView::ReceiversMenuView(NavigationView& nav) {
{"APRS", Color::green(), &bitmap_icon_aprs, [&nav]() { nav.push<APRSRXView>(); }},
{"Audio", Color::green(), &bitmap_icon_speaker, [&nav]() { nav.push<AnalogAudioView>(); }},
//{"BTLE", Color::yellow(), &bitmap_icon_btle, [&nav]() { nav.push<BTLERxView>(); }},
//{"BLE Comm", ui::Color::orange(), &bitmap_icon_btle, [&nav]() { nav.push<BLECommView>(); }},
{"BLE Rx", Color::green(), &bitmap_icon_btle, [&nav]() { nav.push<BLERxView>(); }},
{"ERT Meter", Color::green(), &bitmap_icon_ert, [&nav]() { nav.push<ERTAppView>(); }},
{"Level", Color::green(), &bitmap_icon_options_radio, [&nav]() { nav.push<LevelView>(); }},
+3 -3
View File
@@ -339,6 +339,9 @@ void BTLETxProcessor::execute(const buffer_c8_t& buffer) {
if (sample_count > length) {
configured = false;
sample_count = 0;
txprogress_message.done = true;
shared_memory.application_queue.push(txprogress_message);
} else {
// Real and imaginary was already calculated in gen_sample_from_phy_bit.
// It was processed from each data bit, run through a Gaussian Filter, and then ran through sin and cos table to get each IQ bit.
@@ -363,9 +366,6 @@ void BTLETxProcessor::execute(const buffer_c8_t& buffer) {
buffer.p[i] = {re, im};
}
}
txprogress_message.done = true;
shared_memory.application_queue.push(txprogress_message);
}
void BTLETxProcessor::on_message(const Message* const message) {
File diff suppressed because it is too large Load Diff
+4 -3
View File
@@ -205,11 +205,12 @@
#ifdef __cplusplus
extern "C" {
#endif
void halInit(void);
void halInit(void);
#if HAL_IMPLEMENTS_COUNTERS
bool_t halIsCounterWithin(halrtcnt_t start, halrtcnt_t end);
void halPolledDelay(halrtcnt_t ticks);
bool_t halIsCounterWithin(halrtcnt_t start, halrtcnt_t end);
void halPolledDelay(halrtcnt_t ticks);
#endif /* HAL_IMPLEMENTS_COUNTERS */
void sdio_cclk_set(const size_t divider_value);
#ifdef __cplusplus
}
#endif
+4
View File
@@ -862,6 +862,10 @@ class AK4951 : public audio::Codec {
return read(reg_address);
}
void reg_write(const size_t reg_address, const uint32_t value) override {
write(reg_address, value);
}
private:
I2C& bus;
const I2C::address_t bus_address;
@@ -40,6 +40,7 @@
#include <utility>
#include <ch.h>
#include <hal.h>
using namespace std;
@@ -143,7 +144,7 @@ struct misc_config_t {
bool mute_audio : 1;
bool disable_speaker : 1;
bool config_disable_external_tcxo : 1;
bool UNUSED_3 : 1;
bool config_sdcard_high_speed_io : 1;
bool UNUSED_4 : 1;
bool UNUSED_5 : 1;
bool UNUSED_6 : 1;
@@ -345,6 +346,19 @@ struct backup_ram_t {
check_value = compute_check_value();
copy(*this, dst);
}
/* Access functions for DebugPmemView */
uint32_t pmem_data_word(uint32_t index) {
return (index > sizeof(regfile) / sizeof(uint32_t)) ? 0xFFFFFFFF : regfile[index];
}
uint32_t pmem_stored_checksum(void) {
return check_value;
}
uint32_t pmem_calculated_checksum(void) {
return compute_check_value();
}
};
static_assert(sizeof(backup_ram_t) == memory::map::backup_ram.size());
@@ -381,6 +395,8 @@ void defaults() {
set_recon_update_ranges_when_recon(true);
set_recon_load_hamradios(true);
set_recon_match_mode(0);
set_config_sdcard_high_speed_io(false, true);
}
void init() {
@@ -413,6 +429,18 @@ void persist() {
} /* namespace cache */
uint32_t pmem_data_word(uint32_t index) {
return backup_ram->pmem_data_word(index);
}
uint32_t pmem_stored_checksum(void) {
return backup_ram->pmem_stored_checksum();
}
uint32_t pmem_calculated_checksum(void) {
return backup_ram->pmem_calculated_checksum();
}
rf::Frequency target_frequency() {
rf::tuning_range.reset_if_outside(data->target_frequency, target_frequency_reset_value);
return data->target_frequency;
@@ -556,6 +584,10 @@ bool config_disable_external_tcxo() {
return data->misc_config.config_disable_external_tcxo;
}
bool config_sdcard_high_speed_io() {
return data->misc_config.config_sdcard_high_speed_io;
}
bool stealth_mode() {
return data->ui_config.stealth_mode;
}
@@ -621,6 +653,19 @@ void set_config_disable_external_tcxo(bool v) {
data->misc_config.config_disable_external_tcxo = v;
}
void set_config_sdcard_high_speed_io(bool v, bool save) {
if (v) {
/* 200MHz / (2 * 2) = 50MHz */
/* TODO: Adjust SCU pin configurations: pull-up/down, slew, glitch filter? */
sdio_cclk_set(2);
} else {
/* 200MHz / (2 * 4) = 25MHz */
sdio_cclk_set(4);
}
if (save)
data->misc_config.config_sdcard_high_speed_io = v;
}
void set_stealth_mode(bool v) {
data->ui_config.stealth_mode = v;
}
@@ -990,6 +1035,7 @@ bool debug_dump() {
pmem_dump_file.write_line("misc_config config_audio_mute: " + to_string_dec_int(config_audio_mute()));
pmem_dump_file.write_line("misc_config config_speaker_disable: " + to_string_dec_int(config_speaker_disable()));
pmem_dump_file.write_line("ui_config config_disable_external_tcxo: " + to_string_dec_uint(config_disable_external_tcxo()));
pmem_dump_file.write_line("ui_config config_sdcard_high_speed_io: " + to_string_dec_uint(config_sdcard_high_speed_io()));
// receiver_model
pmem_dump_file.write_line("\n[Receiver Model]");
@@ -174,6 +174,7 @@ uint8_t config_cpld();
void set_config_cpld(uint8_t i);
bool config_disable_external_tcxo();
bool config_sdcard_high_speed_io();
bool config_splash();
bool config_converter();
bool config_updown_converter();
@@ -193,6 +194,7 @@ void set_load_app_settings(bool v);
void set_save_app_settings(bool v);
void set_show_bigger_qr_code(bool v);
void set_config_disable_external_tcxo(bool v);
void set_config_sdcard_high_speed_io(bool v, bool save);
void set_config_splash(bool v);
bool config_converter();
bool config_updown_converter();
@@ -281,6 +283,10 @@ bool should_use_sdcard_for_pmem();
int save_persistent_settings_to_file();
int load_persistent_settings_from_file();
uint32_t pmem_data_word(uint32_t index);
uint32_t pmem_stored_checksum(void);
uint32_t pmem_calculated_checksum(void);
size_t data_size();
bool debug_dump();
+4 -2
View File
@@ -30,6 +30,8 @@
#include <utility>
#include <vector>
#define pow2(x) ((x) * (x))
namespace ui {
Widget* FocusManager::focus_widget() const {
@@ -138,12 +140,12 @@ static int32_t rect_distances(
switch (direction) {
case KeyEvent::Right:
case KeyEvent::Left:
return ((std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) ^ 3) * sqrt((on_axis_distance + 1));
return pow2(std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * (on_axis_distance + 1);
break;
case KeyEvent::Up:
case KeyEvent::Down:
return (sqrt(std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1)) * ((on_axis_distance + 1) ^ 3);
return (std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * pow2(on_axis_distance + 1);
break;
default:
+7
View File
@@ -116,6 +116,8 @@ bool WM8731::write(const Register reg) {
}
bool WM8731::write(const address_t reg_address, const reg_t value) {
map.w[reg_address] = value; // Save data written in case this fn is called from Debug->Peripherals app
const uint16_t word = (reg_address << 9) | value;
const std::array<uint8_t, 2> values{
static_cast<uint8_t>(word >> 8),
@@ -124,10 +126,15 @@ bool WM8731::write(const address_t reg_address, const reg_t value) {
return bus.transmit(bus_address, values.data(), values.size());
}
/* WM8731 is a write-only device; the read function only returns the value we last wrote */
uint32_t WM8731::reg_read(const size_t reg_address) {
return map.w[reg_address];
}
void WM8731::reg_write(const size_t reg_address, uint32_t value) {
write(reg_address, value);
}
void WM8731::write(const LeftLineIn value) {
map.r.left_line_in = value;
write(Register::LeftLineIn);
+1
View File
@@ -405,6 +405,7 @@ class WM8731 : public audio::Codec {
}
uint32_t reg_read(const size_t reg_address) override;
void reg_write(const size_t reg_address, uint32_t value) override;
private:
I2C& bus;
+464
View File
@@ -0,0 +1,464 @@
010203040506 03032CFE06162CFE000006020AA8 1
010203040506 03032CFE06162CFE000007020AA9 1
010203040506 03032CFE06162CFE000008020AAA 1
010203040506 03032CFE06162CFE000009020AAB 1
010203040506 03032CFE06162CFE00000A020AAC 1
010203040506 03032CFE06162CFE00000B020AAD 1
010203040506 03032CFE06162CFE00000C020AAE 1
010203040506 03032CFE06162CFE00000D020AAF 1
010203040506 03032CFE06162CFE000035020AB0 1
010203040506 03032CFE06162CFE000047020AB1 1
010203040506 03032CFE06162CFE000048020AB2 1
010203040506 03032CFE06162CFE000049020AB3 1
010203040506 03032CFE06162CFE0000F0020AB4 1
010203040506 03032CFE06162CFE0002F0020AB5 1
010203040506 03032CFE06162CFE0003F0020AB6 1
010203040506 03032CFE06162CFE001000020AB7 1
010203040506 03032CFE06162CFE002000020AB8 1
010203040506 03032CFE06162CFE003000020AB9 1
010203040506 03032CFE06162CFE003001020ABA 1
010203040506 03032CFE06162CFE003B41020ABB 1
010203040506 03032CFE06162CFE003D8A020ABC 1
010203040506 03032CFE06162CFE0052DA020ABD 1
010203040506 03032CFE06162CFE005BC3020ABE 1
010203040506 03032CFE06162CFE008F7D020ABF 1
010203040506 03032CFE06162CFE00A168020AC0 1
010203040506 03032CFE06162CFE00AA48020AC1 1
010203040506 03032CFE06162CFE00AA91020AC2 1
010203040506 03032CFE06162CFE00B727020AC3 1
010203040506 03032CFE06162CFE00C95C020AC4 1
010203040506 03032CFE06162CFE00F7D4020AC5 1
010203040506 03032CFE06162CFE00FA72020AC6 1
010203040506 03032CFE06162CFE0100F0020AC7 1
010203040506 03032CFE06162CFE0102F0020AC8 1
010203040506 03032CFE06162CFE0103F0020AC9 1
010203040506 03032CFE06162CFE011242020ACA 1
010203040506 03032CFE06162CFE013D8A020ACB 1
010203040506 03032CFE06162CFE01AA91020ACC 1
010203040506 03032CFE06162CFE01C95C020ACD 1
010203040506 03032CFE06162CFE01E5CE020ACE 1
010203040506 03032CFE06162CFE01EEB4020ACF 1
010203040506 03032CFE06162CFE0200F0020AD0 1
010203040506 03032CFE06162CFE0202F0020AD1 1
010203040506 03032CFE06162CFE0203F0020AD2 1
010203040506 03032CFE06162CFE02AA91020AD3 1
010203040506 03032CFE06162CFE02C95C020AD4 1
010203040506 03032CFE06162CFE02D815020AD5 1
010203040506 03032CFE06162CFE02D886020AD6 1
010203040506 03032CFE06162CFE02DD4F020AD7 1
010203040506 03032CFE06162CFE02E2A9020AD8 1
010203040506 03032CFE06162CFE02F637020AD9 1
010203040506 03032CFE06162CFE0302F0020ADA 1
010203040506 03032CFE06162CFE0303F0020ADB 1
010203040506 03032CFE06162CFE035754020ADC 1
010203040506 03032CFE06162CFE035764020ADD 1
010203040506 03032CFE06162CFE038B91020ADE 1
010203040506 03032CFE06162CFE038CC7020ADF 1
010203040506 03032CFE06162CFE038F16020AE0 1
010203040506 03032CFE06162CFE039F8F020AE1 1
010203040506 03032CFE06162CFE03AA91020AE2 1
010203040506 03032CFE06162CFE03B716020AE3 1
010203040506 03032CFE06162CFE03C95C020AE4 1
010203040506 03032CFE06162CFE03C99C020AE5 1
010203040506 03032CFE06162CFE03F5D4020AE6 1
010203040506 03032CFE06162CFE0402F0020AE7 1
010203040506 03032CFE06162CFE0403F0020AE8 1
010203040506 03032CFE06162CFE045754020AE9 1
010203040506 03032CFE06162CFE045764020AEA 1
010203040506 03032CFE06162CFE04AA91020AEB 1
010203040506 03032CFE06162CFE04ACFC020AEC 1
010203040506 03032CFE06162CFE04AFB8020AED 1
010203040506 03032CFE06162CFE04C95C020AEE 1
010203040506 03032CFE06162CFE0502F0020AEF 1
010203040506 03032CFE06162CFE0503F0020AF0 1
010203040506 03032CFE06162CFE050F0C020AF1 1
010203040506 03032CFE06162CFE052CC7020AF2 1
010203040506 03032CFE06162CFE054B2D020AF3 1
010203040506 03032CFE06162CFE0577B1020AF4 1
010203040506 03032CFE06162CFE057802020AF5 1
010203040506 03032CFE06162CFE0582FD020AF6 1
010203040506 03032CFE06162CFE058D08020AF7 1
010203040506 03032CFE06162CFE05A963020AF8 1
010203040506 03032CFE06162CFE05A9BC020AF9 1
010203040506 03032CFE06162CFE05AA91020AFA 1
010203040506 03032CFE06162CFE05C452020AFB 1
010203040506 03032CFE06162CFE05C95C020AFC 1
010203040506 03032CFE06162CFE060000020AFD 1
010203040506 03032CFE06162CFE0602F0020AFE 1
010203040506 03032CFE06162CFE0603F0020AFF 1
010203040506 03032CFE06162CFE0660D7020B00 1
010203040506 03032CFE06162CFE06AE20020B01 1
010203040506 03032CFE06162CFE06C197020B02 1
010203040506 03032CFE06162CFE06C95C020B03 1
010203040506 03032CFE06162CFE06D8FC020B04 1
010203040506 03032CFE06162CFE070000020B05 1
010203040506 03032CFE06162CFE0702F0020B06 1
010203040506 03032CFE06162CFE0703F0020B07 1
010203040506 03032CFE06162CFE0X071C020B08 1
010203040506 03032CFE06162CFE0744B6020B09 1
010203040506 03032CFE06162CFE07A41C020B0A 1
010203040506 03032CFE06162CFE07C95C020B0B 1
010203040506 03032CFE06162CFE07F426020B0C 1
010203040506 03032CFE06162CFE080000020B0D 1
010203040506 03032CFE06162CFE0802F0020B0E 1
010203040506 03032CFE06162CFE0803F0020B0F 1
010203040506 03032CFE06162CFE090000020B10 1
010203040506 03032CFE06162CFE0903F0020B11 1
010203040506 03032CFE06162CFE0A0000020B12 1
010203040506 03032CFE06162CFE0B0000020B13 1
010203040506 03032CFE06162CFE0C0000020B14 1
010203040506 03032CFE06162CFE0DC6BF020B15 1
010203040506 03032CFE06162CFE0DC95C020B16 1
010203040506 03032CFE06162CFE0DEC2B020B17 1
010203040506 03032CFE06162CFE0E138D020B18 1
010203040506 03032CFE06162CFE0E30C3020B19 1
010203040506 03032CFE06162CFE0EC95C020B1A 1
010203040506 03032CFE06162CFE0ECE95020B1B 1
010203040506 03032CFE06162CFE0F0993020B1C 1
010203040506 03032CFE06162CFE0F1B8D020B1D 1
010203040506 03032CFE06162CFE0F232A020B1E 1
010203040506 03032CFE06162CFE0F2D16020B1F 1
010203040506 03032CFE06162CFE1E89A7020B20 1
010203040506 03032CFE06162CFE1E8B18020B21 1
010203040506 03032CFE06162CFE1E955B020B22 1
010203040506 03032CFE06162CFE1EC95C020B23 1
010203040506 03032CFE06162CFE1ED9F9020B24 1
010203040506 03032CFE06162CFE1EE890020B25 1
010203040506 03032CFE06162CFE1EEDF5020B26 1
010203040506 03032CFE06162CFE1F1101020B27 1
010203040506 03032CFE06162CFE1F181A020B28 1
010203040506 03032CFE06162CFE1F2E13020B29 1
010203040506 03032CFE06162CFE1F4589020B2A 1
010203040506 03032CFE06162CFE1F4627020B2B 1
010203040506 03032CFE06162CFE1F5865020B2C 1
010203040506 03032CFE06162CFE1FBB50020B2D 1
010203040506 03032CFE06162CFE1FC95C020B2E 1
010203040506 03032CFE06162CFE1FE765020B2F 1
010203040506 03032CFE06162CFE1FF8FA020B30 1
010203040506 03032CFE06162CFE201C7C020B31 1
010203040506 03032CFE06162CFE202B3D020B32 1
010203040506 03032CFE06162CFE20330C020B33 1
010203040506 03032CFE06162CFE20A19B020B34 1
010203040506 03032CFE06162CFE20C95C020B35 1
010203040506 03032CFE06162CFE20CC2C020B36 1
010203040506 03032CFE06162CFE213C8C020B37 1
010203040506 03032CFE06162CFE21521D020B38 1
010203040506 03032CFE06162CFE21A04E020B39 1
010203040506 03032CFE06162CFE2D7A23020B3A 1
010203040506 03032CFE06162CFE350000020B3B 1
010203040506 03032CFE06162CFE470000020B3C 1
010203040506 03032CFE06162CFE480000020B3D 1
010203040506 03032CFE06162CFE490000020B3E 1
010203040506 03032CFE06162CFE5BA9B5020B3F 1
010203040506 03032CFE06162CFE5BACD6020B40 1
010203040506 03032CFE06162CFE5BD6C9020B41 1
010203040506 03032CFE06162CFE5BE3D4020B42 1
010203040506 03032CFE06162CFE5C0206020B43 1
010203040506 03032CFE06162CFE5C0C84020B44 1
010203040506 03032CFE06162CFE5C4833020B45 1
010203040506 03032CFE06162CFE5C4A7E020B46 1
010203040506 03032CFE06162CFE5C55E7020B47 1
010203040506 03032CFE06162CFE5C7CDC020B48 1
010203040506 03032CFE06162CFE5C8AA5020B49 1
010203040506 03032CFE06162CFE5CC900020B4A 1
010203040506 03032CFE06162CFE5CC901020B4B 1
010203040506 03032CFE06162CFE5CC902020B4C 1
010203040506 03032CFE06162CFE5CC903020B4D 1
010203040506 03032CFE06162CFE5CC904020B4E 1
010203040506 03032CFE06162CFE5CC905020B4F 1
010203040506 03032CFE06162CFE5CC906020B50 1
010203040506 03032CFE06162CFE5CC907020B51 1
010203040506 03032CFE06162CFE5CC908020B52 1
010203040506 03032CFE06162CFE5CC909020B53 1
010203040506 03032CFE06162CFE5CC90A020B54 1
010203040506 03032CFE06162CFE5CC90B020B55 1
010203040506 03032CFE06162CFE5CC90C020B56 1
010203040506 03032CFE06162CFE5CC90D020B57 1
010203040506 03032CFE06162CFE5CC90E020B58 1
010203040506 03032CFE06162CFE5CC90F020B59 1
010203040506 03032CFE06162CFE5CC910020B5A 1
010203040506 03032CFE06162CFE5CC911020B5B 1
010203040506 03032CFE06162CFE5CC912020B5C 1
010203040506 03032CFE06162CFE5CC913020B5D 1
010203040506 03032CFE06162CFE5CC914020B5E 1
010203040506 03032CFE06162CFE5CC915020B5F 1
010203040506 03032CFE06162CFE5CC916020B60 1
010203040506 03032CFE06162CFE5CC917020B61 1
010203040506 03032CFE06162CFE5CC918020B62 1
010203040506 03032CFE06162CFE5CC919020B63 1
010203040506 03032CFE06162CFE5CC91A020B64 1
010203040506 03032CFE06162CFE5CC91B020B65 1
010203040506 03032CFE06162CFE5CC91C020B66 1
010203040506 03032CFE06162CFE5CC91D020B67 1
010203040506 03032CFE06162CFE5CC91E020B68 1
010203040506 03032CFE06162CFE5CC91F020B69 1
010203040506 03032CFE06162CFE5CC920020B6A 1
010203040506 03032CFE06162CFE5CC921020B6B 1
010203040506 03032CFE06162CFE5CC922020B6C 1
010203040506 03032CFE06162CFE5CC923020B6D 1
010203040506 03032CFE06162CFE5CC924020B6E 1
010203040506 03032CFE06162CFE5CC925020B6F 1
010203040506 03032CFE06162CFE5CC926020B70 1
010203040506 03032CFE06162CFE5CC927020B71 1
010203040506 03032CFE06162CFE5CC928020B72 1
010203040506 03032CFE06162CFE5CC929020B73 1
010203040506 03032CFE06162CFE5CC92A020B74 1
010203040506 03032CFE06162CFE5CC92B020B75 1
010203040506 03032CFE06162CFE5CC92C020B76 1
010203040506 03032CFE06162CFE5CC92D020B77 1
010203040506 03032CFE06162CFE5CC92E020B78 1
010203040506 03032CFE06162CFE5CC92F020B79 1
010203040506 03032CFE06162CFE5CC930020B7A 1
010203040506 03032CFE06162CFE5CC931020B7B 1
010203040506 03032CFE06162CFE5CC932020B7C 1
010203040506 03032CFE06162CFE5CC933020B7D 1
010203040506 03032CFE06162CFE5CC934020B7E 1
010203040506 03032CFE06162CFE5CC935020B7F 1
010203040506 03032CFE06162CFE5CC936020B80 1
010203040506 03032CFE06162CFE5CC937020B81 1
010203040506 03032CFE06162CFE5CC938020B82 1
010203040506 03032CFE06162CFE5CC939020B83 1
010203040506 03032CFE06162CFE5CC93A020B84 1
010203040506 03032CFE06162CFE5CC93B020B85 1
010203040506 03032CFE06162CFE5CC93C020B86 1
010203040506 03032CFE06162CFE5CC93D020B87 1
010203040506 03032CFE06162CFE5CC93E020B88 1
010203040506 03032CFE06162CFE5CC93F020B89 1
010203040506 03032CFE06162CFE5CC940020B8A 1
010203040506 03032CFE06162CFE5CC941020B8B 1
010203040506 03032CFE06162CFE5CC942020B8C 1
010203040506 03032CFE06162CFE5CC943020B8D 1
010203040506 03032CFE06162CFE5CC944020B8E 1
010203040506 03032CFE06162CFE5CC945020B8F 1
010203040506 03032CFE06162CFE5CEE3C020B90 1
010203040506 03032CFE06162CFE6AD226020B91 1
010203040506 03032CFE06162CFE6B1C64020B92 1
010203040506 03032CFE06162CFE6B8C65020B93 1
010203040506 03032CFE06162CFE6B9304020B94 1
010203040506 03032CFE06162CFE6BA5C3020B95 1
010203040506 03032CFE06162CFE6C42C0020B96 1
010203040506 03032CFE06162CFE6C4DE5020B97 1
010203040506 03032CFE06162CFE718FA4020B98 1
010203040506 03032CFE06162CFE72EF8D020B99 1
010203040506 03032CFE06162CFE72FB00020B9A 1
010203040506 03032CFE06162CFE821F66020B9B 1
010203040506 03032CFE06162CFE89BAD5020B9C 1
010203040506 03032CFE06162CFE8A31B7020B9D 1
010203040506 03032CFE06162CFE8A3D00020B9E 1
010203040506 03032CFE06162CFE8A3D01020B9F 1
010203040506 03032CFE06162CFE8A8F23020BA0 1
010203040506 03032CFE06162CFE8AADAE020BA1 1
010203040506 03032CFE06162CFE8B0A91020BA2 1
010203040506 03032CFE06162CFE8B5A7B020BA3 1
010203040506 03032CFE06162CFE8B66AB020BA4 1
010203040506 03032CFE06162CFE8BB0A0020BA5 1
010203040506 03032CFE06162CFE8BF79A020BA6 1
010203040506 03032CFE06162CFE8C07D2020BA7 1
010203040506 03032CFE06162CFE8C1706020BA8 1
010203040506 03032CFE06162CFE8C4236020BA9 1
010203040506 03032CFE06162CFE8C6B6A020BAA 1
010203040506 03032CFE06162CFE8CAD81020BAB 1
010203040506 03032CFE06162CFE8CB05C020BAC 1
010203040506 03032CFE06162CFE8CD10F020BAD 1
010203040506 03032CFE06162CFE8D13B9020BAE 1
010203040506 03032CFE06162CFE8D16EA020BAF 1
010203040506 03032CFE06162CFE8D5B67020BB0 1
010203040506 03032CFE06162CFE8E14D7020BB1 1
010203040506 03032CFE06162CFE8E1996020BB2 1
010203040506 03032CFE06162CFE8E4666020BB3 1
010203040506 03032CFE06162CFE8E5550020BB4 1
010203040506 03032CFE06162CFE9101F0020BB5 1
010203040506 03032CFE06162CFE9128CB020BB6 1
010203040506 03032CFE06162CFE913B0C020BB7 1
010203040506 03032CFE06162CFE915CFA020BB8 1
010203040506 03032CFE06162CFE9171BE020BB9 1
010203040506 03032CFE06162CFE917E46020BBA 1
010203040506 03032CFE06162CFE91AA00020BBB 1
010203040506 03032CFE06162CFE91AA01020BBC 1
010203040506 03032CFE06162CFE91AA02020BBD 1
010203040506 03032CFE06162CFE91AA03020BBE 1
010203040506 03032CFE06162CFE91AA04020BBF 1
010203040506 03032CFE06162CFE91AA05020BC0 1
010203040506 03032CFE06162CFE91BD38020BC1 1
010203040506 03032CFE06162CFE91C813020BC2 1
010203040506 03032CFE06162CFE91DABC020BC3 1
010203040506 03032CFE06162CFE92255E020BC4 1
010203040506 03032CFE06162CFE92BBBD020BC5 1
010203040506 03032CFE06162CFE989D0A020BC6 1
010203040506 03032CFE06162CFE9939BC020BC7 1
010203040506 03032CFE06162CFE994374020BC8 1
010203040506 03032CFE06162CFE997B4A020BC9 1
010203040506 03032CFE06162CFE99C87B020BCA 1
010203040506 03032CFE06162CFE99D7EA020BCB 1
010203040506 03032CFE06162CFE99F098020BCC 1
010203040506 03032CFE06162CFE9A408A020BCD 1
010203040506 03032CFE06162CFE9A9BDD020BCE 1
010203040506 03032CFE06162CFE9ADB11020BCF 1
010203040506 03032CFE06162CFE9AEEA4020BD0 1
010203040506 03032CFE06162CFE9B7339020BD1 1
010203040506 03032CFE06162CFE9B735A020BD2 1
010203040506 03032CFE06162CFE9B9872020BD3 1
010203040506 03032CFE06162CFE9BC64D020BD4 1
010203040506 03032CFE06162CFE9BE931020BD5 1
010203040506 03032CFE06162CFE9C0AF7020BD6 1
010203040506 03032CFE06162CFE9C3997020BD7 1
010203040506 03032CFE06162CFE9C4058020BD8 1
010203040506 03032CFE06162CFE9C6BC0020BD9 1
010203040506 03032CFE06162CFE9C888B020BDA 1
010203040506 03032CFE06162CFE9C98DB020BDB 1
010203040506 03032CFE06162CFE9CA277020BDC 1
010203040506 03032CFE06162CFE9CB5F3020BDD 1
010203040506 03032CFE06162CFE9CB881020BDE 1
010203040506 03032CFE06162CFE9CD0F3020BDF 1
010203040506 03032CFE06162CFE9CE3C7020BE0 1
010203040506 03032CFE06162CFE9CEFD1020BE1 1
010203040506 03032CFE06162CFE9CF08F020BE2 1
010203040506 03032CFE06162CFE9D00A6020BE3 1
010203040506 03032CFE06162CFE9D7D42020BE4 1
010203040506 03032CFE06162CFE9DB896020BE5 1
010203040506 03032CFE06162CFEA7E52B020BE6 1
010203040506 03032CFE06162CFEA7EF76020BE7 1
010203040506 03032CFE06162CFEA8001A020BE8 1
010203040506 03032CFE06162CFEA83C10020BE9 1
010203040506 03032CFE06162CFEA8658F020BEA 1
010203040506 03032CFE06162CFEA8845A020BEB 1
010203040506 03032CFE06162CFEA88B69020BEC 1
010203040506 03032CFE06162CFEA8A00E020BED 1
010203040506 03032CFE06162CFEA8A72A020BEE 1
010203040506 03032CFE06162CFEA8C636020BEF 1
010203040506 03032CFE06162CFEA8CAAD020BF0 1
010203040506 03032CFE06162CFEA8E353020BF1 1
010203040506 03032CFE06162CFEA8F96D020BF2 1
010203040506 03032CFE06162CFEA90358020BF3 1
010203040506 03032CFE06162CFEA92498020BF4 1
010203040506 03032CFE06162CFEA9394A020BF5 1
010203040506 03032CFE06162CFEC6936A020BF6 1
010203040506 03032CFE06162CFEC69AFD020BF7 1
010203040506 03032CFE06162CFEC6ABEA020BF8 1
010203040506 03032CFE06162CFEC6EC5F020BF9 1
010203040506 03032CFE06162CFEC7736C020BFA 1
010203040506 03032CFE06162CFEC79B91020BFB 1
010203040506 03032CFE06162CFEC7A267020BFC 1
010203040506 03032CFE06162CFEC7D620020BFD 1
010203040506 03032CFE06162CFEC7FBCC020BFE 1
010203040506 03032CFE06162CFEC8162A020BFF 1
010203040506 03032CFE06162CFEC85D7A020C00 1
010203040506 03032CFE06162CFEC8777E020C01 1
010203040506 03032CFE06162CFEC878AA020C02 1
010203040506 03032CFE06162CFEC8C641020C03 1
010203040506 03032CFE06162CFEC8D335020C04 1
010203040506 03032CFE06162CFEC8E228020C05 1
010203040506 03032CFE06162CFEC9186B020C06 1
010203040506 03032CFE06162CFEC9836A020C07 1
010203040506 03032CFE06162CFECA7030020C08 1
010203040506 03032CFE06162CFECAB6B8020C09 1
010203040506 03032CFE06162CFECAF511020C0A 1
010203040506 03032CFE06162CFECB093B020C0B 1
010203040506 03032CFE06162CFECB529D020C0C 1
010203040506 03032CFE06162CFECC438E020C0D 1
010203040506 03032CFE06162CFECC5F29020C0E 1
010203040506 03032CFE06162CFECC754F020C0F 1
010203040506 03032CFE06162CFECC93A5020C10 1
010203040506 03032CFE06162CFECCBB7E020C11 1
010203040506 03032CFE06162CFECD8256020C12 1
010203040506 03032CFE06162CFED446A7020C13 1
010203040506 03032CFE06162CFED5A59E020C14 1
010203040506 03032CFE06162CFED5B5F7020C15 1
010203040506 03032CFE06162CFED5C6CE020C16 1
010203040506 03032CFE06162CFED654CD020C17 1
010203040506 03032CFE06162CFED65F4E020C18 1
010203040506 03032CFE06162CFED69B2B020C19 1
010203040506 03032CFE06162CFED6C195020C1A 1
010203040506 03032CFE06162CFED6E870020C1B 1
010203040506 03032CFE06162CFED6EE84020C1C 1
010203040506 03032CFE06162CFED7102F020C1D 1
010203040506 03032CFE06162CFED7E3EB020C1E 1
010203040506 03032CFE06162CFED8058C020C1F 1
010203040506 03032CFE06162CFED820EA020C20 1
010203040506 03032CFE06162CFED87A3E020C21 1
010203040506 03032CFE06162CFED8F3BA020C22 1
010203040506 03032CFE06162CFED8F4E8020C23 1
010203040506 03032CFE06162CFED90617020C24 1
010203040506 03032CFE06162CFED933A7020C25 1
010203040506 03032CFE06162CFED9414F020C26 1
010203040506 03032CFE06162CFED97EBA020C27 1
010203040506 03032CFE06162CFED9964B020C28 1
010203040506 03032CFE06162CFEDA0F83020C29 1
010203040506 03032CFE06162CFEDA4577020C2A 1
010203040506 03032CFE06162CFEDA5200020C2B 1
010203040506 03032CFE06162CFEDAD3A6020C2C 1
010203040506 03032CFE06162CFEDADE43020C2D 1
010203040506 03032CFE06162CFEDAE096020C2E 1
010203040506 03032CFE06162CFEDB8AC7020C2F 1
010203040506 03032CFE06162CFEDBE5B1020C30 1
010203040506 03032CFE06162CFEDC5249020C31 1
010203040506 03032CFE06162CFEDCF33C020C32 1
010203040506 03032CFE06162CFEDD4EC0020C33 1
010203040506 03032CFE06162CFEDE215D020C34 1
010203040506 03032CFE06162CFEDE577F020C35 1
010203040506 03032CFE06162CFEDEC04C020C36 1
010203040506 03032CFE06162CFEDEDD6F020C37 1
010203040506 03032CFE06162CFEDEE8C0020C38 1
010203040506 03032CFE06162CFEDEEA86020C39 1
010203040506 03032CFE06162CFEDEF234020C3A 1
010203040506 03032CFE06162CFEDF01E3020C3B 1
010203040506 03032CFE06162CFEDF271C020C3C 1
010203040506 03032CFE06162CFEDF42DE020C3D 1
010203040506 03032CFE06162CFEDF4B02020C3E 1
010203040506 03032CFE06162CFEDF9BA4020C3F 1
010203040506 03032CFE06162CFEDFD433020C40 1
010203040506 03032CFE06162CFEE020C1020C41 1
010203040506 03032CFE06162CFEE06116020C42 1
010203040506 03032CFE06162CFEE07634020C43 1
010203040506 03032CFE06162CFEE09172020C44 1
010203040506 03032CFE06162CFEE4E457020C45 1
010203040506 03032CFE06162CFEE5440B020C46 1
010203040506 03032CFE06162CFEE57363020C47 1
010203040506 03032CFE06162CFEE57B57020C48 1
010203040506 03032CFE06162CFEE5B4B0020C49 1
010203040506 03032CFE06162CFEE5B91B020C4A 1
010203040506 03032CFE06162CFEE5E2E9020C4B 1
010203040506 03032CFE06162CFEE64613020C4C 1
010203040506 03032CFE06162CFEE64CC6020C4D 1
010203040506 03032CFE06162CFEE69877020C4E 1
010203040506 03032CFE06162CFEE6E37E020C4F 1
010203040506 03032CFE06162CFEE6E771020C50 1
010203040506 03032CFE06162CFEE6E8B8020C51 1
010203040506 03032CFE06162CFEE750CE020C52 1
010203040506 03032CFE06162CFEF00000020C53 1
010203040506 03032CFE06162CFEF00001020C54 1
010203040506 03032CFE06162CFEF00002020C55 1
010203040506 03032CFE06162CFEF00200020C56 1
010203040506 03032CFE06162CFEF00201020C57 1
010203040506 03032CFE06162CFEF00202020C58 1
010203040506 03032CFE06162CFEF00203020C59 1
010203040506 03032CFE06162CFEF00204020C5A 1
010203040506 03032CFE06162CFEF00205020C5B 1
010203040506 03032CFE06162CFEF00206020C5C 1
010203040506 03032CFE06162CFEF00207020C5D 1
010203040506 03032CFE06162CFEF00208020C5E 1
010203040506 03032CFE06162CFEF00209020C5F 1
010203040506 03032CFE06162CFEF0020A020C60 1
010203040506 03032CFE06162CFEF0020B020C61 1
010203040506 03032CFE06162CFEF0020C020C62 1
010203040506 03032CFE06162CFEF0020D020C63 1
010203040506 03032CFE06162CFEF0020E020C64 1
010203040506 03032CFE06162CFEF0020F020C65 1
010203040506 03032CFE06162CFEF00210020C66 1
010203040506 03032CFE06162CFEF00211020C67 1
010203040506 03032CFE06162CFEF00212020C68 1
010203040506 03032CFE06162CFEF00213020C69 1
010203040506 03032CFE06162CFEF00214020C6A 1
010203040506 03032CFE06162CFEF00215020C6B 1
010203040506 03032CFE06162CFEF00300020C6C 1
010203040506 03032CFE06162CFEF00301020C6D 1
010203040506 03032CFE06162CFEF00302020C6E 1
010203040506 03032CFE06162CFEF00303020C6F 1
010203040506 03032CFE06162CFEF00304020C70 1
010203040506 03032CFE06162CFEF00305020C71 1
010203040506 03032CFE06162CFEF00306020C72 1
010203040506 03032CFE06162CFEF00307020C73 1
010203040506 03032CFE06162CFEF00308020C74 1
010203040506 03032CFE06162CFEF00309020C75 1
010203040506 03032CFE06162CFEF00400020C76 1
010203040506 03032CFE06162CFEF00E97020C77 1