diff --git a/LedDisplayController/leddisplaybackend.cpp b/LedDisplayController/leddisplaybackend.cpp index c1588a3..c328caa 100644 --- a/LedDisplayController/leddisplaybackend.cpp +++ b/LedDisplayController/leddisplaybackend.cpp @@ -40,7 +40,7 @@ void LedDisplayBackend::authenticate(QString code) { if(code.length() == 64) this->lastDisplaySecret = code; else if(code.length() == 4) { - QString combinedCode = this->bleClient->getCurrentDevice()->getAddress().toUpper() + code; + QString combinedCode = code; this->lastDisplaySecret = QCryptographicHash::hash(combinedCode.toUtf8(), QCryptographicHash::Sha256).toHex(); } diff --git a/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h b/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h index 535f0d4..b1611f4 100644 --- a/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h +++ b/vscode/OmobiLEDdisplayBluetooth/include/LedDisplayController.h @@ -12,7 +12,6 @@ // function for updater task on core 0 void updateDisplayGlobal(void* object); -//extern LedDisplayController *ledDisplayControllerGlobal; class LedDisplayController { @@ -20,11 +19,11 @@ public: template explicit LedDisplayController(NeoPixelBrightnessBusGfx *matrix ) { - this->eepromUnit = nullptr; - //ledDisplayControllerGlobal = this; this->loadTextSets(); + this->RFade = (StepsFade*log10(2))/log10(255); + this->matrix = matrix; this->matrix->Begin(); this->matrix->setTextWrap(false); @@ -112,6 +111,9 @@ private: uint8_t default_display_show_wait_ms; uint8_t display_show_wait_ms; + static const uint8_t StepsFade = 50; + float RFade; + // matrix control //uint16_t remap(uint16_t x, uint16_t y); void disp_init(); diff --git a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp index 21bedb5..fd6445b 100644 --- a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp +++ b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp @@ -1,10 +1,5 @@ #include "LedDisplayController.h" -LedDisplayController *ledDisplayControllerGlobal = nullptr; - -static const uint8_t StepsFade = 50; -static const float RFade = (StepsFade*log10(2))/log10(255); - // -------------------- // - Public functions - // -------------------- @@ -265,8 +260,8 @@ LedDisplayController::GetSetTextSetParameterExitCode LedDisplayController::getSe if (set) currentTextSet->runtime = value->toInt() * 1000; else - returnValue = String(round(currentTextSet->runtime / 1000)); - //Serial.printf("Runtim is: %d \n", currentTextSet->runtime); + returnValue = String((int)round(currentTextSet->runtime / 1000)); + //Serial.printf("Runtime is: %d \n", currentTextSet->runtime); break; case ColorParameter: diff --git a/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp b/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp index 9c3f442..6d9e528 100644 --- a/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp +++ b/vscode/OmobiLEDdisplayBluetooth/src/OmobiLedDisplay.cpp @@ -55,7 +55,7 @@ void OmobiLedDisplay::onDataReceived(String dataString) { case AuthenticateCommand: { - String combinedCode = this->bleServer->getDeviceAddress() + String(this->properties.deviceCode); + String combinedCode = String(this->properties.deviceCode); //this->bleServer->getDeviceAddress() + String(this->properties.deviceCode); String secret = this->sha256(combinedCode); if (this->sessionAuthorized)