自研批检仪检测命令测试成功
广播方式升级从机发现卡死现象
This commit is contained in:
@@ -45,19 +45,26 @@ void prot_m4::send_data_slot(myarray data)
|
||||
bool prot_m4::exe_cb_fun(myarray data)
|
||||
{
|
||||
int left;
|
||||
QList<HandleM4_def> cb_funs;
|
||||
for (int i = 0; i < funs.size(); i++)
|
||||
{
|
||||
cb_funs.append(this->funs[i]);
|
||||
}
|
||||
for (int i = 0; i < cb_funs.size(); i++)
|
||||
{
|
||||
// 这里size包含结尾符,要去掉
|
||||
left = funs[i].cmd.size()-1;
|
||||
if (data.left(left) == funs[i].cmd)
|
||||
left = qstrlen(cb_funs[i].cmd.data());
|
||||
// qDebug()<<"cmp m4 str:"<<data.left(left)<<cb_funs[i].cmd;
|
||||
// if (data.left(left) == funs[i].cmd)
|
||||
if (qstrncmp(data.data(),cb_funs[i].cmd.data(),left)==0)
|
||||
{
|
||||
for(int j=0;j<funs[i].funs.size();j++){
|
||||
prot_m4_cb fun=funs[i].funs[j];
|
||||
for(int j=0;j<cb_funs[i].funs.size();j++){
|
||||
prot_m4_cb fun=cb_funs[i].funs[j];
|
||||
if(fun!=nullptr){
|
||||
fun(data.mid(left));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user