diff --git a/examples/qqtserverexample/mainwindow.cpp b/examples/qqtserverexample/mainwindow.cpp index 7e17f4c7..b438f5d2 100644 --- a/examples/qqtserverexample/mainwindow.cpp +++ b/examples/qqtserverexample/mainwindow.cpp @@ -27,7 +27,7 @@ void MainWindow::recvANotify ( const QQtProtocol* protocol, const QQtMessage* me { case 0x01: { - if ( m->getAData().contains ( "hello" ) ) + if ( QString ( m->getAData() ).contains ( "hello" ) ) p->sendB1Command(); else p->sendB10Command(); diff --git a/examples/qqtserverexample/qqtserverprotocolmanager.h b/examples/qqtserverexample/qqtserverprotocolmanager.h index 475972b4..08e5af42 100644 --- a/examples/qqtserverexample/qqtserverprotocolmanager.h +++ b/examples/qqtserverexample/qqtserverprotocolmanager.h @@ -122,6 +122,8 @@ public: msg.getBData() = "Recived, Also hello to you."; msg.translate(); + //pline() << msg.getBCmd() << msg.getBData(); + QByteArray l; msg.packer ( l ); write ( l ); @@ -129,10 +131,12 @@ public: void sendB10Command() { QQtServerMessage msg; - msg.getBCmd() = 0x0100; + msg.getBCmd() = 0x0A; msg.getBData() = "Please, say hello to me."; msg.translate(); + //pline() << msg.getBCmd() << msg.getBData(); + QByteArray l; msg.packer ( l ); write ( l ); @@ -141,7 +145,7 @@ public: // QQtProtocol interface protected: virtual quint16 minlength() override { - return 0; + return 0x02; } virtual quint16 maxlength() override { return 0x07FF;