优化蓝牙产测LCD测试,TP测试 430/1 430/head
authorpenglei <1624952103@qq.com>
Tue, 2 Jul 2024 10:23:28 +0000 (18:23 +0800)
committerpenglei <1624952103@qq.com>
Tue, 2 Jul 2024 10:23:28 +0000 (18:23 +0800)
16 files changed:
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCDC.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenterC.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTPC.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp
code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenterC.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp
code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c
code/sdk/drivers/peripheral/cywee/src/main_dml.c
code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c
code/sdk/drivers/peripheral/ppg/hx3695/hx3695.h
code/sdk/drivers/peripheral/utils/custom_utils.c
code/sdk/drivers/peripheral/utils/custom_utils.h

index 6d8ccfb..79114e1 100644 (file)
@@ -24,6 +24,7 @@ namespace OHOS
         UIScrollView *testLCDInitIView(void);
         void ClearAll(void);
         void set_LCD_color(int);
+        void LCDHideNextButton(void);
     private:
         bool testLCDScrollViewcrollViewinit(void);
         UIScrollView *testLCDScrollView{nullptr};
index 1436688..5f3a1d5 100644 (file)
@@ -2,8 +2,8 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-06-07 11:18:25
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-06-08 17:28:26
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophoneC.h
+ * @LastEditTime: 2024-07-02 18:04:42
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCDC.h
  * @Description: 
  * 
  * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
@@ -17,7 +17,8 @@ extern "C"
 {
 #endif
 #endif
-    void ble_factorytest_set_LCD_color(int color);
+    void factorytest_set_LCD_color(int color);
+    void factorytest_hide_test_lcd_button(void);
     
 #ifdef __cplusplus
 #if __cplusplus
diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenterC.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenterC.h
new file mode 100644 (file)
index 0000000..a68360d
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * @Author: penglei 1624952103@qq.com
+ * @Date: 2024-06-07 11:18:25
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-07-02 18:04:51
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenterC.h
+ * @Description: 
+ * 
+ * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
+ */
+#ifndef TEST_PRESENTER_H
+#define TEST_PRESENTER_H
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C"
+{
+#endif
+#endif
+    void factorytest_enter_test_tp_view(void);
+    void factorytest_enter_test_lcd_view(void);
+    
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+#endif
index dd71274..ea7d1c4 100644 (file)
@@ -35,6 +35,7 @@ namespace OHOS
 
         UIScrollView *testTPInitIView(void);
         void ClearAll(void);
+        void TPHideNextButton(void);
     private:
         UIButton *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig, UIView::OnTouchListener *clickListener);
         bool testTPScrollViewcrollViewinit(void);
diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTPC.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTPC.h
new file mode 100644 (file)
index 0000000..f043693
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * @Author: penglei 1624952103@qq.com
+ * @Date: 2024-06-07 11:18:25
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-07-02 18:05:11
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTPC.h
+ * @Description: 
+ * 
+ * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
+ */
+#ifndef TEST_TP_H
+#define TEST_TP_H
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C"
+{
+#endif
+#endif
+
+    void factorytest_hide_test_tp_button(void);
+    
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+#endif
index ea29e3b..753eced 100644 (file)
@@ -77,7 +77,7 @@ namespace OHOS
        }
     }
      uint8_t LCD_TEST_FALG=0;
-    void  colorTimerCallBack(int data)
+    void colorTimerCallBack(int data)
     {
         testLCDView* t= testLCDView::GetInstance();
         if(t!=NULL)
@@ -185,6 +185,12 @@ namespace OHOS
         return testLCDScrollView;
     }
 
+    void testLCDView::LCDHideNextButton(void)
+    {
+        labelButton_next->SetVisible(false);
+        testLCDScrollView->Remove(Title);
+    }
+
 #ifdef __cplusplus
 #if __cplusplus
 extern "C"
@@ -192,7 +198,7 @@ extern "C"
 #endif /* __cplusplus */
 #endif /* __cplusplus */
 
