Move BasebandConfiguration message handling into baseband thread.

This commit is contained in:
Jared Boone 2016-01-03 11:49:01 -08:00
parent fd612dc207
commit c9f9d97d07
3 changed files with 8 additions and 12 deletions

View File

@ -69,8 +69,12 @@ void BasebandThread::set_configuration(const BasebandConfiguration& new_configur
}
void BasebandThread::on_message(const Message* const message) {
if( baseband_processor ) {
baseband_processor->on_message(message);
if( message->id == Message::ID::BasebandConfiguration ) {
set_configuration(reinterpret_cast<const BasebandConfigurationMessage*>(message)->configuration);
} else {
if( baseband_processor ) {
baseband_processor->on_message(message);
}
}
}

View File

@ -37,8 +37,6 @@ public:
Thread* start(const tprio_t priority);
void set_configuration(const BasebandConfiguration& new_configuration);
void on_message(const Message* const message);
void on_update_spectrum();
@ -61,6 +59,8 @@ private:
void disable();
void enable();
void set_configuration(const BasebandConfiguration& new_configuration);
};
#endif/*__BASEBAND_THREAD_H__*/

View File

@ -170,10 +170,6 @@ private:
void on_message(const Message* const message) {
switch(message->id) {
case Message::ID::BasebandConfiguration:
on_message_baseband_configuration(*reinterpret_cast<const BasebandConfigurationMessage*>(message));
break;
case Message::ID::Shutdown:
on_message_shutdown(*reinterpret_cast<const ShutdownMessage*>(message));
break;
@ -184,10 +180,6 @@ private:
}
}
void on_message_baseband_configuration(const BasebandConfigurationMessage& message) {
baseband_thread.set_configuration(message.configuration);
}
void on_message_shutdown(const ShutdownMessage&) {
request_stop();
}