removed firmware update capabilities

This commit is contained in:
Dorian Zedler 2020-06-14 17:54:19 +02:00
parent fd7fbf1f77
commit f4369e9606
Signed by: dorian
GPG key ID: 989DE36109AFA354
4 changed files with 4 additions and 28 deletions

View file

@ -131,15 +131,7 @@ public slots:
*/ */
QVariantMap sendCommand(int header, QJsonValue data = "", int timeout = 3000); QVariantMap sendCommand(int header, QJsonValue data = "", int timeout = 3000);
/*! updater functions */ /*! helper functions */
/*!
* \brief Function to check wether the firmware of the base station is up-to-date
* \see getFirmwareVersion()
* \see updateFirmware()
* \return true or false
*/
bool isFirmwareUpToDate();
/*! /*!
* \brief Function to write a setting on the base station * \brief Function to write a setting on the base station

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,5 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>ScStwBasestation.sb64</file>
<file>sound/AtYourMarksSound.wav</file> <file>sound/AtYourMarksSound.wav</file>
<file>sound/IFSC frequenzy and duration conform false start sound.wav</file> <file>sound/IFSC frequenzy and duration conform false start sound.wav</file>
<file>sound/ReadySound.wav</file> <file>sound/ReadySound.wav</file>

View file

@ -106,7 +106,7 @@ bool ScStwClient::init() {
this->firmwareVersion = initResponse["data"].toMap()["firmwareVersion"].toString(); this->firmwareVersion = initResponse["data"].toMap()["firmwareVersion"].toString();
this->timeOffset = initResponse["data"].toMap()["time"].toDouble() - this->date->currentMSecsSinceEpoch(); this->timeOffset = initResponse["data"].toMap()["time"].toDouble() - this->date->currentMSecsSinceEpoch();
qDebug() << "[INFO][BaseStation] Init done! firmware: version: " << this->firmwareVersion << " up-to-date: " << this->isFirmwareUpToDate() << " time offset: " << this->timeOffset; qDebug() << "[INFO][BaseStation] Init done! firmware: " << this->firmwareVersion << " time offset: " << this->timeOffset;
this->setState(CONNECTED); this->setState(CONNECTED);
return true; return true;
@ -188,6 +188,8 @@ QVariantMap ScStwClient::sendCommand(int header, QJsonValue data, int timeout, b
//wait for an answer to finish (programm gets stuck in here) //wait for an answer to finish (programm gets stuck in here)
loop->exec(); loop->exec();
bool replyFound = false; bool replyFound = false;
// find reply and delete the request from waiting list // find reply and delete the request from waiting list
@ -386,22 +388,6 @@ void ScStwClient::handleSignal(QVariantMap data) {
emit this->gotSignal(signalKey, data["data"]); emit this->gotSignal(signalKey, data["data"]);
} }
// -------------------------
// --- updater functions ---
// -------------------------
bool ScStwClient::isFirmwareUpToDate() {
QString file = ":/ScStwBasestation.sb64";
QFile f(file);
if (!f.open(QFile::ReadOnly)) return false;
QString fileContents = f.readAll();
QString newFirmwareVersion = fileContents.split("<VER>")[1].split("</VER>")[0];
QString currentFirmwareVersion = this->firmwareVersion;
return ScStw::firmwareCompare(newFirmwareVersion, currentFirmwareVersion) <= 0;
}
// ------------------------ // ------------------------
// --- helper functions --- // --- helper functions ---
// ------------------------ // ------------------------