-    void ble_factorytest_set_LCD_color(int color)
+    void factorytest_set_LCD_color(int color)
     {
         testLCDView* t= testLCDView::GetInstance();
 
@@ -200,6 +206,11 @@ extern "C"
             t->set_LCD_color(color);
     }
 
+    void factorytest_hide_test_lcd_button(void)
+    {
+        testLCDView::GetInstance()->LCDHideNextButton();
+        osTimerStop(MG_TEST_timer);
+    }
 
 #ifdef __cplusplus
 #if __cplusplus
index 109707d..561fb71 100644 (file)
@@ -358,5 +358,27 @@ namespace OHOS
     //language *g_planguage = new language;\r
     /* -------------------------------------------------------------------------- */\r
     // 用来监听语言切换\r
-    \r
+\r
+#ifdef __cplusplus\r
+#if __cplusplus\r
+extern "C"\r
+{\r
+#endif /* __cplusplus */\r
+#endif /* __cplusplus */\r
+\r
+    void factorytest_enter_test_tp_view(void)\r
+    {\r
+        testView::GetInstance()->ChangeView(TESTVIEW,TP);\r
+    }\r
+\r
+    void factorytest_enter_test_lcd_view(void)\r
+    {\r
+        testView::GetInstance()->ChangeView(TESTVIEW,LCD);\r
+    }\r
+\r
+#ifdef __cplusplus\r
+#if __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+#endif /* __cplusplus */\r
 }
\ No newline at end of file
index f3beb20..5c57c07 100644 (file)
@@ -203,4 +203,29 @@ namespace OHOS
         }
         return testTPScrollView;
     }
+
+    void testTPView::TPHideNextButton(void)
+    {
+        labelButton_next->SetVisible(false);
+        testTPScrollView->Remove(Title);
+    }
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+#endif /* __cplusplus */
+
+    void factorytest_hide_test_tp_button(void)
+    {
+        testTPView::GetInstance()->TPHideNextButton();
+    }
+
+
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __cplusplus */
 }
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenterC.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenterC.h
new file mode 100644 (file)
index 0000000..d48a446
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * @Author: penglei 1624952103@qq.com
+ * @Date: 2024-06-07 11:18:25
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-07-02 11:07:00
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenterC.h
+ * @Description: 
+ * 
+ * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
+ */
+#ifndef SYSTEM_PRESENTER_H
+#define SYSTEM_PRESENTER_H
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C"
+{
+#endif
+#endif
+    void factorytest_enter_test_view(int cmd);
+    
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+#endif
index 88991f0..f792657 100644 (file)
@@ -225,4 +225,25 @@ namespace OHOS
     // {\r
     //     isSystemUpgradeState = falg;\r
     // }\r
+#ifdef __cplusplus\r
+#if __cplusplus\r
+extern "C"\r
+{\r
+#endif /* __cplusplus */\r
+#endif /* __cplusplus */\r
+\r
+    void factorytest_enter_test_view(int cmd)\r
+    {\r
+        if(cmd == 1)\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_TEST);\r
+        else\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);\r
+    }\r
+\r
+\r
+#ifdef __cplusplus\r
+#if __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+#endif /* __cplusplus */\r
 }
\ No newline at end of file
index 56a1675..1cd748d 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com\r
  * @Date: 2024-06-17 14:31:08\r
  * @LastEditors: penglei 1624952103@qq.com\r
- * @LastEditTime: 2024-06-22 15:27:12\r
+ * @LastEditTime: 2024-07-02 17:31:37\r
  * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c\r
  * @Description: \r
  * \r
