error
authorCCC <2393524978@qq.com>
Mon, 17 Apr 2023 09:58:35 +0000 (17:58 +0800)
committerCCC <2393524978@qq.com>
Mon, 17 Apr 2023 09:58:35 +0000 (17:58 +0800)
2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c
2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h
2.sdk/gui/lv_watch/mmi_location/mmi_location.c

index 141b1e2..c59ba7e 100644 (file)
@@ -146,6 +146,10 @@ bool mmi_health_measure_blood_data_process(uint16_t * blood_high_value, uint16_t
        t_high_value = 120 + rand() % 100;
        t_low_value = 60 + rand() % 50;
 
+#else
+       mmi_hsensor_blood_value_get(&t_high_value, &t_low_value);
+#endif
+
        if(180 < t_high_value)
                t_high_value = 180;
        else if(120 > t_high_value)
@@ -155,11 +159,7 @@ bool mmi_health_measure_blood_data_process(uint16_t * blood_high_value, uint16_t
                t_low_value = 120;
        else if(60 > t_low_value)
                t_low_value = 60;
-
-#else
-       mmi_hsensor_blood_value_get(&t_high_value, &t_low_value);
-#endif
-
+       
        * blood_high_value = t_high_value;
        * blood_low_value = t_low_value;
        
@@ -173,15 +173,16 @@ bool mmi_health_measure_spo2_data_process(uint16_t * spo2_value)
 #ifdef __HEALTH_MEASURE_FAKE_DATA__
        srand(Hal_Timer_Get_Counter());
        t_value = 95 + rand() % 6;
-       if(100 < t_value)
-               t_value = 100;
-       else if(95 > t_value)
-               t_value = 95;
 
 #else
        mmi_hsensor_spo2_value_get(&t_value);
 #endif
 
+       if(100 < t_value)
+               t_value = 100;
+       else if(95 > t_value)
+               t_value = 95;
+
        * spo2_value = t_value;
 
        return true;
index 47fc56d..5893826 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
 #define HEALTH_MEASURE_DEBUG_PRINTF(fmt, ...)
 #endif
 
-#define __HEALTH_MEASURE_FAKE_DATA__
+//#define __HEALTH_MEASURE_FAKE_DATA__
 
 
 #define MMI_HEALTH_MEASURE_HEART_DURATION      (44 * 1000) // ms
index 5380241..ca30654 100644 (file)
@@ -6,9 +6,10 @@
 #ifdef __MMI_ZHSX_SUPPORT__
 
 #if USE_GPS
-#include "../../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h"
+//#include "../../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h"
+#include "../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h"
 #endif
-#include "../../modem/mmi_modem_tcp/wifi_scan_task.h"
+#include "../modem/mmi_modem_tcp/wifi_scan_task.h"
 
 
 static uint8_t s_watch_location_state = 0; // 0-init; 1-locating
@@ -192,6 +193,30 @@ void mmi_watch_location_wifi_stop(void)
        wifi_scan_destroy();
 }
 
+static uint8_t HexStr2Int(char *str_hex, uint8_t str_hex_len)
+{
+       uint8_t int_value = 0;
+       uint8_t i = 0, t_value = 0;
+       char t_char = 0;
+       
+       if(NULL == str_hex || 0 == str_hex_len)
+               return 0;
+       
+       for(i = 0; i < str_hex_len; i++)
+       {
+               t_char = str_hex[i];
+               if('a' <= t_char && 'z' >= t_char)
+               {
+                       t_char = t_char - 'a' + 'A';
+               }
+
+               t_value = ('A' <= t_char) ? (t_char - 'A' + 10) : (t_char - '0');
+               int_value = int_value * 16 + t_value;
+       }
+
+       return int_value;
+}
+
 void mmi_watch_location_wifi_scan_cb(WIFI_SCAN_ID_DEF msgid, WifiInfoT *wifi_info)
 {
        //if(WIFI_SCAN_MSG_COMPLETE == msgid)
@@ -204,7 +229,13 @@ void mmi_watch_location_wifi_scan_cb(WIFI_SCAN_ID_DEF msgid, WifiInfoT *wifi_inf
                uint8_t i = 0;
                for(i = 0; i < s_watch_location_data.wifi_data.count; i++)
                {
-                       _lv_memcpy(&(s_watch_location_data.wifi_data.item[i]), wifi_info->WifiHotspot[i], sizeof(app_adp_wifi_ap_item));
+                       s_watch_location_data.wifi_data.item[i].rssi = wifi_info->WifiHotspot[i].Rssi;
+
+                       uint8_t j = 0;
+                       for(j = 0; j < APP_ADP_WIFI_MAC_LEN; j++)
+                       {
+                               s_watch_location_data.wifi_data.item[i].mac[j] = HexStr2Int(wifi_info->WifiHotspot[i].MacAddr[j * 2], 2);
+                       }
                }
        }
        else