From aed92ce869cd4c0be7d9ee6df60d1c893cffcf0e Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Sun, 20 Oct 2024 18:55:24 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E8=93=9D=E7=89=99=E4=BA=A7?= =?utf8?q?=E6=B5=8B=E8=80=81=E5=8C=96=E6=B5=8B=E8=AF=95=EF=BC=8C=E6=8C=89?= =?utf8?q?=E9=94=AE=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../producttest/src/testmicrophone.cpp | 6 +- .../factorytest_protocol.c | 107 ++++++++++++------ 2 files changed, 79 insertions(+), 34 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp index 103088db6..e94213556 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp @@ -312,12 +312,14 @@ extern "C" if(isopen) { // AlarmClockModel::GetInstance()->testPlayerStart("/user/userdata/microphone.mp3"); - FindWatchViewEventListener::GetInstance().PopInterPlayMusic("/user/userdata/microphone.mp3"); + // FindWatchViewEventListener::GetInstance().PopInterPlayMusic("/user/userdata/microphone.mp3"); + AlarmClockModel::GetInstance()->AlarmPlayerStart(); } else { // AlarmClockModel::GetInstance()->AlarmPlayerStop(); - FindWatchViewEventListener::GetInstance().PopInterCancelMusic(); + // FindWatchViewEventListener::GetInstance().PopInterCancelMusic(); + AlarmClockModel::GetInstance()->AlarmPlayerStop(); } } 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 56ee2aaf1..489c04daf 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-10-12 20:34:45 + * @LastEditTime: 2024-10-20 18:54:23 * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c * @Description: * @@ -41,6 +41,8 @@ #ifdef SUPPORT_TCPIP #include "lwip/api_shell.h" #endif +#include "input_app.h" +#include "PhoneServiceC.h" #pragma pack(1) typedef struct factorytest_cmd_header_t @@ -171,6 +173,7 @@ void aging_task(void) while(aging_t.flag == 0xfdfd0002 && aging_time) //while(aging_t.flag == 0xfdfd0002) { + int cmd = 0; uint32_t msc; uapi_get_timestampe_ss(&msc); aging_t.enter_age_time = msc; @@ -195,6 +198,9 @@ void aging_task(void) } } +/*********************LCD 老化测试*****************************/ + + //读LCD ID uint32_t id; lcd_getid(&id); if(id != 0x1133) @@ -202,22 +208,19 @@ void aging_task(void) aging_t.display_error++; aging_t.fail_num++; } - mcu_pm_lcd_on(0,0); - mcu_pm_lcd_off(0,0); PRINT("aging_t.display_error : %d \r\n",aging_t.display_error); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_GRAYCARD_TEST); - FT_RESULTS_t ft_result = hx3695_factroy_test(LEAK_LIGHT_TEST); - send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); - - if(ft_result.gr_data_final < 10000 || ft_result.red_data_final < 10000 || ft_result.ir_data_final < 10000) + //单色屏测试 + cmd = 1; + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_LCD_TEST,&cmd,sizeof(cmd)); + for(cmd = 1; cmd < 6 ; cmd++) { - aging_t.ppg_error++; - aging_t.fail_num++; + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_LCD_COLOR_TEST,&cmd,sizeof(cmd)); + LOS_Msleep(1000); } - - PRINT("aging_t.ppg_error : %d \r\n",aging_t.ppg_error); - + +/*********************TP 老化测试*****************************/ + //读TP ID uint16_t tp_id; touch_getid(&tp_id); if(tp_id != 0x6456) @@ -227,6 +230,35 @@ void aging_task(void) } PRINT("aging_t.tp_error : %d \r\n",aging_t.tp_error); +/********************* 马达 老化测试*****************************/ + //震6秒 + for(cmd = 0; cmd < 2 ; cmd++) + { + // ui_api_vibrate_once_func(3); + ui_api_vibrate_once_func(); + LOS_Msleep(1000); + } + PRINT("aging_t.motor_error : %d \r\n",aging_t.motor_error); +/********************* spk 老化测试*****************************/ + uapi_check_spk(1); + LOS_Msleep(2000); + uapi_check_spk(0); + aging_t.speaker_error = 0; + PRINT("aging_t.speaker_error : %d \r\n",aging_t.speaker_error); +/*********************ppg 老化测试*****************************/ + //漏光测试 + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_GRAYCARD_TEST); + FT_RESULTS_t ft_result = hx3695_factroy_test(LEAK_LIGHT_TEST); + send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); + + if(ft_result.gr_data_final > 5000 || ft_result.red_data_final > 5000 || ft_result.ir_data_final > 5000) + { + aging_t.ppg_error++; + aging_t.fail_num++; + } + PRINT("aging_t.ppg_error : %d \r\n",aging_t.ppg_error); + +/*********************gsensor 老化测试*****************************/ gsenson_t g; get_gsonsen_xyz(&g); if(g.x == 0 && g.y == 0 && g.z == 0) @@ -236,6 +268,7 @@ void aging_task(void) } PRINT("aging_t.gsensor_error : %d \r\n",aging_t.gsensor_error); +/*********************磁力计 老化测试*****************************/ float fAzimuth,fPitch,fRoll; mmc5603_getdata(&fAzimuth,&fPitch,&fRoll); if(fAzimuth < 0) @@ -245,13 +278,6 @@ void aging_task(void) } PRINT("aging_t.mag_error : %d \r\n",aging_t.mag_error); - // uapi_vibrationModeSet(3); - ui_api_vibrate_once_func(); - aging_t.motor_error = 0; - PRINT("aging_t.motor_error : %d \r\n",aging_t.motor_error); - - aging_t.speaker_error = 0; - PRINT("aging_t.speaker_error : %d \r\n",aging_t.speaker_error); uint32_t flash_id; flash_getid(&flash_id); @@ -572,6 +598,17 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint &send_data, 1); } + if (testitem == 0x06) + { + uint8_t send_data = 0x00; + uapi_hfp_connect_(); + factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, + BLE_TEST_CMD_SOFT_TEST_SUB_MODE_BLE, + 0x06, + &send_data, + 1); + } + break; case BLE_TEST_CMD_SOFT_TEST_SUB_MODE_VIBRATOR: @@ -650,9 +687,12 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //开启电源键测试 uint8_t send_data = 0; - uapi_button_register_event_cb(pwr_button_callback_press, 1); - uapi_button_register_event_cb(pwr_button_callback_click_2, 3); - uapi_button_register_event_cb(pwr_button_callback_long_press_2s, 5); + uapi_button_unregister_event_cb(BUTTON_PWR_CLICKUP_2); + uapi_button_unregister_event_cb( BUTTON_PWR_LONGPRESS_2S); + + uapi_button_register_event_cb(pwr_button_callback_press, BUTTON_PWR_CLICKUP); + uapi_button_register_event_cb(pwr_button_callback_click_2, BUTTON_PWR_CLICKUP_2); + uapi_button_register_event_cb(pwr_button_callback_long_press_2s, BUTTON_PWR_LONGPRESS_2S); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, @@ -664,9 +704,12 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //开启功能键测试 uint8_t send_data = 0; - uapi_button_register_event_cb(func_button_callback_press, 24); - uapi_button_register_event_cb(func_button_callback_click_2, 26); - uapi_button_register_event_cb(func_button_callback_long_press_2s, 28); + uapi_button_unregister_event_cb(BUTTON1_CLICKUP_2); + uapi_button_unregister_event_cb(BUTTON1_LONGPRESS_2S); + + uapi_button_register_event_cb(func_button_callback_press, BUTTON1_CLICKUP); + uapi_button_register_event_cb(func_button_callback_click_2, BUTTON1_CLICKUP_2); + uapi_button_register_event_cb(func_button_callback_long_press_2s, BUTTON1_LONGPRESS_2S); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY, @@ -1254,7 +1297,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint { //漏光测试 send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_DO_LEAKLIGHT_TEST); - LOS_Msleep(500); + LOS_Msleep(200); FT_RESULTS_t ft_result = hx3695_factroy_test(LEAK_LIGHT_TEST); send_ppg_cmd_msg(PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST); uint8_t databuf[12] = {0}; @@ -1274,11 +1317,11 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint databuf[10] = (uint8_t)((ft_result.ir_data_final & 0x0000FF00) >> 8); databuf[11] = (uint8_t)((ft_result.ir_data_final & 0x000000FF) >> 0); - PRINT("%2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X\r\n", - databuf[0],databuf[1],databuf[2],databuf[3], - databuf[4],databuf[5],databuf[6],databuf[7], - databuf[8],databuf[9],databuf[10],databuf[11] - ); + // PRINT("%2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X %2X\r\n", + // databuf[0],databuf[1],databuf[2],databuf[3], + // databuf[4],databuf[5],databuf[6],databuf[7], + // databuf[8],databuf[9],databuf[10],databuf[11] + // ); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS, -- 2.17.1