diff --git a/firmware/baseband/baseband_processor.hpp b/firmware/baseband/baseband_processor.hpp index 82a79a0e..48b23b7b 100644 --- a/firmware/baseband/baseband_processor.hpp +++ b/firmware/baseband/baseband_processor.hpp @@ -38,6 +38,7 @@ public: virtual void execute(const buffer_c8_t& buffer) = 0; + virtual void on_message(const Message* const) { }; virtual void on_update_spectrum() { }; protected: diff --git a/firmware/baseband/baseband_thread.cpp b/firmware/baseband/baseband_thread.cpp index ce0ff0b8..1035d2dc 100644 --- a/firmware/baseband/baseband_thread.cpp +++ b/firmware/baseband/baseband_thread.cpp @@ -68,6 +68,12 @@ void BasebandThread::set_configuration(const BasebandConfiguration& new_configur baseband_configuration = new_configuration; } +void BasebandThread::on_message(const Message* const message) { + if( baseband_processor ) { + baseband_processor->on_message(message); + } +} + void BasebandThread::on_update_spectrum() { if( baseband_processor ) { baseband_processor->on_update_spectrum(); diff --git a/firmware/baseband/baseband_thread.hpp b/firmware/baseband/baseband_thread.hpp index 814dcd51..4c16a54d 100644 --- a/firmware/baseband/baseband_thread.hpp +++ b/firmware/baseband/baseband_thread.hpp @@ -39,6 +39,7 @@ public: void set_configuration(const BasebandConfiguration& new_configuration); + void on_message(const Message* const message); void on_update_spectrum(); // This getter should die, it's just here to leak information to code that diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 4f019621..79df6ce1 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -192,8 +192,8 @@ private: request_stop(); } - void on_message_default(const Message* const) { - // TODO: Pass to active baseband processor. + void on_message_default(const Message* const message) { + baseband_thread.on_message(message); } void handle_spectrum() {