From 39ab8bbccf8efd8d03faf522ec03ff8d28ae9079 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Wed, 3 Aug 2022 13:19:25 +0200 Subject: [PATCH] Chore: remove all occurences of "Omobi" --- app/ressources/qml/main.qml | 2 +- firmware/include/BluetoothLeUartServer.h | 3 +-- .../{OmobiLedDisplay.h => LedDisplay.h} | 14 ++++++------ .../{OmobiLedDisplay.cpp => LedDisplay.cpp} | 22 +++++++++---------- firmware/src/main.cpp | 6 ++--- 5 files changed, 23 insertions(+), 24 deletions(-) rename firmware/include/{OmobiLedDisplay.h => LedDisplay.h} (87%) rename firmware/src/{OmobiLedDisplay.cpp => LedDisplay.cpp} (92%) diff --git a/app/ressources/qml/main.qml b/app/ressources/qml/main.qml index 5a576c3..a33fe70 100644 --- a/app/ressources/qml/main.qml +++ b/app/ressources/qml/main.qml @@ -298,7 +298,7 @@ ApplicationWindow { DisclaimerDialog { id: infoDisclaimerDialog - title: "LedDisplayController v" + APP_VERSION + "
By Itsblue Development, " + qsTr("privacy policy") + "" + title: "LedDisplayController v" + APP_VERSION + "
By Itsblue Development, " + qsTr("privacy policy") + "" content: qsTr("This app was built using the Qt Framework licensed under the GNU lgplV3 license.

This app is open source and licensed under the GNU agplV3 license, the source code can be found here.") } diff --git a/firmware/include/BluetoothLeUartServer.h b/firmware/include/BluetoothLeUartServer.h index f957974..c94c121 100644 --- a/firmware/include/BluetoothLeUartServer.h +++ b/firmware/include/BluetoothLeUartServer.h @@ -15,7 +15,6 @@ class BluetoothLeUartServerCallbacks; * Example use * \code * #include - * #include "OmobiLedDisplay.h" * * BluetoothLeUartServer* server; * @@ -33,7 +32,7 @@ class BluetoothLeUartServerCallbacks; * * void setup() * { - * server = new BluetoothLeUartServer("OmobiLedDisplay1", "6e400001-b5a3-f393-e0a9-e50e24dcca9e", "6e400002-b5a3-f393-e0a9-e50e24dcca9e", "6e400003-b5a3-f393-e0a9-e50e24dcca9e"); + * server = new BluetoothLeUartServer("LedDisplay1", "6e400001-b5a3-f393-e0a9-e50e24dcca9e", "6e400002-b5a3-f393-e0a9-e50e24dcca9e", "6e400003-b5a3-f393-e0a9-e50e24dcca9e"); * server->setCallbacks(new MyCallbacks()); * } * diff --git a/firmware/include/OmobiLedDisplay.h b/firmware/include/LedDisplay.h similarity index 87% rename from firmware/include/OmobiLedDisplay.h rename to firmware/include/LedDisplay.h index b009620..bacaaa8 100644 --- a/firmware/include/OmobiLedDisplay.h +++ b/firmware/include/LedDisplay.h @@ -1,5 +1,5 @@ -#ifndef OMOBI_LED_DISPLAY -#define OMOBI_LED_DISPLAY +#ifndef LED_DISPLAY +#define LED_DISPLAY #include #include @@ -9,12 +9,12 @@ #include "LedDisplayController.h" -class OmobiLedDisplay : protected BluetoothLeUartServerCallbacks +class LedDisplay : protected BluetoothLeUartServerCallbacks { public: template - explicit OmobiLedDisplay(String deviceName, NeoPixelBrightnessBusGfx *ledDisplayMatrix) + explicit LedDisplay(String deviceName, NeoPixelBrightnessBusGfx *ledDisplayMatrix) { this->lastKeepAlive = -1; this->sessionAuthorized = false; @@ -49,7 +49,7 @@ protected: private: - enum OmobiDisplayCommand + enum DisplayCommand { AuthenticateCommand = 0, KeepAliveCommand = 1, @@ -62,7 +62,7 @@ private: SetDisplayNameCommand = 23 }; - enum OmobiDisplayStatusCode + enum DisplayStatusCode { Success = 200, BadRequestError = 400, @@ -94,4 +94,4 @@ private: String sha256(String payload); }; -#endif // OMOBI_LED_DISPLAY \ No newline at end of file +#endif // LED_DISPLAY \ No newline at end of file diff --git a/firmware/src/OmobiLedDisplay.cpp b/firmware/src/LedDisplay.cpp similarity index 92% rename from firmware/src/OmobiLedDisplay.cpp rename to firmware/src/LedDisplay.cpp index 9ff5fe9..f0a4c2f 100644 --- a/firmware/src/OmobiLedDisplay.cpp +++ b/firmware/src/LedDisplay.cpp @@ -1,9 +1,9 @@ -#include "OmobiLedDisplay.h" +#include "LedDisplay.h" -//OmobiLedDisplay::OmobiLedDisplay(String deviceName, Adafruit_NeoMatrix *ledDisplayMatrix) +//LedDisplay::LedDisplay(String deviceName, Adafruit_NeoMatrix *ledDisplayMatrix) -void OmobiLedDisplay::loop() +void LedDisplay::loop() { if (millis() - lastKeepAlive > this->maximumKeepAliveDelay) { @@ -12,7 +12,7 @@ void OmobiLedDisplay::loop() } } -void OmobiLedDisplay::onDeviceConnectedChanged(bool deviceConnected) +void LedDisplay::onDeviceConnectedChanged(bool deviceConnected) { if (deviceConnected) { @@ -27,7 +27,7 @@ void OmobiLedDisplay::onDeviceConnectedChanged(bool deviceConnected) } } -void OmobiLedDisplay::onDataReceived(String dataString) +void LedDisplay::onDataReceived(String dataString) { // process JSON const size_t capacity = JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(3) + 200; @@ -39,13 +39,13 @@ void OmobiLedDisplay::onDataReceived(String dataString) return; // get reuqest data - OmobiDisplayCommand requestHeader = requestDoc["header"]; + DisplayCommand requestHeader = requestDoc["header"]; JsonObject requestData = requestDoc["data"]; // prepare reply data DynamicJsonDocument replyDoc(capacity); replyDoc["header"] = requestHeader; - OmobiDisplayStatusCode replyStatus = InternalError; + DisplayStatusCode replyStatus = InternalError; JsonObject replyData = replyDoc.createNestedObject("data"); if (requestHeader > KeepAliveCommand && !this->sessionAuthorized) @@ -183,7 +183,7 @@ void OmobiLedDisplay::onDataReceived(String dataString) } -bool OmobiLedDisplay::loadProperties() +bool LedDisplay::loadProperties() { if (this->eepromUnit == nullptr) return false; @@ -201,7 +201,7 @@ bool OmobiLedDisplay::loadProperties() { // There was an error reading the properties -> rebuild with default values! DisplayProperties defaultProperties{ - "Omobi Led Display", + "Led Display", "1234", "OK"}; @@ -212,7 +212,7 @@ bool OmobiLedDisplay::loadProperties() return true; } -bool OmobiLedDisplay::storeProperties() +bool LedDisplay::storeProperties() { if (this->eepromUnit == nullptr) return false; @@ -222,7 +222,7 @@ bool OmobiLedDisplay::storeProperties() return true; } -String OmobiLedDisplay::sha256(String payload) +String LedDisplay::sha256(String payload) { byte shaResult[32]; mbedtls_md_context_t ctx; diff --git a/firmware/src/main.cpp b/firmware/src/main.cpp index a3ce642..a28c1bc 100644 --- a/firmware/src/main.cpp +++ b/firmware/src/main.cpp @@ -1,5 +1,5 @@ #include -#include "OmobiLedDisplay.h" +#include "LedDisplay.h" #define MATRIX_PIN 4 #define TILE_PIXEL_ROWS 8 @@ -9,7 +9,7 @@ #define MATRIX_PIXEL_WIDTH TILE_PIXEL_COLS*MATRIX_TILES_COL #define MATRIX_PIXEL_HEIGHT TILE_PIXEL_ROWS*MATRIX_TILES_ROW -OmobiLedDisplay *display; +LedDisplay *display; ///----- Setup of display driver and topology: ------------------------------------------------------------------------- // For detailed information on NeoPixel and NeoTiles etc. - all around display topology setup please see here: @@ -29,7 +29,7 @@ void setup() Serial.printf("Los\n"); // create our display displayMatrix->setRemapFunction(&remap); - display = new OmobiLedDisplay("OmobiLedDisplay1", displayMatrix); + display = new LedDisplay("LedDisplay1", displayMatrix); }