This commit is contained in:
hm
2020-03-22 22:40:26 +08:00
parent db54c9ffb4
commit 5db211d510
6 changed files with 418 additions and 229 deletions
+4 -2
View File
@@ -109,13 +109,15 @@ void ParameterProcess::WriteCmd(uint8_t m_sysid, uint8_t m_compid ,uint32_t coun
//这个函数类似中断,专门处理接收到的状态
void ParameterProcess::ParameterParse(mavlink_message_t msg)
{
switch (msg.msgid) {
case MAVLINK_MSG_ID_PARAM_SET:{
mavlink_msg_param_set_decode(&msg,&param_set);
}break;
case MAVLINK_MSG_ID_PARAM_VALUE:{//
mavlink_msg_param_value_decode(&msg,&param_value);
paramInspect->appendParameter(param_value);
paramInspect->appendParameter(msg);//发送的时候需要连同当前的sysid 和 compid也发送下去
status.recieve.isWaitingforValue = false;
status.transmit.isWaitingforValue = false;
qDebug() << "param_value.param_index" << param_value.param_index;
@@ -211,7 +213,7 @@ void ParameterProcess::ReadStateMachine(void)//一整列
}
else if(step == 2)//传输结束
{
qDebug() << "step" << step << "recieve ok";
qDebug() << "step" << step << "recieve complete";
step = 0;
status.m_Mode = Nop_Mode;//切换到什么都不做
timeout_count = 0;