@@ -934,8 +934,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
             {\r
                 //LCD显示颜色\r
                 uint8_t send_data = 0x00;\r
-                //char *color_buf[5] ={"0Xffff0000","0xff00ff00","0xff0000ff","0xffffffff","0xff000000"};\r
-                //ScreenAlwaysOnCtr(1);\r
+\r
                 switch (*data)\r
                 {\r
                     case 1:\r
@@ -975,6 +974,33 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                         0x05,\r
                         &send_data,\r
                         1);\r
+            } else if(testitem == 0x06)\r
+            {\r
+                //进入lcd测试\r
+                uint8_t send_data = 0;\r
+\r
+                mcu_pm_lcd_on(0,0);\r
+                uapi_factorytest_enter_test_view(1);\r
+                uapi_factorytest_enter_test_lcd_view();\r
+                uapi_factorytest_hide_test_lcd_button();\r
+\r
+                factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
+                        BLE_TEST_CMD_SOFT_TEST_SUB_MODE_LCD,\r
+                        0x06,\r
+                        &send_data,\r
+                        1);\r
+            } else if(testitem == 0x07)\r
+            {\r
+                //退出lcd测试\r
+                uint8_t send_data = 0;\r
+\r
+                uapi_factorytest_enter_test_view(0);\r
+\r
+                factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
+                        BLE_TEST_CMD_SOFT_TEST_SUB_MODE_LCD,\r
+                        0x07,\r
+                        &send_data,\r
+                        1);\r
             }\r
 \r
             break;\r
@@ -1013,18 +1039,28 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
             } else if(testitem == 0x03)\r
             {\r
                 //触摸测试\r
-                uint8_t send_data = 0x01;\r
-\r
+                uint8_t send_data = 0;\r
+                mcu_pm_lcd_on(0,0);\r
+                uapi_factorytest_enter_test_view(1);\r
+                uapi_factorytest_enter_test_tp_view();\r
+                uapi_factorytest_hide_test_tp_button();\r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TP,\r
                         0x03,\r
                         &send_data,\r
                         1);\r
 \r
-                send_data = 0x00;\r
+                \r
+            } else if(testitem == 0x04)\r
+            {\r
+                //退出触摸测试\r
+                uint8_t send_data = 0;\r
+\r
+                uapi_factorytest_enter_test_view(0);\r
+\r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TP,\r
-                        0x03,\r
+                        0x04,\r
                         &send_data,\r
                         1);\r
 \r
