| 66 | } |
| 67 | |
| 68 | void FreeDvClient::startConnection() |
| 69 | { |
| 70 | if (m_connected.load()) return; |
| 71 | |
| 72 | qCDebug(lcDxCluster) << "FreeDvClient: connecting to qso.freedv.org"; |
| 73 | |
| 74 | // Open log file (truncate on each start) |
| 75 | m_logFile.close(); |
| 76 | m_logFile.setFileName(logFilePath()); |
| 77 | QDir().mkpath(QFileInfo(m_logFile).absolutePath()); |
| 78 | if (m_logFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) { |
| 79 | m_logFile.write(QString("--- FreeDV Reporter connected at %1 ---\n") |
| 80 | .arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-dd HH:mm:ss UTC")).toUtf8()); |
| 81 | m_logFile.flush(); |
| 82 | } |
| 83 | |
| 84 | m_stations.clear(); |
| 85 | m_intentionalDisconnect = false; |
| 86 | m_reconnectAttempts = 0; |
| 87 | m_ws->open(QUrl(WsUrl)); |
| 88 | emit started(); |
| 89 | } |
| 90 | |
| 91 | void FreeDvClient::stopConnection() |
| 92 | { |
no test coverage detected