diff --git a/OmobiDisplayApp/omobidisplaybackend.cpp b/OmobiDisplayApp/omobidisplaybackend.cpp index f9017a6..ff3cc48 100644 --- a/OmobiDisplayApp/omobidisplaybackend.cpp +++ b/OmobiDisplayApp/omobidisplaybackend.cpp @@ -24,6 +24,10 @@ OmobiDisplayBackend::OmobiDisplayBackend(QObject *parent) : QObject(parent) this->setState(Idle); this->ble->startScanningForDevices(); + + qDebug() << QCryptographicHash::hash("HalloTest", QCryptographicHash::Sha256).toHex(); + // dd86fcfda3a20cbb8fbb3026a84550e0d70c2c79e7e8e36d6ffa04b9eef0401f + // dd86fcfda3a20cbb8fbb3026a84550e0d70c2c79e7e8e36d6ffa04b9eef0401f } @@ -73,6 +77,7 @@ void OmobiDisplayBackend::handleBluetoothDeviceConected() { this->setState(Initing); // tell display to send over existing model data + this->sendBluetoothCommand(AuthorizeSessionCommand, QVariantMap{{"secret", QCryptographicHash::hash("1234", QCryptographicHash::Sha256).toHex()}}); this->sendBluetoothCommand(GetAllTextSetsCommand); this->sendBluetoothCommand(GetDisplayBrightnessCommand); } @@ -144,6 +149,8 @@ void OmobiDisplayBackend::handleBluetoothDataReceived(QString s){ switch (header) { case AuthorizeSessionCommand: { + // TODO: handle error + this->refreshLoadingState(); break; } case KeepAliveCommand: { diff --git a/OmobiDisplayApp/omobidisplaybackend.h b/OmobiDisplayApp/omobidisplaybackend.h index 329f602..f0bdfdb 100644 --- a/OmobiDisplayApp/omobidisplaybackend.h +++ b/OmobiDisplayApp/omobidisplaybackend.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include