@@ -1112,15 +1148,15 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
         case BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS:\r
             if(testitem == 0x01)\r
             {\r
-                //获取 hx3695 chip_id\r
-                uint8_t chip_id;\r
-                chip_id = hx3695_get_chip_id();\r
+                //获取 ppg_id\r
+                uint8_t ppg_id;\r
+                uapi_ppg_get_id(&ppg_id);\r
 \r
                 factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
                         BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS,\r
                         0x01,\r
-                        &chip_id,\r
-                        sizeof(chip_id));\r
+                        &ppg_id,\r
+                        sizeof(ppg_id));\r
 \r
             } else if(testitem == 0x02)\r
             {\r
index ec5cb5c..3bab5bf 100644 (file)
@@ -256,7 +256,7 @@ void cywee_time_sync(void)
     struct tm* timeinfo;
     time(&rawtime);
     timeinfo = localtime(&rawtime);
-    CWM_OS_dbgPrintf("cywee_time_sync : year[%d], mon[%d], day[%d], hour[%d], min[%d], msc[%d] \r\n",
+    CWM_OS_dbgPrintf("cywee_time_sync : year[%d], mon[%d], day[%d], hour[%d], min[%d], sec[%d] \r\n",
     timeinfo->tm_year+1900,timeinfo->tm_mon+1,timeinfo->tm_mday,
     timeinfo->tm_hour,timeinfo->tm_min,timeinfo->tm_sec);
 
index da23b20..6fbff27 100644 (file)
@@ -381,24 +381,6 @@ bool hx3695_chip_check(void)
     return false;\r
 }\r
 \r
-uint8_t hx3695_get_chip_id(void)\r
-{\r
-    uint8_t i = 0;\r
-    uint8_t chip_id = 0;\r
-    for(i=0; i<5; i++)\r
-    {\r
-        hx3695_ppg_on();\r
-        chip_id = hx3695_read_reg(0x00);\r
-\r
-        if (chip_id == 0x65)\r
-        {\r
-            return chip_id;\r
-        }\r
-    }\r
-\r
-    return chip_id;\r
-}\r
-\r
 uint8_t hx3695_read_fifo_size(void)\r
 {\r
           uint8_t  data_len_h,data_len_l;\r
index 326b399..8eb2b29 100644 (file)
@@ -297,9 +297,6 @@ void heart_rate_meas_timeout_handler(void * p_context);
 void wear_mode_timeout_handler(void * p_context);\r
 void Efuse_Mode_Check(void);\r
 \r
-uint8_t hx3695_get_chip_id(void);\r
-\r
-\r
 #include "hx3695_hal.h"\r
 \r
 #endif\r
index 9c47d8d..bb4f971 100644 (file)
@@ -29,6 +29,9 @@
 #include "networkandcall/include/NetworkAndCallC.h"
 #include "producttest/include/testmicrophoneC.h"
 #include "producttest/include/testLCDC.h"
+#include "producttest/include/testTPC.h"
+#include "system/include/SystemPresenterC.h"
+#include "producttest/include/testPresenterC.h"
 #endif
 #include <dirent.h>
 #include <unistd.h>
@@ -2238,7 +2241,42 @@ void uapi_check_spk(bool isopen)
 void uapi_factorytest_set_lcd_color(int color)
 {
     #ifdef FD230
-        ble_factorytest_set_LCD_color(color);
+        factorytest_set_LCD_color(color);
+    #endif
+}
+
+void uapi_factorytest_enter_test_view(int cmd)
+{
+    #ifdef FD230
+        factorytest_enter_test_view(cmd);
+    #endif
+}
+
+void uapi_factorytest_enter_test_tp_view(void)
+{
+    #ifdef FD230
+        factorytest_enter_test_tp_view();
+    #endif
+}
+
+void uapi_factorytest_enter_test_lcd_view(void)
+{
+    #ifdef FD230
+        factorytest_enter_test_lcd_view();
+    #endif
+}
+
+void uapi_factorytest_hide_test_lcd_button(void)
+{
+    #ifdef FD230
+        factorytest_hide_test_lcd_button();
+    #endif
+}
+
+void uapi_factorytest_hide_test_tp_button(void)
+{
+    #ifdef FD230
+        factorytest_hide_test_tp_button();
     #endif
 }
 
@@ -2287,14 +2325,15 @@ errcode_t custom_i2c_test(void)
     uapi_ppg_get_id(&ppg_id);
     if(ppg_id != 0x65)
         return ERRCODE_FAIL;
-    
+    PRINT("ppg_id[%x] \n",ppg_id);
     mmc5603_getid(&mmc_id);
     if(mmc_id != 0X10)
         return ERRCODE_FAIL;
-
+    PRINT("mmc_id[%x] \n",mmc_id);
     uapi_cywee_get_id(&cywee_id);
     if(cywee_id != 0X44)
         return ERRCODE_FAIL;
+    PRINT("cywee_id[%x] \n",cywee_id);
 
     return ERRCODE_SUCC;
-}
\ No newline at end of file
+}
index b6a9047..db0be4b 100644 (file)
@@ -203,6 +203,11 @@ void uapi_ppg_get_id(uint8_t *chip_id);
 void uapi_microhone_switch(bool isopen);
 void uapi_check_spk(bool isopen);
 void uapi_factorytest_set_lcd_color(int color);
+void uapi_factorytest_enter_test_view(int cmd);
+void uapi_factorytest_enter_test_tp_view(void);
+void uapi_factorytest_enter_test_lcd_view(void);
+void uapi_factorytest_hide_test_lcd_button(void);
+void uapi_factorytest_hide_test_tp_button(void);
 void uapi_efuse_test_write(uint8_t *data,uint32_t byte_number,uint8_t len);
 void uapi_efuse_test_read(uint32_t byte_number,uint8_t len);