From 88ce168ffa6a63814cb4b8ccfa7e32beae352a53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BD=AD=E7=A3=8A?= <1624952103@qq.com> Date: Tue, 2 Jul 2024 10:52:49 +0000 Subject: [PATCH] Merge #430 into sdk602patch0521 from refs/changes/430/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 优化蓝牙产测LCD测试,TP测试 * refs/changes/430/head: (1 commits squashed) - 优化蓝牙产测LCD测试,TP测试 Signed-off-by: aliyun6865282430 <1624952103@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/430 --- .../nativeui/producttest/include/testLCD.h | 1 + .../nativeui/producttest/include/testLCDC.h | 7 ++- .../producttest/include/testPresenterC.h | 28 +++++++++ .../nativeui/producttest/include/testTP.h | 1 + .../nativeui/producttest/include/testTPC.h | 28 +++++++++ .../nativeui/producttest/src/testLCD.cpp | 15 ++++- .../producttest/src/testPresenter.cpp | 24 +++++++- .../nativeui/producttest/src/testTP.cpp | 25 ++++++++ .../system/include/SystemPresenterC.h | 27 +++++++++ .../nativeui/system/src/SystemPresenter.cpp | 21 +++++++ .../factorytest_protocol.c | 60 +++++++++++++++---- .../drivers/peripheral/cywee/src/main_dml.c | 2 +- .../drivers/peripheral/ppg/hx3695/hx3695.c | 18 ------ .../drivers/peripheral/ppg/hx3695/hx3695.h | 3 - .../drivers/peripheral/utils/custom_utils.c | 47 +++++++++++++-- .../drivers/peripheral/utils/custom_utils.h | 5 ++ 16 files changed, 268 insertions(+), 44 deletions(-) create mode 100644 code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenterC.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTPC.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenterC.h diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h index 6d8ccfbdb..79114e1f0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h @@ -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}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCDC.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCDC.h index 1436688dd..5f3a1d52d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCDC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCDC.h @@ -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 index 000000000..a68360d76 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenterC.h @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h index dd71274f0..ea7d1c464 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h @@ -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 index 000000000..f043693dc --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTPC.h @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp index ea29e3b82..753eced0d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp index 109707d6f..561fb714d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -358,5 +358,27 @@ namespace OHOS //language *g_planguage = new language; /* -------------------------------------------------------------------------- */ // 用来监听语言切换 - + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif /* __cplusplus */ +#endif /* __cplusplus */ + + void factorytest_enter_test_tp_view(void) + { + testView::GetInstance()->ChangeView(TESTVIEW,TP); + } + + void factorytest_enter_test_lcd_view(void) + { + testView::GetInstance()->ChangeView(TESTVIEW,LCD); + } + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp index f3beb206f..5c57c070d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp @@ -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 index 000000000..d48a446f0 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenterC.h @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp index 88991f015..f79265764 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp @@ -225,4 +225,25 @@ namespace OHOS // { // isSystemUpgradeState = falg; // } +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif /* __cplusplus */ +#endif /* __cplusplus */ + + void factorytest_enter_test_view(int cmd) + { + if(cmd == 1) + NativeAbility::GetInstance().ChangeSlice(VIEW_TEST); + else + NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN); + } + + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ } \ No newline at end of file diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c index 56a167581..1cd748dfa 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-06-17 14:31:08 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-06-22 15:27:12 + * @LastEditTime: 2024-07-02 17:31:37 * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c * @Description: * @@ -934,8 +934,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint { //LCD显示颜色 uint8_t send_data = 0x00; - //char *color_buf[5] ={"0Xffff0000","0xff00ff00","0xff0000ff","0xffffffff","0xff000000"}; - //ScreenAlwaysOnCtr(1); + switch (*data) { case 1: @@ -975,6 +974,33 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint 0x05, &send_data, 1); + } else if(testitem == 0x06) + { + //进入lcd测试 + uint8_t send_data = 0; + + mcu_pm_lcd_on(0,0); + uapi_factorytest_enter_test_view(1); + uapi_factorytest_enter_test_lcd_view(); + uapi_factorytest_hide_test_lcd_button(); + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_LCD, + 0x06, + &send_data, + 1); + } else if(testitem == 0x07) + { + //退出lcd测试 + uint8_t send_data = 0; + + uapi_factorytest_enter_test_view(0); + + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_LCD, + 0x07, + &send_data, + 1); } break; @@ -1013,18 +1039,28 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint } else if(testitem == 0x03) { //触摸测试 - uint8_t send_data = 0x01; - + uint8_t send_data = 0; + mcu_pm_lcd_on(0,0); + uapi_factorytest_enter_test_view(1); + uapi_factorytest_enter_test_tp_view(); + uapi_factorytest_hide_test_tp_button(); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TP, 0x03, &send_data, 1); - send_data = 0x00; + + } else if(testitem == 0x04) + { + //退出触摸测试 + uint8_t send_data = 0; + + uapi_factorytest_enter_test_view(0); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TP, - 0x03, + 0x04, &send_data, 1); @@ -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: if(testitem == 0x01) { - //获取 hx3695 chip_id - uint8_t chip_id; - chip_id = hx3695_get_chip_id(); + //获取 ppg_id + uint8_t ppg_id; + uapi_ppg_get_id(&ppg_id); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, 0x01, - &chip_id, - sizeof(chip_id)); + &ppg_id, + sizeof(ppg_id)); } else if(testitem == 0x02) { diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index ec5cb5c84..3bab5bf2a 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -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); diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c index da23b2020..6fbff27ca 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.c @@ -381,24 +381,6 @@ bool hx3695_chip_check(void) return false; } -uint8_t hx3695_get_chip_id(void) -{ - uint8_t i = 0; - uint8_t chip_id = 0; - for(i=0; i<5; i++) - { - hx3695_ppg_on(); - chip_id = hx3695_read_reg(0x00); - - if (chip_id == 0x65) - { - return chip_id; - } - } - - return chip_id; -} - uint8_t hx3695_read_fifo_size(void) { uint8_t data_len_h,data_len_l; diff --git a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.h b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.h index 326b3997b..8eb2b292d 100644 --- a/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.h +++ b/code/sdk/drivers/peripheral/ppg/hx3695/hx3695.h @@ -297,9 +297,6 @@ void heart_rate_meas_timeout_handler(void * p_context); void wear_mode_timeout_handler(void * p_context); void Efuse_Mode_Check(void); -uint8_t hx3695_get_chip_id(void); - - #include "hx3695_hal.h" #endif diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 89228b44a..94c96b1d6 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -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 #include @@ -2255,7 +2258,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 } @@ -2304,14 +2342,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 +} diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 499685744..9fbd97a54 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -205,6 +205,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); -- 2.17.1