串口调通,采用在其他线程的模式
This commit is contained in:
@@ -80,8 +80,7 @@ void commandprocess::process()//线程函数
|
||||
|
||||
void commandprocess::setID(int m_sysid,int m_compid)
|
||||
{
|
||||
//qDebug() << "command set id";
|
||||
sysid = (uint8_t)m_sysid;
|
||||
sysid = (uint8_t)m_sysid;
|
||||
compid = (uint8_t)m_compid;
|
||||
}
|
||||
|
||||
@@ -146,10 +145,6 @@ void commandprocess::WriteCmd_long(float param1, float param2, float param3, fl
|
||||
start();//开启线程
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//这个函数类似中断,专门处理接收到的状态
|
||||
void commandprocess::Parse(mavlink_message_t msg)
|
||||
{
|
||||
@@ -177,11 +172,13 @@ void commandprocess::Parse(mavlink_message_t msg)
|
||||
|
||||
if(command_ack.result == MAV_RESULT_ACCEPTED)
|
||||
{
|
||||
if(cmd_long.command != command_ack.command)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
status.transmit.isWaitingforACK = false;
|
||||
|
||||
emit commandAccepted(true,command_ack.command,command_ack.result);//广播指令反馈
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user