Fixed wrong response for get_mode rigctl command

This commit is contained in:
Ryzerth 2021-07-28 04:34:44 +02:00
parent 003ff37ab8
commit fc30287bed

View File

@ -487,35 +487,42 @@ private:
} }
else if (parts[0] == "m" || parts[0] == "\\get_mode") { else if (parts[0] == "m" || parts[0] == "\\get_mode") {
std::lock_guard lck(vfoMtx); std::lock_guard lck(vfoMtx);
resp = "RAW\n"; resp = "RAW ";
if (!selectedVfo.empty() && core::modComManager.getModuleName(selectedVfo) == "radio") { if (!selectedVfo.empty() && core::modComManager.getModuleName(selectedVfo) == "radio") {
int mode; int mode;
core::modComManager.callInterface(selectedVfo, RADIO_IFACE_CMD_GET_MODE, NULL, &mode); core::modComManager.callInterface(selectedVfo, RADIO_IFACE_CMD_GET_MODE, NULL, &mode);
if (mode == RADIO_IFACE_MODE_NFM) { if (mode == RADIO_IFACE_MODE_NFM) {
resp = "FM\n"; resp = "FM ";
} }
else if (mode == RADIO_IFACE_MODE_WFM) { else if (mode == RADIO_IFACE_MODE_WFM) {
resp = "WFM\n"; resp = "WFM ";
} }
else if (mode == RADIO_IFACE_MODE_AM) { else if (mode == RADIO_IFACE_MODE_AM) {
resp = "AM\n"; resp = "AM ";
} }
else if (mode == RADIO_IFACE_MODE_DSB) { else if (mode == RADIO_IFACE_MODE_DSB) {
resp = "DSB\n"; resp = "DSB ";
} }
else if (mode == RADIO_IFACE_MODE_USB) { else if (mode == RADIO_IFACE_MODE_USB) {
resp = "USB\n"; resp = "USB ";
} }
else if (mode == RADIO_IFACE_MODE_CW) { else if (mode == RADIO_IFACE_MODE_CW) {
resp = "CW\n"; resp = "CW ";
} }
else if (mode == RADIO_IFACE_MODE_LSB) { else if (mode == RADIO_IFACE_MODE_LSB) {
resp = "LSB\n"; resp = "LSB ";
} }
} }
if (!selectedVfo.empty()) {
resp += std::to_string((int)sigpath::vfoManager.getBandwidth(selectedVfo)) + "\n";
}
else {
resp += "0\n";
}
client->write(resp.size(), (uint8_t*)resp.c_str()); client->write(resp.size(), (uint8_t*)resp.c_str());
} }
else if (parts[0] == "V" || parts[0] == "\\set_vfo") { else if (parts[0] == "V" || parts[0] == "\\set_vfo") {