Code cleaning
FossilOrigin-Name: 9855c5a5bb0879a82074400d3910f58b1ee7316c79d35b7ece72c275cb943ec1
This commit is contained in:
parent
a544c22e18
commit
0d97ee19cb
@ -34,6 +34,7 @@ int wtpinfo_lwreadelem_wtp_descriptor(struct wtpinfo * wtpinfo, int type, uint8_
|
||||
/* if (len!=16)
|
||||
return -1;
|
||||
*/
|
||||
|
||||
char str[64];
|
||||
uint32_t hwversion=ntohl(*((uint32_t*)(msgelem)));
|
||||
sprintf(str,"%08X",hwversion);
|
||||
@ -53,58 +54,6 @@ int wtpinfo_lwreadelem_wtp_descriptor(struct wtpinfo * wtpinfo, int type, uint8_
|
||||
wtpinfo->radios_in_use = (l>>16) & 0xff;
|
||||
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
|
||||
/*
|
||||
wtpinfo->max_radios=*msgelem;
|
||||
wtpinfo->radios_in_use=*(msgelem+1);
|
||||
|
||||
int ncrypt = *(msgelem+2);
|
||||
|
||||
int i=ncrypt*3+3;
|
||||
|
||||
do {
|
||||
if (i+8>=len)
|
||||
return -1;
|
||||
|
||||
uint32_t vendor_id=ntohl(*((uint32_t*)(msgelem+i)));
|
||||
|
||||
uint32_t val = ntohl(*((uint32_t*)(msgelem+i+4)));
|
||||
int subtype= (val>>16)&0xffff;
|
||||
int sublen = val&0xffff;
|
||||
i+=8;
|
||||
|
||||
if (sublen+i>len){
|
||||
//printf("Wrong sublen ba %d\n",sublen);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
switch(subtype){
|
||||
case CWMSGSUBELEM_WTP_DESCRIPTOR_HARDWARE_VERSION:
|
||||
wtpinfo->hardware_vendor_id=vendor_id;
|
||||
cw_setstr(&wtpinfo->hardware_version,msgelem+i,sublen);
|
||||
break;
|
||||
case CWMSGSUBELEM_WTP_DESCRIPTOR_SOFTWARE_VERSION:
|
||||
wtpinfo->software_vendor_id=vendor_id;
|
||||
cw_setstr(&wtpinfo->software_version,msgelem+i,sublen);
|
||||
break;
|
||||
case CWMSGSUBELEM_WTP_DESCRIPTOR_BOOTLOADER_VERSION:
|
||||
wtpinfo->bootloader_vendor_id=vendor_id;
|
||||
cw_setstr(&wtpinfo->bootloader_version,msgelem+i,sublen);
|
||||
break;
|
||||
default:
|
||||
//printf("unknown !!!\n");
|
||||
break;
|
||||
}
|
||||
i+=sublen;
|
||||
|
||||
}while(i<len);
|
||||
|
||||
return 1;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user