Setfreq usb command (#2235)

* SetFreq usb command for rx apps
* code format, better check
This commit is contained in:
Totoo 2024-09-04 20:26:31 +02:00 committed by GitHub
parent a2c4fefe34
commit 02b75f567a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 202 additions and 0 deletions

View file

@ -185,6 +185,7 @@ class APRSRxView : public View {
std::string title() const override { return "APRS RX"; };
void on_packet(const APRSPacketMessage* message);
void on_freqchg(int64_t freq);
private:
void on_data(uint32_t value, bool is_data);
@ -271,6 +272,13 @@ class APRSRXView : public View {
this->view_stream.on_packet(message);
this->view_table.on_pkt(message);
}};
MessageHandlerRegistration message_handler_freqchg{
Message::ID::FreqChangeCommand,
[this](Message* const p) {
const auto message = static_cast<const FreqChangeCommandMessage*>(p);
this->view_stream.on_freqchg(message->freq);
}};
};
} /* namespace ui */