广播命令时静默
This commit is contained in:
@@ -77,6 +77,7 @@ array_def *protu_decode(protu_def *p,array_def *data)
|
||||
// }
|
||||
p->cmd_no=cmd_no;
|
||||
p->cmd=arr_get(data,4);
|
||||
p->silent=0;
|
||||
// 数据负载
|
||||
arr_delete(r);
|
||||
if(p->is_big_data==0)
|
||||
@@ -158,6 +159,7 @@ array_def *protu_decode2(protu_def *p,array_def *data)
|
||||
}
|
||||
p->cmd_no=arr_get(data,5)|(arr_get(data,6)<<8);
|
||||
p->cmd=arr_get(data,4);
|
||||
p->silent=0;
|
||||
// 数据负载
|
||||
arr_delete(r);
|
||||
if(p->is_big_data==0)
|
||||
@@ -215,7 +217,7 @@ array_def *protm_decode(protu_def *p,array_def *data)
|
||||
}
|
||||
uint8_t src=arr_get(data,4);
|
||||
uint8_t dst=arr_get(data,5);
|
||||
if((src!=0)||(dst!=elec_local_addr())){
|
||||
if((src!=0)||((dst!=elec_local_addr())&&(dst!=0x1f))){
|
||||
DBG_WARN("src_addr/dst_addr not allowed.");
|
||||
DBG_WARN("data=%s",str_temp(arr_string(data)));
|
||||
str_set(p->str_err,"src_addr/dst_addr not allowed.");
|
||||
@@ -245,6 +247,11 @@ array_def *protm_decode(protu_def *p,array_def *data)
|
||||
str_set(p->str_err,"crc check err.");
|
||||
}
|
||||
p->cmd=arr_get(data,6);
|
||||
if(dst==0x1f){
|
||||
p->silent=1;
|
||||
}else{
|
||||
p->silent=0;
|
||||
}
|
||||
arr_delete(r);
|
||||
return arr_mid(data,9,len-10);
|
||||
}
|
||||
|
Reference in New Issue
Block a user