|
liuchangyin 发表于 2017-1-6 16:51
串口收数据是另外的消息触发,只需要将串口收到的消息保存到数组中,在串口发送数据后,利用定时函数查询串 ...
void wss::Read_data()
{
QByteArray state_return = wsscomm.readAll();
qDebug()<<state_return;
if(state_return == "OK")
{
printf("Wss is ok");
}
}
void wss:n_State_wss_clicked()
{
wsscomm.write("sus?");
connect(&wsscomm,SIGNAL(readyRead()),this,SLOT(Read_data()));
}
这样可以吗 |
|