添加严格区分温湿度和风速风向及多要素气象传感器

PtzNew
jxjajs 3 months ago
parent 6d84ed0ab7
commit 3453e2d221

@ -2675,6 +2675,8 @@ void ShxyProtocolDataProcess(int devno)
switch (curserial->m_au8RecvBuf[j])
{
case 1: /*温度*/
if(devparam[devno].ProtocolIdx == WIND_PROTOCOL)
break;
if ((fvalue < -60) || (fvalue > 100))
{
frnb = (GeneratingRandomNumber() % 101 - 50) / 1000.0;
@ -2697,6 +2699,8 @@ void ShxyProtocolDataProcess(int devno)
}
break;
case 2: /*气压*/
if(devparam[devno].ProtocolIdx == WIND_PROTOCOL)
break;
if ((fvalue < 550) || (fvalue > 1060))
{
frnb = (GeneratingRandomNumber() % 41 - 20) / 10000.0;
@ -2718,6 +2722,8 @@ void ShxyProtocolDataProcess(int devno)
}
break;
case 3: /*湿度*/
if(devparam[devno].ProtocolIdx == WIND_PROTOCOL)
break;
if ((fvalue < 0) || (fvalue > 100))
{
frnb = (GeneratingRandomNumber() % 41 - 20) / 1000.0;

Loading…
Cancel
Save