mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-01 00:55:07 -05:00
todo: remove uneeded code
This commit is contained in:
parent
c06f171544
commit
42138b44d5
@ -134,7 +134,7 @@ RandomView::RandomView(NavigationView& nav)
|
||||
|
||||
logger = std::make_unique<RandomLogger>();
|
||||
if (logger)
|
||||
logger->append(logs_dir / u"AFSK.TXT");
|
||||
logger->append(logs_dir / u"random.TXT");
|
||||
|
||||
// Auto-configure modem for LCR RX (will be removed later)
|
||||
baseband::set_afsk(persistent_memory::modem_baudrate(), 8, 0, false);
|
||||
@ -161,17 +161,14 @@ void RandomView::on_data(uint32_t value, bool is_data) {
|
||||
|
||||
console.write(str_console);
|
||||
|
||||
if (logger && logging) str_log += str_byte;
|
||||
// if (logger && logging) str_log += str_byte;
|
||||
|
||||
if ((value != 0x7F) && (prev_value == 0x7F)) {
|
||||
// Message split
|
||||
console.writeln("");
|
||||
console_color++;
|
||||
|
||||
if (logger && logging) {
|
||||
logger->log_raw_data(str_log);
|
||||
str_log = "";
|
||||
}
|
||||
|
||||
}
|
||||
prev_value = value;
|
||||
} else {
|
||||
@ -235,8 +232,23 @@ void RandomView::new_password() {
|
||||
|
||||
text_generated_passwd.set(password);
|
||||
text_char_type_hints.set(char_type_hints);
|
||||
|
||||
if (logger && logging) {
|
||||
str_log += generate_log_line(password);
|
||||
logger->log_raw_data(str_log);
|
||||
str_log = "";
|
||||
}
|
||||
}
|
||||
|
||||
std::string RandomView::generate_log_line(const std::string &password) {
|
||||
std::string line = "\npassword=" + password +
|
||||
"\nseed=" + std::to_string(seed) +
|
||||
"\n";
|
||||
return line;
|
||||
}
|
||||
|
||||
bool RandomView::seed_protect_helper(const unsigned int &seed){}
|
||||
|
||||
RandomView::~RandomView() {
|
||||
audio::output::stop();
|
||||
receiver_model.disable();
|
||||
|
@ -60,10 +60,11 @@ class RandomView : public View {
|
||||
std::string title() const override { return "random"; };
|
||||
|
||||
private:
|
||||
unsigned int seed = 0; // extern void srand (unsigned int __seed) __THROW;
|
||||
unsigned int seed = nullptr; // extern void srand (unsigned int __seed) __THROW;
|
||||
|
||||
void on_data(uint32_t value, bool is_data);
|
||||
void new_password();
|
||||
std::string generate_log_line(const std::string &password);
|
||||
|
||||
NavigationView& nav_;
|
||||
RxRadioState radio_state_{};
|
||||
|
Loading…
x
Reference in New Issue
Block a user