вывод нормальной ошибки от сервера + фикс установки режима работы передатчика

This commit is contained in:
2025-01-16 13:50:01 +03:00
parent cbd2adc1c8
commit 790bfc06c2
7 changed files with 26 additions and 17 deletions

View File

@@ -651,7 +651,7 @@ static const char* boolAsStr(bool value) {
return value ? "true" : "false";
}
static std::string buildEscapedString(const std::string& source) {
std::string api_driver::buildEscapedString(const std::string& source) {
std::string str(source);
size_t start_pos = 0;
while((start_pos = str.find('\"', start_pos)) != std::string::npos) {
@@ -661,7 +661,7 @@ static std::string buildEscapedString(const std::string& source) {
return "\"" + str + "\"";
}
void writeDouble(std::ostream& out, double value, int prec = 2) {
static void writeDouble(std::ostream& out, double value, int prec = 2) {
if (std::isnan(value) || std::isinf(value)) {
out << "\"nan\"";
} else {
@@ -873,7 +873,7 @@ std::string api_driver::ApiDriver::loadSettings() const {
std::stringstream result;
result << "{\n\"txAutoStart\":" << boolAsStr(modSettings.is_save_current_state);
#ifdef MODEM_IS_SCPC
result << ",\"txEn\":" << boolAsStr(!modSettings.tx_is_on);
result << ",\"txEn\":" << boolAsStr(modSettings.tx_is_on);
result << ",\"txModulatorIsTest\":" << boolAsStr(!modSettings.is_carrier);
#endif
result << ",\"txIsTestInput\":" << boolAsStr(modSettings.is_test_data);