diff --git a/radio/src/main.cpp b/radio/src/main.cpp index 8cabb0fd..62a0d390 100644 --- a/radio/src/main.cpp +++ b/radio/src/main.cpp @@ -163,6 +163,10 @@ private: if (code == RADIO_IFACE_CMD_GET_MODE) { *(int*)out = _this->demodId; } + else if (code == RADIO_IFACE_CMD_SET_MODE) { + int in = *(int*)in; + if (in != _this->demodId) { _this->selectDemodById(in); } + } } void selectDemod(Demodulator* demod) { diff --git a/radio/src/radio_interface.h b/radio/src/radio_interface.h index b1122ee7..91a23da1 100644 --- a/radio/src/radio_interface.h +++ b/radio/src/radio_interface.h @@ -1,7 +1,8 @@ #pragma once enum { - RADIO_IFACE_CMD_GET_MODE + RADIO_IFACE_CMD_GET_MODE, + RADIO_IFACE_CMD_SET_MODE }; enum {