QDataStream out(&block,QIODevice::WriteOnly);//把IO口设置为只写
out.setVersion(QDataStream::Qt_4_7);
out<<(quint16) 0;
out<<RTU_NO; //输出RTU编号
out<<TimeStartLabel; //输出起始时间
out<<TimeEndLabel; //输出结束时间
out<<TempStr.remove(0,26);//输出数据
out.device()->seek(0);
out<<(quint16)(block.size() - sizeof(quint16));
Qt TCP/IP2
最新推荐文章于 2021-10-10 23:45:44 发布