TPMSAppView::TPMSAppView(NavigationView&) { add_children({ { &recent_entries_view, } }); EventDispatcher::message_map().register_handler(Message::ID::TPMSPacket, [this](Message* const p) { const auto message = static_cast<const TPMSPacketMessage*>(p); const tpms::Packet packet { message->packet }; this->on_packet(packet); } ); radio::enable({ tuning_frequency(), sampling_rate, baseband_bandwidth, rf::Direction::Receive, false, 32, 32, 1, }); baseband::start({ .mode = 5, .sampling_rate = sampling_rate, .decimation_factor = 1, });
CaptureAppView::CaptureAppView(NavigationView& nav) { baseband::run_image(portapack::spi_flash::image_tag_capture); add_children({ { &rssi, &channel, &field_frequency, &field_frequency_step, &field_rf_amp, &field_lna, &field_vga, &record_view, &waterfall, } }); field_frequency.set_value(target_frequency()); field_frequency.set_step(receiver_model.frequency_step()); field_frequency.on_change = [this](rf::Frequency f) { this->on_target_frequency_changed(f); }; field_frequency.on_edit = [this, &nav]() { // TODO: Provide separate modal method/scheme? auto new_view = nav.push<FrequencyKeypadView>(this->target_frequency()); new_view->on_changed = [this](rf::Frequency f) { this->on_target_frequency_changed(f); this->field_frequency.set_value(f); }; }; field_frequency_step.set_by_value(receiver_model.frequency_step()); field_frequency_step.on_change = [this](size_t, OptionsField::value_t v) { receiver_model.set_frequency_step(v); this->field_frequency.set_step(v); }; radio::enable({ tuning_frequency(), sampling_rate, baseband_bandwidth, rf::Direction::Receive, receiver_model.rf_amp(), static_cast<int8_t>(receiver_model.lna()), static_cast<int8_t>(receiver_model.vga()), }); record_view.set_sampling_rate(sampling_rate / 8); record_view.on_error = [&nav](std::string message) { nav.display_modal("Error", message); }; }
AISAppView::AISAppView(NavigationView&) { baseband::run_image(portapack::spi_flash::image_tag_ais); add_children({ { &label_channel, &options_channel, &field_rf_amp, &field_lna, &field_vga, &rssi, &channel, &recent_entries_view, &recent_entry_detail_view, } }); recent_entry_detail_view.hidden(true); target_frequency_ = initial_target_frequency; radio::enable({ tuning_frequency(), sampling_rate, baseband_bandwidth, rf::Direction::Receive, receiver_model.rf_amp(), static_cast<int8_t>(receiver_model.lna()), static_cast<int8_t>(receiver_model.vga()), 1, }); options_channel.on_change = [this](size_t, OptionsField::value_t v) { this->on_frequency_changed(v); }; options_channel.set_by_value(target_frequency()); recent_entries_view.on_select = [this](const AISRecentEntry& entry) { this->on_show_detail(entry); }; recent_entry_detail_view.on_close = [this]() { this->on_show_list(); }; logger = std::make_unique<AISLogger>(); if( logger ) { logger->append("ais.txt"); } }
TPMSAppView::TPMSAppView(NavigationView&) { add_children({ { &recent_entries_view, } }); radio::enable({ tuning_frequency(), sampling_rate, baseband_bandwidth, rf::Direction::Receive, false, 32, 32, 1, }); baseband::start({ .mode = 5, .sampling_rate = sampling_rate, .decimation_factor = 1, });
void CaptureAppView::set_target_frequency(const rf::Frequency new_value) { persistent_memory::set_tuned_frequency(new_value);; radio::set_tuning_frequency(tuning_frequency()); }
void AISAppView::set_target_frequency(const uint32_t new_value) { target_frequency_ = new_value; radio::set_tuning_frequency(tuning_frequency()); }