From e07de45f59895cc5ee0f21a4fe918f2ba06aaa1f Mon Sep 17 00:00:00 2001 From: "XI.CHEN" <2311041011@qq.com> Date: Wed, 25 Dec 2024 17:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=94=E8=B1=A1=E9=87=87=E9=9B=86=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index e6f7965d..1c1bbf01 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -4076,7 +4076,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s break; } else if (sensorParam[num].SensorsType == WIND_PROTOCOL && sensorParam[num].IsNoInsta == 1) { - GetWeatherData(&airt, 2); + GetWindSpeedData(&airt); if (airt.AiState == 255 || airt.AiState == -1) { weatherInfo->avg_windspeed_10min = 0xff; @@ -4119,7 +4119,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s } } - GetWeatherData(&airt, 3); + GetWindDirectionData(&airt); if (airt.AiState == 255 || airt.AiState == -1) { weatherInfo->avg_winddirection_10min = 0xff; @@ -4144,7 +4144,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s } } - GetWeatherData(&airt, 4); + GetRainfallData(&airt); weatherInfo->precipitation = airt.EuValue; if(airt.AiState == 255 || airt.AiState == -1) { @@ -4163,7 +4163,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s weatherInfo->precipitation = weatherInfo->precipitation + sensorParam[num].offset; } - GetWeatherData(&airt, 5); + GetAtmosData(&airt); weatherInfo->air_pressure = airt.EuValue; if(airt.AiState == 255 || airt.AiState == -1) { @@ -4181,7 +4181,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s weatherInfo->air_pressure = weatherInfo->air_pressure + sensorParam[num].offset; } - GetWeatherData(&airt, 6); + GetOpticalRadiationData(&airt); weatherInfo->radiation_intensity = airt.EuValue; if(airt.AiState == 255 || airt.AiState == -1) { @@ -4202,6 +4202,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s } } + for (int num = 0; num < MAX_SERIAL_DEV_NUM; num++) { if (sensorParam[num].SensorsType == WEATHER_PROTOCOL && sensorParam[num].IsNoInsta == 0) { @@ -4213,7 +4214,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s } else if (sensorParam[num].SensorsType == WEATHER_PROTOCOL && sensorParam[num].IsNoInsta == 1) { - GetWeatherData(&airt, 0); + GetAirTempData(&airt); if (airt.AiState == 255 || airt.AiState == -1) { weatherInfo->air_temperature = 0xff; @@ -4243,7 +4244,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s } } - GetWeatherData(&airt, 1); + GetHumidityData(&airt); if (airt.AiState == 255 || airt.AiState == -1) { weatherInfo->humidity = 0xff;