日照降雨量等未配置传255

N938
XI.CHEN 6 months ago
parent 66a4fa7f00
commit e664a5f766

@ -4049,33 +4049,40 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo)
GetWeatherData(&airt, 4);
weatherInfo->precipitation = airt.EuValue;
#if 0
if (airt.AiState != 2 && weatherInfo->precipitation == 0) {
if(airt.AiState == 255 || airt.AiState == -1)
{
weatherInfo->precipitation = 0xff;
XYLOG(XYLOG_SEVERITY_INFO, "采样状态 = %d,降雨量未接传感器", airt.AiState);
}else if (airt.AiState != 2 && weatherInfo->precipitation == 0)
{
XYLOG(XYLOG_SEVERITY_INFO, "采样状态 = %d,降雨量未采集到数据,重新采样",
weatherInfo->precipitation, airt.AiState);
status = 0;
}
#endif
GetWeatherData(&airt, 5);
weatherInfo->air_pressure = airt.EuValue;
#if 0
if (airt.AiState != 2 && weatherInfo->air_pressure == 0) {
if(airt.AiState == 255 || airt.AiState == -1)
{
weatherInfo->air_pressure = 0xff;
XYLOG(XYLOG_SEVERITY_INFO, "采样状态 = %d,气压未接传感器", airt.AiState);
}else if (airt.AiState != 2 && weatherInfo->air_pressure == 0) {
XYLOG(XYLOG_SEVERITY_INFO, "采样状态 = %d,气压未采集到数据,重新采样",
weatherInfo->air_pressure, airt.AiState);
status = 0;
}
#endif
GetWeatherData(&airt, 6);
weatherInfo->radiation_intensity = airt.EuValue;
#if 0
if (airt.AiState != 2 && weatherInfo->radiation_intensity == 0) {
if(airt.AiState == 255 || airt.AiState == -1)
{
weatherInfo->radiation_intensity = 0xff;
XYLOG(XYLOG_SEVERITY_INFO, "采样状态 = %d,光照强度未接传感器", airt.AiState);
}else if (airt.AiState != 2 && weatherInfo->radiation_intensity == 0) {
XYLOG(XYLOG_SEVERITY_INFO, "采样状态 = %d,光照强度未采集到数据,重新采样",
weatherInfo->radiation_intensity, airt.AiState);
status = 0;
}
#endif
if (status)
return true;
else

Loading…
Cancel
Save