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:
{
if ( m->getAData().contains ( "hello" ) )
if ( QString ( m->getAData() ).contains ( "hello" ) )
p->sendB1Command();
else
p->sendB10Command();

View File

@ -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;