log可以单独设置打印ip
This commit is contained in:
@@ -91,6 +91,20 @@ static ucport_def *check(tran_def *t, uint8_t cmd,array_def *data)
|
||||
return (ucport_def *)u;
|
||||
}
|
||||
|
||||
transmit_export(ym_checker,0x30,check)
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
自检 和 参数设置 命令是批检仪和赋码仪都有的命令
|
||||
应赋码仪上位机的要求,赋码仪多了一个 "通道" 的数据位
|
||||
目前使用判断的方式,设备为赋码仪方式工作时命令的发送的返回都解析这个 "通道"
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -125,7 +139,7 @@ typedef struct{
|
||||
|
||||
|
||||
|
||||
// 检测完成
|
||||
// 自检完成
|
||||
static void bootinfo_end(ucport_def *u,port_mcu *src,void *data,int ack,char *err_str)
|
||||
{
|
||||
bootinfo_def *w=(bootinfo_def *)u;
|
||||
@@ -143,6 +157,11 @@ static void bootinfo_end(ucport_def *u,port_mcu *src,void *data,int ack,char *er
|
||||
if(w->ack_num>=w->slave_num)
|
||||
{
|
||||
array_def *a=arr_creat();
|
||||
if(strcmp(sys_param()->device_type,"coder")==0)
|
||||
{
|
||||
// 赋码仪添加通道数
|
||||
arr_append(a,w->slave_num);
|
||||
}
|
||||
arr_append(a,0);
|
||||
arr_appends(a,w->ack,w->ack_size);
|
||||
emit tran_send_signal(w->u.p,w->end_cmd,arr_temp(a));
|
||||
@@ -213,6 +232,11 @@ static ucport_def *bootinfo_self(tran_def *t, int slave_num,uint8_t cmd,array_de
|
||||
}
|
||||
|
||||
array_def *a=arr_creat();
|
||||
if(strcmp(sys_param()->device_type,"coder")==0)
|
||||
{
|
||||
// 赋码仪添加通道数
|
||||
arr_append(a,10);
|
||||
}
|
||||
arr_append(a,0);
|
||||
emit tran_reply_signal(u->u.p,arr_temp(a));
|
||||
|
||||
@@ -242,7 +266,6 @@ static ucport_def *bootinfo_checker(tran_def *t,uint8_t cmd,array_def *data)
|
||||
|
||||
|
||||
|
||||
transmit_export(ym_checker,0x30,check)
|
||||
transmit_export(ym_checker,0x34,bootinfo_checker)
|
||||
transmit_export(ym_checker,0x04,bootinfo_coder)
|
||||
|
||||
@@ -321,23 +344,40 @@ static ucport_def *param(tran_def *t, uint8_t cmd,array_def *data)
|
||||
DBG_WARN("cmd format err.");
|
||||
return 0;
|
||||
}
|
||||
int off=0;
|
||||
param_def *u=calloc(1,sizeof(param_def));
|
||||
u->u.p=t;
|
||||
u->u.del=param_del;
|
||||
if(strcmp(sys_param()->device_type,"coder")==0)
|
||||
{
|
||||
// 赋码仪要忽略通道数参数
|
||||
off=1;
|
||||
}
|
||||
|
||||
|
||||
uint8_t op=arr_get(data,0);
|
||||
uint8_t op=arr_get(data,off);
|
||||
// 1是写,0是读
|
||||
if(op==0)
|
||||
{
|
||||
paraminfo_fill(&u->par);
|
||||
uint8_t *d=(uint8_t *)(&u->par);
|
||||
array_def *a=arr_creat();
|
||||
if(strcmp(sys_param()->device_type,"coder")==0)
|
||||
{
|
||||
// 赋码仪添加通道数
|
||||
arr_append(a,10);
|
||||
}
|
||||
arr_append(a,0);
|
||||
arr_appends(a,d,sizeof(paraminfo_def));
|
||||
emit tran_reply_signal(u->u.p,arr_temp(a));
|
||||
}else if(op==1)
|
||||
{
|
||||
array_def *a=arr_creat();
|
||||
if(strcmp(sys_param()->device_type,"coder")==0)
|
||||
{
|
||||
// 赋码仪添加通道数
|
||||
arr_append(a,10);
|
||||
}
|
||||
if(arr_length(data)<1+sizeof(paraminfo_def)){
|
||||
arr_append(a,1);
|
||||
emit tran_reply_signal(u->u.p,arr_temp(a));
|
||||
|
Reference in New Issue
Block a user