📄 portdirection.c
字号:
location += 4;
flag = -1;
}
}
break;
case 0x0005:// 设备生产序列号 str型
{
st = CheckDataTypes( 0 , 0 , 6 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].DeviceSerialNo[0] = *(ptr + 3 + location);//生产序列号
Querydata2G[ctype].DeviceSerialNo[1] = *(ptr + 4 + location);
Querydata2G[ctype].DeviceSerialNo[2] = *(ptr + 5 + location);
}
else//FDD
{
Querydata3G.DeviceSerialNo[0] = *(ptr + 3 + location);//生产序列号
Querydata3G.DeviceSerialNo[1] = *(ptr + 4 + location);
Querydata3G.DeviceSerialNo[2] = *(ptr + 5 + location);
}
location += 6;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 6;
flag = -1;
}
else if( st == -2 )//非法长度
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += *(ptr + location);
flag = -1;
}
}
break;
case 0x0403:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].UpAtt = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.UpAtt = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0406:// 设备型号
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
SysGain = *(ptr + 3 + location);
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0401:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Syncdata2G[ctype].RFSignalSwitch = *(ptr + 3 + location);
}
else//FDD
{
Syncdata3G.RFSignalSwitch = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0404:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].DownAtt = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.DownAtt = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
case 0x0408:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].DownOutputOverPowerMax = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.DownOutputOverPowerMax = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0409:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].DownOutputLessPowerMax = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.DownOutputLessPowerMax = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x042D:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
//Querydata2G[ctype].NO2ChangePoint = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.NO2ChangePoint = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0202:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].DownOutputOverPowerAlarmEn = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.DownOutputOverPowerAlarmEn = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0203:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].DownOutputLessPowerAlarmEn = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.DownOutputLessPowerAlarmEn = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0204:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
Querydata2G[ctype].DownVSWRAlarmEn = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.DownVSWRAlarmEn = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
case 0x0226:
{
st = CheckDataTypes( 0 , 0 , 3 , (ptr + location));
if( st == 0 )//正确数据
{
if(ctype != 0x06)//TDD
{
//Querydata2G[ctype].AsynchronismAlarmEn = *(ptr + 3 + location);
}
else//FDD
{
Querydata3G.AsynchronismAlarmEn = *(ptr + 3 + location);
}
location += 4;
}
else if( st == -1 )//非法数据
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x30;
location += 4;
flag = -1;
}
else if( st == -2 )//非法长度(做不到)
{
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x40;
location += 4;
flag = -1;
}
}
break;
default:
*(ptr + 2 + location) = (*(ptr + 2 + location)) & 0x0F | 0x10; //数据标识高字节(监控数据标识无法识别)
location += *(ptr + 0 + location);
flag = -1;
break;
}
}
return flag;
}
/********************************************************************************
** 函数名称: WfdsMUSetEUCmdUpack
** 功能描述: WFDS扩展单元处
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -