升级小板添加结果返回,升级脚本可以修改波特率

This commit is contained in:
ranchuan
2023-08-18 18:53:09 +08:00
parent 337b970b93
commit 8d779a68f3
9 changed files with 116 additions and 31 deletions

View File

@@ -281,7 +281,7 @@ void protu_send_call(protu_def *p,uint8_t cmd,array_def *data)
if(cmd!=0){
p->cmd=cmd;
// 上报数据不增加流水号 2023.7.14
p->cmd_no++;
//p->cmd_no++;
if(p->codec)
t=p->codec->encode(p,data);
}else if(p->cmd==0)

View File

@@ -199,6 +199,8 @@ static ucport_def *write_uid(tran_def *t, uint8_t cmd,array_def *data)
port_start(mcu,code_creat(8,4,u->item[i].uid_pw_hex));
}else{
// 管壳码无效,不注码,此时默认已ack
// 管壳码无效不视为失败
ret=0;
write_uid_fillret(u,i+1,0xff);
}
}
@@ -210,14 +212,14 @@ static ucport_def *write_uid(tran_def *t, uint8_t cmd,array_def *data)
array_def *a=arr_creat();
arr_append(a,u->addrs_num);
if(g_self.step==1){
// if(g_self.step==1){
if(ret==0)
arr_append(a,TRAN_ERR_NONE);
else
arr_append(a,TRAN_ERR_PARAM);
}else{
arr_append(a,TRAN_ERR_STEP);
}
// }else{
// arr_append(a,TRAN_ERR_STEP);
// }
emit tran_reply_signal(u->u.p,arr_temp(a));
// test:稍后返回成功