1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

fix qqt server error

This commit is contained in:
tianduanrui 2018-04-23 14:44:08 +08:00
parent 8f52ef30c7
commit 8301804b62
2 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,7 @@ void MainWindow::recvANotify ( const QQtProtocol* protocol, const QQtMessage* me
{ {
case 0x01: case 0x01:
{ {
if ( m->getAData().contains ( "hello" ) ) if ( QString ( m->getAData() ).contains ( "hello" ) )
p->sendB1Command(); p->sendB1Command();
else else
p->sendB10Command(); p->sendB10Command();

View File

@ -122,6 +122,8 @@ public:
msg.getBData() = "Recived, Also hello to you."; msg.getBData() = "Recived, Also hello to you.";
msg.translate(); msg.translate();
//pline() << msg.getBCmd() << msg.getBData();
QByteArray l; QByteArray l;
msg.packer ( l ); msg.packer ( l );
write ( l ); write ( l );
@ -129,10 +131,12 @@ public:
void sendB10Command() { void sendB10Command() {
QQtServerMessage msg; QQtServerMessage msg;
msg.getBCmd() = 0x0100; msg.getBCmd() = 0x0A;
msg.getBData() = "Please, say hello to me."; msg.getBData() = "Please, say hello to me.";
msg.translate(); msg.translate();
//pline() << msg.getBCmd() << msg.getBData();
QByteArray l; QByteArray l;
msg.packer ( l ); msg.packer ( l );
write ( l ); write ( l );
@ -141,7 +145,7 @@ public:
// QQtProtocol interface // QQtProtocol interface
protected: protected:
virtual quint16 minlength() override { virtual quint16 minlength() override {
return 0; return 0x02;
} }
virtual quint16 maxlength() override { virtual quint16 maxlength() override {
return 0x07FF; return 0x07FF;