From 009f534b1ea06a486df81988d51a8bf428e2aaae Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Tue, 5 Nov 2024 16:45:10 +0800 Subject: [PATCH] =?utf8?q?ui=E4=BA=A7=E6=B5=8B=E8=80=81=E5=8C=96=E6=B5=8B?= =?utf8?q?=E8=AF=95=E4=BD=BF=E7=94=A8=E8=93=9D=E7=89=99=E8=80=81=E5=8C=96?= =?utf8?q?=E6=B5=8B=E8=AF=95=EF=BC=8C=E5=85=B3=E9=97=ADcywee=E6=95=B0?= =?utf8?q?=E6=8D=AE=E4=B8=8E=E7=94=B5=E9=87=8F=E6=95=B0=E6=8D=AE=E6=89=93?= =?utf8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../battery/service/battery_driver.cpp | 4 +- .../producttest/include/testPresenter.h | 3 +- .../nativeui/producttest/include/testold.h | 66 +- .../nativeui/producttest/src/testModel.cpp | 10 +- .../producttest/src/testPresenter.cpp | 19 +- .../nativeui/producttest/src/testView.cpp | 1 + .../nativeui/producttest/src/testold.cpp | 702 ++++++++++++------ .../factorytest_protocol.c | 68 +- .../factorytest_protocol.h | 33 + .../msg_center/src/msg_center_customer.cpp | 10 +- .../peripheral/cywee/service/cywee_service.c | 88 +-- .../drivers/peripheral/cywee/src/main_dml.c | 72 +- .../peripheral/utils/custom_cmd_service.c | 6 +- .../drivers/peripheral/utils/custom_utils.h | 2 + 14 files changed, 732 insertions(+), 352 deletions(-) diff --git a/code/sdk/application/battery/service/battery_driver.cpp b/code/sdk/application/battery/service/battery_driver.cpp index efeb2e7b0..7f7b9e34e 100644 --- a/code/sdk/application/battery/service/battery_driver.cpp +++ b/code/sdk/application/battery/service/battery_driver.cpp @@ -437,7 +437,7 @@ static int battery_get_percent_by_voltage(float voltage) { history_percent++; percent = history_percent; - PRINT("charge percent[%d], history_percent[%d] \n",percent,history_percent); + // PRINT("charge percent[%d], history_percent[%d] \n",percent,history_percent); break; } } @@ -453,7 +453,7 @@ static int battery_get_percent_by_voltage(float voltage) { history_percent--; percent = history_percent; - PRINT("uncharge percent[%d], history_percent[%d] \n",percent,history_percent); + // PRINT("uncharge percent[%d], history_percent[%d] \n",percent,history_percent); break; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h index dbb65df4d..23af1b8ed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-08-23 10:50:37 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-09-18 18:29:11 + * @LastEditTime: 2024-11-05 14:34:43 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -49,6 +49,7 @@ namespace OHOS DEEPSLEEP, shutdown, + RESET, FACTORYRESE, #ifdef SUPPORT_A5133_SERVICE RF5133, diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h index d059dfbf9..d521e9ecb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h @@ -1,3 +1,11 @@ +/* + * @Author: penglei 1624952103@qq.com + * @Date: 2024-09-18 17:17:23 + * @LastEditors: penglei 1624952103@qq.com + * @LastEditTime: 2024-11-05 15:36:33 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ #ifndef TEST_OLD_VIEW_H #define TEST_OLD_VIEW_H @@ -5,18 +13,38 @@ #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" +#include "components/ui_label_ext.h" +#include "components/ui_button.h" #include "components/ui_image_view.h" #include "components/ui_label_button_ext.h" + //#include "cmsis_os.h" #include - namespace OHOS { + class testoldView { public: + struct ButtonConfig_ext_t + { + int x; + int y; + int w; + int h; + const char *str; + const char *ViewId; + const char *ImageSrc; + //label + int label_x; + int label_y; + uint8_t ALIGN; + int Fontsize; + + }; + struct LabelConfig { int16_t left; @@ -29,19 +57,45 @@ namespace OHOS uint8_t lineBreakMode; // 断行模式。 }; + testoldView(); virtual ~testoldView(); static testoldView *GetInstance(void); + UIScrollView *testoldInitIView(uint8_t); void ClearAll(void); - void setbuf(char *buf); - void set_data(); - - void setlightvalue(int ,int ,int); + void setdata(void); private: - bool testoldScrollViewcrollViewinit(uint8_t); + UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); UILabel *InitLabel(LabelConfig &labelConfig); + bool testoldScrollViewcrollViewinit(uint8_t); + UIScrollView *testoldScrollView{nullptr}; + UILabelButtonExt* labelButton_next = nullptr; + UILabelButtonExt* labelButton_start = nullptr; + UILabelButtonExt* labelButton_stop = nullptr; + + UILabel *label_flag{nullptr}; + UILabel *label_target_time{nullptr}; + UILabel *label_left_time{nullptr}; + UILabel *label_executions_num{nullptr}; + UILabel *label_fail_num{nullptr}; + UILabel *label_display_error{nullptr}; + UILabel *label_tp_error{nullptr}; + UILabel *label_crown_error{nullptr}; + UILabel *label_gsensor_error{nullptr}; + UILabel *label_ppg_error{nullptr}; + UILabel *label_mag_error{nullptr}; + UILabel *label_motor_error{nullptr}; + UILabel *label_mic_error{nullptr}; + UILabel *label_speaker_error{nullptr}; + UILabel *label_charge_error{nullptr}; + + + + bool initViewStatus{false}; + UILabel *Title{nullptr}; // 标题 + }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp index b85dd3305..773c9a086 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp @@ -2,7 +2,7 @@ * @Author: penglei 1624952103@qq.com * @Date: 2024-08-22 16:59:44 * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-08-22 17:22:33 + * @LastEditTime: 2024-11-05 15:28:21 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp * @Description: * @@ -50,6 +50,14 @@ namespace OHOS } break; + case 4: + if( testView::GetInstance()) + { + testView::GetInstance()->ChangeView(TESTVIEW,OLDTEST); + factorytest_hide_test_lcd_button(); + } + break; + default: break; } 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 cc2ffad9f..fb9bbba4c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -14,6 +14,9 @@ #include "audio_capture_wrapper.h" #include "cywee_service.h" +#include "factorytest_protocol.h" +#include "custom_runtime.h" + namespace OHOS { @@ -176,6 +179,11 @@ namespace OHOS uapi_poweroff_device(); return true; } + if(strcmp(view.GetViewId(),"reset") == 0) + { + uapi_reboot_device(); + return true; + } if(strcmp(view.GetViewId(),"deepsleep") == 0) { //TODO: close bt and cat1 , then deepsleep @@ -257,9 +265,18 @@ namespace OHOS } if(strcmp(view.GetViewId(),"addvolume") == 0) { - testmicrohoneView::GetInstance()->addvolumebuttoncallback(); } + if(strcmp(view.GetViewId(),"start") == 0) + { + if(uapi_dev_runtime_get_cat1_powerstat()) + uapi_set4GCapability(false); + factorytest_start_aging_test(); + } + if(strcmp(view.GetViewId(),"stop") == 0) + { + factorytest_stop_aging_test(); + } #ifdef SUPPORT_A5133_SERVICE if(strcmp(view.GetViewId(),"receive") == 0) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp index fc15f5592..6b8e40afa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp @@ -34,6 +34,7 @@ namespace OHOS {OLDTEST,"oldtestbutton","aging" ,"oldtestexit",&testView::ChangeoldTESTView,true}, {DEEPSLEEP,"deepsleep","DeepSleepCurrent","xxxxxxxxx" ,&testView::ChangeoldTESTView,true}, {shutdown,"shutdown","shutdown", "xxxxxxxxx",&testView::ChangeoldTESTView,true}, + {RESET,"reset","reset", "xxxxxxxxx",&testView::ChangeoldTESTView,true}, {FACTORYRESE,"FactoryReset","FactoryReset","xxxxxxxxx", &testView::ChangeoldTESTView,true}, #ifdef SUPPORT_A5133_SERVICE {RF5133,"RF5133","RF5133", "xxxxxxxxx",&testView::ChangeA5133TESTView,true}, diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp index f1351fa15..7c4517c58 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp @@ -1,195 +1,223 @@ #include "wearable_log.h" #include "custom_utils.h" #include "producttest/include/testPresenter.h" -#include "producttest/include/testold.h" -#include "mag_service.h" +#include "producttest/include/testold.h" +#include "AlarmClockModel.h" #include "cmsis_os2.h" -#include "cywee_hal.h" -#include "tcxo.h" -#include "ppg_service.h" -#include "CompassModel.h" -#include "linux/delay.h" -#include "power_display_service.h" #include "producttest/include/testView.h" -#ifdef __cplusplus -#if __cplusplus -extern "C" -{ -#endif -#endif - #include "pm_veto.h" - #include "pm.h" -#ifdef __cplusplus -#if __cplusplus -} -#endif -#endif -//#include "acc_service.h" +#include "factorytest_protocol.h" namespace OHOS { - static UILabel *x{nullptr}; - static uint8 AGING_task_falg=0; - UIScrollView *testoldScrollView{nullptr}; - bool initViewStatus{false}; - UILabel *title{nullptr}; - // UILabel *x{nullptr}; - UILabel *y{nullptr}; - UILabel *z{nullptr}; - UILabelButtonExt* labelButton_next = nullptr; - - static void AGING_task(void *arg) - { - while (AGING_task_falg) - { - msleep(1000); - // uapi_tcxo_delay_ms(3000); - for(int i=0;i<1;i++) - { - int8_t md = PPG_SERVICE_CMD_TYPE_DO_LEAKLIGHT_TEST; - send_ppg_cmd_msg(md); - msleep(3000); - - } - for(int i=0;i<3;i++) - { - uint16_t angle_value= (int16_t)mag_service_get_fAzimuth(); - char buf[16]={0}; - sprintf(buf,"angle:%d",angle_value); - if( AGING_task_falg && testoldView::GetInstance()) - { - testoldView::GetInstance()->setbuf(buf); - RootView::GetInstance()->Invalidate(); - msleep(1000); - } - else{ - break; - } - - } - for(int i=0;i<3;i++) - { - gsenson_t t; - get_gsonsen_xyz(&t); - char buf[64]={0}; - float x_t=t.x; - float y_t=t.y; - float z_t=t.z; - sprintf(buf,"gsensor:\nX:%.2f\nY:%.2f\nZ:%.2f",x_t,y_t,z_t); - if(AGING_task_falg && testoldView::GetInstance()) - { - testoldView::GetInstance()->setbuf(buf); - RootView::GetInstance()->Invalidate(); - msleep(1000); - } - else{ - break; - } - } - // uapi_tcxo_delay_ms(3000); - } - testoldView::GetInstance()->ClearAll(); - - } - errcode_t old_test_init(void) - { - AGING_task_falg=1; - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"uapi_ppg_service_init !\r\n"); - app_task_definition_t taskcfg={0}; - taskcfg.create_queue_handle = NULL; - taskcfg.attr.name="AGING_test_service"; - taskcfg.attr.priority = TASK_PRIORITY_APP; - taskcfg.attr.stack_size = 1024*8; - taskcfg.func = AGING_task; - taskcfg.use_mem = USE_EXTEND_MEM; - - errcode_t ret=uapi_create_osThread_custom(&taskcfg); - if(ret != ERRCODE_SUCC) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"create ppg_service failed %d!\r\n",ret); - return ERRCODE_FAIL; - } - - return ERRCODE_SUCC; - } - - - - void testoldView:: setlightvalue(int g,int r,int ir) - { - - if(x!=nullptr) - { - char buf[124]={0}; - sprintf(buf,"leaklight:\ngreen:%d\nred:%d\nir:%d",g,r,ir); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",buf); - if(x) - { - x->SetText(buf); - RootView::GetInstance()->Invalidate(); - - } - int8_t md = PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST; - send_ppg_cmd_msg(md); - } - } + static testoldView *g_pSystemAboutTheWatchView{nullptr}; + static osTimerId_t g_aging_timer=NULL; + static ble_aging_t aging_t; testoldView::testoldView() { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemAboutTheWatchView"); - + g_pSystemAboutTheWatchView = this; } testoldView::~testoldView() { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "testoldView::~testoldView"); - AGING_task_falg=0; + ClearAll(); + //g_pSystemAboutTheWatchView = nullptr; } testoldView *testoldView::GetInstance() { - static testoldView g_testoldView; - - return &g_testoldView; + + return g_pSystemAboutTheWatchView; } + + void testoldView::setdata(void) + { + label_flag->SetText((std::string("老化标志:" )+ std::to_string(aging_t.flag)).c_str()); + label_target_time->SetText((std::string("目标时间:") + std::to_string(aging_t.target_time)).c_str()); + label_left_time->SetText((std::string("剩余时间:" )+ std::to_string(aging_t.left_time)).c_str()); + label_executions_num->SetText((std::string("执行次数:") + std::to_string(aging_t.executions_num)).c_str()); + label_fail_num->SetText((std::string("总失败次数:" )+ std::to_string(aging_t.fail_num)).c_str()); + label_display_error->SetText((std::string("LCD失败次数:") + std::to_string(aging_t.display_error)).c_str()); + label_tp_error->SetText((std::string("TP失败次数:" )+ std::to_string(aging_t.tp_error)).c_str()); + label_crown_error->SetText((std::string("表冠失败次数:") + std::to_string(aging_t.crown_error)).c_str()); + label_gsensor_error->SetText((std::string("gsensor失败次数:") + std::to_string(aging_t.gsensor_error)).c_str()); + label_ppg_error->SetText((std::string("ppg失败次数:" )+ std::to_string(aging_t.ppg_error)).c_str()); + label_mag_error->SetText((std::string("磁力计失败次数:") + std::to_string(aging_t.mag_error)).c_str()); + label_motor_error->SetText((std::string("马达失败次数:" )+ std::to_string(aging_t.motor_error)).c_str()); + label_mic_error->SetText((std::string("麦克风失败次数:" )+ std::to_string(aging_t.mic_error)).c_str()); + label_speaker_error->SetText((std::string("喇叭失败次数:") + std::to_string(aging_t.speaker_error)).c_str()); + label_charge_error->SetText((std::string("充电失败次数:" )+ std::to_string(aging_t.charge_error)).c_str()); + } + void testoldView::ClearAll() { if(testoldScrollView) { testoldScrollView->RemoveAll(); - if(title!=NULL) - { - delete title; - title=nullptr; - } - if(x!=NULL) + + if (g_aging_timer != NULL) { - delete x; - x=nullptr; + osTimerStop(g_aging_timer); + osTimerDelete(g_aging_timer); + g_aging_timer = NULL; } + + + if(labelButton_next) { delete labelButton_next; labelButton_next=nullptr; } - uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); - if (cnt == 1) { - uapi_pm_remove_sleep_veto(PM_ID_P_TEST); - } else { - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + + if(labelButton_start) + { + delete labelButton_start; + labelButton_start=nullptr; } + + if(labelButton_stop) + { + delete labelButton_stop; + labelButton_stop=nullptr; + } + + if(label_flag) + { + delete label_flag; + label_flag=nullptr; + } + + if(label_target_time) + { + delete label_target_time; + label_target_time=nullptr; + } + + if(label_left_time) + { + delete label_left_time; + label_left_time=nullptr; + } + + if(label_executions_num) + { + delete label_executions_num; + label_executions_num=nullptr; + } + + if(label_fail_num) + { + delete label_fail_num; + label_fail_num=nullptr; + } + + if(label_display_error) + { + delete label_display_error; + label_display_error=nullptr; + } + + if(label_tp_error) + { + delete label_tp_error; + label_tp_error=nullptr; + } + + if(label_crown_error) + { + delete label_crown_error; + label_crown_error=nullptr; + } + + if(label_gsensor_error) + { + delete label_gsensor_error; + label_gsensor_error=nullptr; + } + + if(label_ppg_error) + { + delete label_ppg_error; + label_ppg_error=nullptr; + } + + if(label_mag_error) + { + delete label_mag_error; + label_mag_error=nullptr; + } + + if(label_motor_error) + { + delete label_motor_error; + label_motor_error=nullptr; + } + + if(label_mic_error) + { + delete label_mic_error; + label_mic_error=nullptr; + } + + if(label_speaker_error) + { + delete label_speaker_error; + label_speaker_error=nullptr; + } + + if(label_charge_error) + { + delete label_charge_error; + label_charge_error=nullptr; + } + + if(Title) + { + delete Title; + Title=nullptr; + } + + + delete testoldScrollView; testoldScrollView=nullptr; + } + } + + UILabelButtonExt *testoldView::SetTheButton_ext(ButtonConfig_ext_t &buttonconfig) + { + UILabelButtonExt *button = new UILabelButtonExt(); + if (button == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SystemView::SetTheButton: button new fail!"); + return nullptr; } + button->SetPosition(buttonconfig.x, buttonconfig.y, buttonconfig.w, buttonconfig.h); + button->SetViewId(buttonconfig.ViewId); + button->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full); + //button->SetStyle(STYLE_BORDER_RADIUS,0); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED); + //button->SetStyleForState(STYLE_BORDER_RADIUS,0, UIButton::PRESSED); + button->SetTouchable(true); + button->SetStyle(STYLE_BACKGROUND_OPA, 0x80); + button->SetText(buttonconfig.str); + button->SetAlign(TEXT_ALIGNMENT_LEFT); + button->SetLabelPosition(buttonconfig.label_x,buttonconfig.label_y ); + button->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, buttonconfig.Fontsize); + UIView:: OnClickListener *touchListener = static_cast(testPresenter::GetInstance()); + button->SetOnClickListener(touchListener); + + // UIView::OnDragListener *drgListener = static_cast(testPresenter::GetInstance()); + // button->SetOnDragListener(drgListener); + + // button->SetDraggable(false); + return button; } - void testoldView::setbuf(char *buf) - { - if(x) - x->SetText(buf); - } - - - UILabel *testoldView::InitLabel(LabelConfig &labelConfig) + + UILabel *testoldView::InitLabel(LabelConfig &labelConfig) { UILabel *label = new UILabel(); if (label == nullptr) @@ -203,119 +231,335 @@ namespace OHOS label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。 label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP); label->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, labelConfig.fontSize); + // label->SetAlign(TEXT_ALIGNMENT_LEFT); return label; } - - + static void msgupdateTimerCallBack(int data) + { + do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_AGING_DATA_READ, NULL, 0); + LOS_Msleep(500); + factorytest_get_aging_data(&aging_t); + OHOS::testoldView *pview = OHOS::testoldView::GetInstance(); + pview->setdata(); + } + bool testoldView::testoldScrollViewcrollViewinit(uint8_t id) { + testoldScrollView = new UIScrollView(); + if (testoldScrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::testoldScrollView new fail!"); + return false; + } + testoldScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + testoldScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + testoldScrollView->SetStyle(STYLE_BORDER_RADIUS, 0); + testoldScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + testoldScrollView->SetStyle(STYLE_BORDER_COLOR, Color::Yellow().blue); + testoldScrollView->SetScrollBlankSize(60); - CompassModel::GetInstance()->OpenCompassSensor(); + LabelConfig Config = { + .left = 0, + .top = 100, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "老化标志:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_flag= InitLabel(Config); + if (label_flag == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_flag); - if(testoldScrollView==NULL) + Config = { + .left = 0, + .top = 200, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "目标时间:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_target_time= InitLabel(Config); + if (label_target_time == nullptr) { - testoldScrollView = new UIScrollView(); - if (testoldScrollView == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::testoldScrollView new fail!"); - return false; - } - testoldScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - testoldScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - testoldScrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_target_time); - - testoldScrollView->SetScrollBlankSize(0); - testoldScrollView->SetReboundSize(0); - testoldScrollView->SetDirection(1); + Config = { + .left = 0, + .top = 300, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "剩余时间:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_left_time= InitLabel(Config); + if (label_left_time == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; } + testoldScrollView->Add(label_left_time); + + Config = { + .left = 0, + .top = 400, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "执行次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_executions_num= InitLabel(Config); + if (label_executions_num == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_executions_num); + Config = { + .left = 0, + .top = 500, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "总失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_fail_num= InitLabel(Config); + if (label_fail_num == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_fail_num); - LabelConfig Config = { - .left = 142, - .top = 52, - .width = 60, + Config = { + .left = 0, + .top = 600, + .width = 350, .height = 35, .fontSize = 30, .lineHeigh = 35, - .text = "AGING_TEST", - .lineBreakMode = UILabel::LINE_BREAK_ADAPT, + .text = "LCD失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, }; - if(title==NULL) + label_display_error= InitLabel(Config); + if (label_display_error == nullptr) { - title = InitLabel(Config); - if (title == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); - return false; - } - testoldScrollView->Add(title); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; } - - /* -------------------------------------------------------------------------- */ - // uint16_t angle_value= (int16_t)mag_service_get_fAzimuth(); - gsenson_t t; - //get_gsonsen_xyz(&t); - char buf[124]={0}; - //sprintf(buf,"X:%f\nY:%f\nZ:%f",t.x,t.y,t.z); + testoldScrollView->Add(label_display_error); + Config = { - .left = 173, - .top = 160, - .width = 120, + .left = 0, + .top = 700, + .width = 350, .height = 35, - .fontSize = 40, + .fontSize = 30, .lineHeigh = 35, - .text = buf, - .lineBreakMode = UILabel::LINE_BREAK_ADAPT, + .text = "TP失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, }; - - if(x==NULL) + label_tp_error= InitLabel(Config); + if (label_tp_error == nullptr) { - x = InitLabel(Config); - if (x == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::WatchNameTitle new fail!"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); return false; - } - testoldScrollView->Add(x); } - + testoldScrollView->Add(label_tp_error); - /* -------------------------------------------------------------------------- */ - if(labelButton_next==NULL) + Config = { + .left = 0, + .top = 800, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "表冠失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_crown_error= InitLabel(Config); + if (label_crown_error == nullptr) { - labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,Test_ViewMapper_t[id].viewid_str_next); - testoldScrollView->Add(labelButton_next); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_crown_error); + Config = { + .left = 0, + .top = 900, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "gsensor失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_gsensor_error= InitLabel(Config); + if (label_gsensor_error == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; } - + testoldScrollView->Add(label_gsensor_error); + + Config = { + .left = 0, + .top = 1000, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "ppg失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_ppg_error= InitLabel(Config); + if (label_ppg_error == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_ppg_error); + Config = { + .left = 0, + .top = 1100, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "磁力计失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_mag_error= InitLabel(Config); + if (label_mag_error == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_mag_error); - testoldScrollView->SetTouchable(true); - testoldScrollView->SetDraggable(false); - - // const power_display_svr_api_t *display_api = power_display_svr_get_api(); - // if (display_api->get_screen_state() != SCREEN_ON) - // { - // display_api->turn_on_screen(); - // } - // display_api->set_screen_set_keepon_timeout(-1); - ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); - - uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); - if (cnt == 0) { - uapi_pm_add_sleep_veto(PM_ID_P_TEST); - } else { - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + Config = { + .left = 0, + .top = 1200, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "马达失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_motor_error= InitLabel(Config); + if (label_motor_error == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; } + testoldScrollView->Add(label_motor_error); + Config = { + .left = 0, + .top = 1300, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "麦克风失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_mic_error= InitLabel(Config); + if (label_mic_error == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_mic_error); + + Config = { + .left = 0, + .top = 1400, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "喇叭失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_speaker_error= InitLabel(Config); + if (label_speaker_error == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_speaker_error); + + Config = { + .left = 0, + .top = 1500, + .width = 350, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "充电失败次数:", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + label_charge_error= InitLabel(Config); + if (label_charge_error == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return false; + } + testoldScrollView->Add(label_charge_error); + + labelButton_next= testAboutView::GetInstance()->init_button_next(300,300,Test_ViewMapper_t[id].viewid_str_next); + labelButton_next->SetText("exit"); + testoldScrollView->Add(labelButton_next); + + labelButton_start= testAboutView::GetInstance()->init_button_next(300,100,Test_ViewMapper_t[id].viewid_str_next); + labelButton_start->SetText("start"); + labelButton_start->SetViewId("start"); + testoldScrollView->Add(labelButton_start); + + labelButton_stop= testAboutView::GetInstance()->init_button_next(300,200,Test_ViewMapper_t[id].viewid_str_next); + labelButton_stop->SetText("stop"); + labelButton_stop->SetViewId("stop"); + testoldScrollView->Add(labelButton_stop); + Title= testAboutView::GetInstance()->init_title(165,45,"老化测试"); + testoldScrollView->Add(Title); + testoldScrollView->SetTouchable(true); + testoldScrollView->SetDraggable(true); + g_aging_timer = osTimerNew((osTimerFunc_t)msgupdateTimerCallBack, osTimerPeriodic, NULL, NULL); - old_test_init(); + osStatus_t ret = osTimerStart(g_aging_timer, 1000 * 60 * 10); + if (ret != osOK && g_aging_timer != NULL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"StartCallTimer osTimerStart failed, ret = %lx!!", ret); + osTimerDelete(g_aging_timer); + g_aging_timer = NULL; + return false; + } + msgupdateTimerCallBack(0); return true; } @@ -327,4 +571,6 @@ namespace OHOS } return testoldScrollView; } + + } \ 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 daea9a437..dae1b469c 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-11-01 20:49:51 + * @LastEditTime: 2024-11-05 16:43:04 * @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c * @Description: * @@ -54,24 +54,7 @@ typedef struct factorytest_cmd_header_t uint8_t testitem; }factorytest_cmd_header_t; -typedef struct -{ - uint32_t charge_error; //充电失败次数 - uint32_t speaker_error; //spk失败次数 - uint32_t mic_error; //mic失败次数 - uint32_t motor_error; //马达失败次数 - uint32_t mag_error; //磁力计失败次数 - uint32_t ppg_error; //ppg失败次数 - uint32_t gsensor_error; //gsensor失败次数 - uint32_t crown_error; //表冠失败次数 - uint32_t tp_error; //tp失败次数 - uint32_t display_error; //LCD失败次数 - uint32_t fail_num; //总失败次数 - uint32_t executions_num;//执行次数 - uint32_t left_time; //剩余时间 - uint32_t target_time; //目标时间 - uint32_t flag; //老化测试状态 (未开始 - 0, 已开始 - 1, 停止 - 2,完成 - 3) -} ble_aging_t; + #pragma pack() @@ -167,6 +150,43 @@ void ble_acc_check_timer_callback(void) 6); } +static uint8_t aging_start_flag = 0; + +void factorytest_start_aging_test(void) +{ + if(aging_start_flag == 1) + return; + + aging_start_flag = 1; + + if(aging_t.flag == 2) + { + aging_t.flag = 1; + } + else + { + memset(&aging_t, 0, sizeof(ble_aging_t)); + aging_t.target_time = 6 * 60 * 60; //老化时间6小时 + aging_time = aging_t.target_time; + aging_t.left_time = aging_time; + do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_AGING_DATA_SAVE, NULL, 0); + aging_test_init(); + } + +} + +void factorytest_stop_aging_test(void) +{ + aging_t.flag = 2; + aging_start_flag = 0; +} + +void factorytest_get_aging_data(ble_aging_t *data) +{ + memset_s(data,sizeof(ble_aging_t),0,sizeof(ble_aging_t)); + memcpy_s(data,sizeof(ble_aging_t),&aging_t,sizeof(ble_aging_t)); +} + void factorytest_save_aging_data(void) { uapi_save_file_data("user/userdata/aging_test.bin",&aging_t,sizeof(ble_aging_t),"wb"); @@ -236,6 +256,9 @@ void aging_task(void) } cmd = 5; do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_LCD_COLOR_TEST,&cmd,sizeof(cmd)); + + do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_AGING_TEST,NULL,0); + // /*********************TP 老化测试*****************************/ //读TP ID uint16_t tp_id; @@ -931,10 +954,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint { //进入老化命令 uint8_t send_data = 0x00; - memset(&aging_t, 0, sizeof(ble_aging_t)); - aging_t.target_time = 6 * 60 * 60; //老化时间6小时 - aging_time = aging_t.target_time; - aging_test_init(); + factorytest_start_aging_test(); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_AGING_TEST, 0x01, @@ -945,7 +965,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint //停止老化 uint8_t send_data = 0x00; - aging_t.flag = 2; + factorytest_stop_aging_test(); factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_AGING_TEST, diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h index ab2474cf7..4abd63521 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h @@ -98,6 +98,28 @@ extern "C" { //软件测试 子模式ID 支付宝 #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ALIPAY 0x31 + +#pragma pack(1) +typedef struct +{ + uint32_t charge_error; //充电失败次数 + uint32_t speaker_error; //spk失败次数 + uint32_t mic_error; //mic失败次数 + uint32_t motor_error; //马达失败次数 + uint32_t mag_error; //磁力计失败次数 + uint32_t ppg_error; //ppg失败次数 + uint32_t gsensor_error; //gsensor失败次数 + uint32_t crown_error; //表冠失败次数 + uint32_t tp_error; //tp失败次数 + uint32_t display_error; //LCD失败次数 + uint32_t fail_num; //总失败次数 + uint32_t executions_num;//执行次数 + uint32_t left_time; //剩余时间 + uint32_t target_time; //目标时间 + uint32_t flag; //老化测试状态 (未开始 - 0, 已开始 - 1, 停止 - 2,完成 - 3) +} ble_aging_t; + +#pragma pack() /** * * encode cmd msg string and send to ble @@ -117,6 +139,17 @@ errcode_t factorytest_ota_recv(const uint8_t *data, uint8_t len); errcode_t factorytest_ota_report(uint8_t mode, uint8_t submode,uint8_t testitem, uint8_t *input_data,uint16_t input_len); +errcode_t aging_test_init(void); + +void factorytest_save_aging_data(void); +void factorytest_read_aging_data(void); + +void factorytest_get_aging_data(ble_aging_t *data); + +void factorytest_start_aging_test(void); + +void factorytest_stop_aging_test(void); + /** * @} */ diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 8ccff4567..3cf60a628 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -780,11 +780,11 @@ void MsgCenterNotifyleaklightProc(const Topic topic, Request* req) t->setlightvalue(green,red,ir); } - testoldView * t_1= testoldView::GetInstance(); - if(t_1!=NULL) - { - t_1->setlightvalue(green,red,ir); - } + // testoldView * t_1= testoldView::GetInstance(); + // if(t_1!=NULL) + // { + // t_1->setlightvalue(green,red,ir); + // } #endif } diff --git a/code/sdk/drivers/peripheral/cywee/service/cywee_service.c b/code/sdk/drivers/peripheral/cywee/service/cywee_service.c index cdcce1c22..b40f7a25b 100644 --- a/code/sdk/drivers/peripheral/cywee/service/cywee_service.c +++ b/code/sdk/drivers/peripheral/cywee/service/cywee_service.c @@ -59,7 +59,7 @@ static void cywee_service_check_timer_callback(void *data); void cywee_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datalen) { - PRINT("cywee_msg_callback\r\n"); + // PRINT("cywee_msg_callback\r\n"); cywee_activity_result_t c_activity_result_t; cywee_inactivity_result_t c_inactivity_result_t; cywee_activity_result_extre_info_t c_activity_result_extre_info_t; @@ -71,49 +71,44 @@ void cywee_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datalen switch (c_activity_result_t.activity_mode) { case SPORT_ACTIVE_MODE_NORMAL: - PRINT("normal mode activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", - c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, - c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); + // PRINT("normal mode activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", + // c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, + // c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); CustomEventPublish(TOPIC_EVENT_ACTIVITY_UPDATE, &c_activity_result_t, sizeof(cywee_activity_result_t)); break; case SPORT_ACTIVE_MODE_TREADMILL: - PRINT("CYWEE_MSG_TYPE_TREADMILL_UPDATE\r\n"); - memcpy(&c_activity_result_t, msg_data, sizeof(cywee_activity_result_t)); - PRINT("activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", - c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, - c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); + // PRINT("CYWEE_MSG_TYPE_TREADMILL_UPDATE\r\n"); + // PRINT("activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", + // c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, + // c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); CustomEventPublish(TOPIC_EVENT_ACTIVITY_UPDATE, &c_activity_result_t, sizeof(cywee_activity_result_t)); break; case SPORT_ACTIVE_MODE_OUTDOOR_RUNNING: - PRINT("CYWEE_MSG_TYPE_OUTDOOR_RUNNING_UPDATE\r\n"); - memcpy(&c_activity_result_t, msg_data, sizeof(cywee_activity_result_t)); - PRINT("outdoor running activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", - c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, - c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); + // PRINT("CYWEE_MSG_TYPE_OUTDOOR_RUNNING_UPDATE\r\n"); + // PRINT("outdoor running activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", + // c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, + // c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); CustomEventPublish(TOPIC_EVENT_ACTIVITY_UPDATE, &c_activity_result_t, sizeof(cywee_activity_result_t)); break; case SPORT_ACTIVE_MODE_INDOOR_RUNNING: - PRINT("CYWEE_MSG_TYPE_INDOOR_RUNNING_UPDATE\r\n"); - memcpy(&c_activity_result_t, msg_data, sizeof(cywee_activity_result_t)); - PRINT("indoor running activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", - c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, - c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); + // PRINT("CYWEE_MSG_TYPE_INDOOR_RUNNING_UPDATE\r\n"); + // PRINT("indoor running activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", + // c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, + // c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); CustomEventPublish(TOPIC_EVENT_ACTIVITY_UPDATE, &c_activity_result_t, sizeof(cywee_activity_result_t)); break; case SPORT_ACTIVE_MODE_FITNESS_PEDOMETERR: - PRINT("CYWEE_MSG_TYPE_FITNESS_PEDOMETERR_UPDATE\r\n"); - memcpy(&c_activity_result_t, msg_data, sizeof(cywee_activity_result_t)); - PRINT("activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", - c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, - c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); + // PRINT("CYWEE_MSG_TYPE_FITNESS_PEDOMETERR_UPDATE\r\n"); + // PRINT("activit_mode[%d], steps[%d], distance[%d], calories[%d], step frequency[%d], step length[%.2f], pace[%d]\n", + // c_activity_result_t.activity_mode, c_activity_result_t.steps, c_activity_result_t.distance, c_activity_result_t.calories, + // c_activity_result_t.step_frequency,c_activity_result_t.step_length, c_activity_result_t.pace); CustomEventPublish(TOPIC_EVENT_ACTIVITY_UPDATE, &c_activity_result_t, sizeof(cywee_activity_result_t)); break; case SPORT_ACTIVE_MODE_FREE_TRAINING: - PRINT("CYWEE_MSG_TYPE_FREE_TRAINING_UPDATE\r\n"); - memcpy(&c_activity_result_t, msg_data, sizeof(cywee_activity_result_t)); - PRINT("free training activit_mode[%d], calories[%d],MHR_zone[%d]\n", - c_activity_result_t.activity_mode, c_activity_result_t.calories, c_activity_result_t.MHR_zone); + // PRINT("CYWEE_MSG_TYPE_FREE_TRAINING_UPDATE\r\n"); + // PRINT("free training activit_mode[%d], calories[%d],MHR_zone[%d]\n", + // c_activity_result_t.activity_mode, c_activity_result_t.calories, c_activity_result_t.MHR_zone); CustomEventPublish(TOPIC_EVENT_ACTIVITY_UPDATE, &c_activity_result_t, sizeof(cywee_activity_result_t)); break; default: @@ -122,16 +117,16 @@ void cywee_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datalen } else if (msg_type == CYWEE_MSG_TYPE_ACTIVITY_EXTRA_INFO_UPDATE) { - PRINT("CYWEE_MSG_TYPE_ACTIVITY_EXTRA_INFO_UPDATE\r\n"); + // PRINT("CYWEE_MSG_TYPE_ACTIVITY_EXTRA_INFO_UPDATE\r\n"); memcpy(&c_activity_result_extre_info_t, msg_data, sizeof(cywee_activity_result_extre_info_t)); - PRINT("avg_step_freq[%d],avg_step_len[%.2f],avg_pace[%d],max_step_freq[%d],max_pace[%d],activity_zone[%d],ativity_zone_moderate_duration[%d],ativity_zone_high_duration[%d],MHR_zone[%d],distance_motion[%d]\n", - c_activity_result_extre_info_t.avg_step_freq, c_activity_result_extre_info_t.avg_step_len, - c_activity_result_extre_info_t.avg_pace,c_activity_result_extre_info_t.max_step_freq, - c_activity_result_extre_info_t.max_pace,c_activity_result_extre_info_t.activity_zone, - c_activity_result_extre_info_t.ativity_zone_moderate_duration, - c_activity_result_extre_info_t.ativity_zone_high_duration, - c_activity_result_extre_info_t.MHR_zone, - c_activity_result_extre_info_t.distance_motion); + // PRINT("avg_step_freq[%d],avg_step_len[%.2f],avg_pace[%d],max_step_freq[%d],max_pace[%d],activity_zone[%d],ativity_zone_moderate_duration[%d],ativity_zone_high_duration[%d],MHR_zone[%d],distance_motion[%d]\n", + // c_activity_result_extre_info_t.avg_step_freq, c_activity_result_extre_info_t.avg_step_len, + // c_activity_result_extre_info_t.avg_pace,c_activity_result_extre_info_t.max_step_freq, + // c_activity_result_extre_info_t.max_pace,c_activity_result_extre_info_t.activity_zone, + // c_activity_result_extre_info_t.ativity_zone_moderate_duration, + // c_activity_result_extre_info_t.ativity_zone_high_duration, + // c_activity_result_extre_info_t.MHR_zone, + // c_activity_result_extre_info_t.distance_motion); CustomEventPublish(TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE, &c_activity_result_extre_info_t, sizeof(cywee_activity_result_extre_info_t)); } @@ -142,15 +137,13 @@ void cywee_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datalen { // 久坐 case INACTIVITY_MODE_SEDENTARY_OUTPUT: - memcpy(&c_inactivity_result_t, msg_data, sizeof(cywee_inactivity_result_t)); - PRINT("sedentary status[%d], stand freq[%d], day[%d], hour[%d], min[%d]\n", - c_inactivity_result_t.status,c_inactivity_result_t.stand_freq,c_inactivity_result_t.day,c_inactivity_result_t.hour,c_inactivity_result_t.minute); + // PRINT("sedentary status[%d], stand freq[%d], day[%d], hour[%d], min[%d]\n", + // c_inactivity_result_t.status,c_inactivity_result_t.stand_freq,c_inactivity_result_t.day,c_inactivity_result_t.hour,c_inactivity_result_t.minute); CustomEventPublish(TOPIC_EVENT_INACTIVITY_UPDATE, &c_inactivity_result_t, sizeof(cywee_inactivity_result_t)); break; // 睡眠 case INACTIVITY_MODE_SLEEPING_OUTPUT: - memcpy(&c_inactivity_result_t, msg_data, sizeof(cywee_inactivity_result_t)); PRINT("sleep status[%d], month[%d], day[%d], hour[%d], min[%d]\n", c_inactivity_result_t.status,c_inactivity_result_t.month, c_inactivity_result_t.day, c_inactivity_result_t.hour, c_inactivity_result_t.minute); @@ -159,14 +152,15 @@ void cywee_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datalen // 小睡 case INACTIVITY_MODE_NAP_OUTPUT: - memcpy(&c_inactivity_result_t, msg_data, sizeof(cywee_inactivity_result_t)); PRINT("nap status[%d], month[%d], day[%d], hour[%d], min[%d]\n", c_inactivity_result_t.status, c_inactivity_result_t.month, c_inactivity_result_t.day, c_inactivity_result_t.hour, c_inactivity_result_t.minute); CustomEventPublish(TOPIC_EVENT_INACTIVITY_UPDATE, &c_inactivity_result_t, sizeof(cywee_inactivity_result_t)); break; } + } + else if (msg_type == CYWEE_MSG_TYPE_INACTIVITY_ACCUMULATE_TIME_UPDATE) { // 睡眠累计 @@ -178,9 +172,9 @@ void cywee_msg_callback(uint8_t msg_type, uint8_t *msg_data, int32_t msg_datalen CustomEventPublish(TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE, &c_inactivity_accumulate_time_t, sizeof(cywee_inactivity_accumulate_time_t)); } - else PRINT("Unknown sensor message type"); + } static void cywee_service_timer_start_check(uint32_t rtc_ms) @@ -279,7 +273,7 @@ static void cywee_service_check_task(void const *arg) break; case CYWEE_SERVICE_CMD_NORMAL_MODE: - PRINT("普通运动模式\r\n"); + // PRINT("普通运动模式\r\n"); cywee_activity_mode_change(SPORT_ACTIVE_MODE_NORMAL); break; @@ -288,12 +282,12 @@ static void cywee_service_check_task(void const *arg) break; case CYWEE_SERVICE_CMD_OUTDOOR_RUNNING_MODE: - PRINT("室外跑步模式\r\n"); + // PRINT("室外跑步模式\r\n"); cywee_activity_mode_change(SPORT_ACTIVE_MODE_OUTDOOR_RUNNING); break; case CYWEE_SERVICE_CMD_INDOOR_RUNNING_MODE: - PRINT("室内跑步模式\r\n"); + // PRINT("室内跑步模式\r\n"); cywee_activity_mode_change(SPORT_ACTIVE_MODE_INDOOR_RUNNING); break; @@ -302,7 +296,7 @@ static void cywee_service_check_task(void const *arg) break; case CYWEE_SERVICE_CMD_FREE_TRAINING_MODE: - PRINT("自由训练模式\r\n"); + // PRINT("自由训练模式\r\n"); cywee_activity_mode_change(SPORT_ACTIVE_MODE_FREE_TRAINING); break; diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 7093d5f12..8fd754adb 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -211,7 +211,7 @@ void cywee_save_nap_data(cywee_inactivity_accumulate_time_t c_inactivity_accumul uint8_t total_time_minute = (total_time % 60); fwrite(&total_time_minute, 1, 1, fp); - CWM_OS_dbgPrintf("save_nap_sleep_data succ \n"); + // CWM_OS_dbgPrintf("save_nap_sleep_data succ \n"); fclose(fp); } @@ -298,9 +298,9 @@ void cywee_save_sleep_time_data(cywee_inactivity_accumulate_time_t sleep_time) ephemeral_flag = 0; } - CWM_OS_dbgPrintf("wake_up_timestamp : %d ,fall_asleep_timestamp : %d \n",wake_up_timestamp,fall_asleep_timestamp); - CWM_OS_dbgPrintf("total_time[%d], total_deep_sleep_time[%d], total_mild_sleep_time[%d], total_rem_sleep_time[%d], total_wake_time[%d] \n", - total_time,total_deep_sleep_time,total_mild_sleep_time,total_rem_sleep_time,total_wake_time); + // CWM_OS_dbgPrintf("wake_up_timestamp : %d ,fall_asleep_timestamp : %d \n",wake_up_timestamp,fall_asleep_timestamp); + // CWM_OS_dbgPrintf("total_time[%d], total_deep_sleep_time[%d], total_mild_sleep_time[%d], total_rem_sleep_time[%d], total_wake_time[%d] \n", + // total_time,total_deep_sleep_time,total_mild_sleep_time,total_rem_sleep_time,total_wake_time); } @@ -359,7 +359,7 @@ void cywee_set_sleep_stat_data(cywee_inactivity_result_t c_inactivity_result_t) sleep_stat[stat_num].timestamp = timestamp; sleep_stat[stat_num].stat = c_inactivity_result_t.status; - CWM_OS_dbgPrintf("stat : %d , timestamp : %d \n", sleep_stat[stat_num].stat,sleep_stat[stat_num].timestamp); + // CWM_OS_dbgPrintf("stat : %d , timestamp : %d \n", sleep_stat[stat_num].stat,sleep_stat[stat_num].timestamp); if(sleep_stat[stat_num].stat == 0) //0进入睡眠 1潜睡 2深睡 3清醒 4结束睡眠 6入睡 7出睡最后一笔输出 8未出睡最后一笔输出 12快速动眼 13取消入睡 { if(fall_asleep_timestamp == 0) @@ -412,7 +412,7 @@ void cywee_restart_acc(void) { uint32_t tm = 0; uapi_get_timestampe_ss(&tm); - CWM_OS_dbgPrintf("cywee_restart_acc : %d \n",tm); + // CWM_OS_dbgPrintf("cywee_restart_acc : %d \n",tm); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = 1; @@ -452,7 +452,7 @@ void cywee_get_acc_switch(int cmd) void cywee_set_sedentary_switch(int cmd) { - CWM_OS_dbgPrintf("cywee_set_sedentary_switch : %d \n",cmd); + // CWM_OS_dbgPrintf("cywee_set_sedentary_switch : %d \n",cmd); //设置久坐 0关,1开 memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; @@ -583,14 +583,14 @@ uint8_t get_now_stand_count(void) return get_stand_count()+stand_falg; } void stand_history_save(void) { - CWM_OS_dbgPrintf("stand_history is saving\n"); + // CWM_OS_dbgPrintf("stand_history is saving\n"); CWM_OS_saveData_STAND_history(&stand_falg,sizeof(int)); } void step_history_save(void) { int data = get_step_data(); - CWM_OS_dbgPrintf("step_history is saving\n"); + // CWM_OS_dbgPrintf("step_history is saving\n"); CWM_OS_saveData_history(&data,&history_step_,sizeof(int),CYWEE_SAVE_DATA_STEP); } @@ -599,7 +599,7 @@ void calories_history_save(void) { int data= get_calories_data(); float history_calories = (float)data; - CWM_OS_dbgPrintf("history_calories is saving\n"); + // CWM_OS_dbgPrintf("history_calories is saving\n"); CWM_OS_saveData_history(&history_calories,&history_calories_,sizeof(float),CYWEE_SAVE_DATA_CALORIES); } @@ -607,7 +607,7 @@ void distances_history_save(void) { int data= get_distance_data(); float history_distances_now = (float)data / 1000.0; - CWM_OS_dbgPrintf("history_distances is saving\n"); + // CWM_OS_dbgPrintf("history_distances is saving\n"); CWM_OS_saveData_history(&history_distances_now,&history_distances_,sizeof(float),CYWEE_SAVE_DATA_DISTANCE); } @@ -616,7 +616,7 @@ void fat_history_save(void) int data= get_fat_time_data(); uint16_t temp_data=0; temp_data = data / 60; - CWM_OS_dbgPrintf("history_fat is saving\n"); + // CWM_OS_dbgPrintf("history_fat is saving\n"); CWM_OS_saveData_history(&temp_data,&history_fat_,sizeof(uint16_t),CYWEE_SAVE_DATA_FAT); } @@ -717,7 +717,7 @@ void cywee_reset_daily_data(void) //INT[1] : 0 立即输出,但不中止睡眠。 1 立即输出且中止睡眠 void cywee_get_sleep_data(int cmd) { - CWM_OS_dbgPrintf("cywee_get_sleep_data\n"); + // CWM_OS_dbgPrintf("cywee_get_sleep_data\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = cmd; @@ -736,8 +736,8 @@ void cywee_set_user_info(void) scl.iData[3] = user_info[2]; scl.iData[4] = user_info[3]; scl.iData[5] = user_info[4]; - CWM_OS_dbgPrintf("set user info : age[%d] , sex[%d] , weight[%d] , height[%d] , method[%d] \r\n", - user_info[0],user_info[1],user_info[2],user_info[3],user_info[4]); + // CWM_OS_dbgPrintf("set user info : age[%d] , sex[%d] , weight[%d] , height[%d] , method[%d] \r\n", + // user_info[0],user_info[1],user_info[2],user_info[3],user_info[4]); CWM_SettingControl(SCL_USER_INFO, &scl); } @@ -764,9 +764,9 @@ void cywee_time_sync(void) time(&rawtime); timeinfo = localtime(&rawtime); - 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); + // 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); current_year = timeinfo->tm_year+1900; @@ -806,7 +806,7 @@ void cywee_time_sync(void) void cywee_hrs_update(int hrs_data) { // hrs = hrs_data; - CWM_OS_dbgPrintf("hrs_data : %d\r\n",hrs_data); + // CWM_OS_dbgPrintf("hrs_data : %d\r\n",hrs_data); memset(&csd, 0, sizeof(CUSTOM_HEARTRATE)); csd.sensorType = CUSTOM_HEARTRATE; csd.fData[0] = hrs_data; @@ -815,7 +815,7 @@ void cywee_hrs_update(int hrs_data) void cywee_oncharging_update(int oncharging_status) { - CWM_OS_dbgPrintf("oncharging : %d\r\n",oncharging_status); + // CWM_OS_dbgPrintf("oncharging : %d\r\n",oncharging_status); memset(&csd, 0, sizeof(CUSTOM_ON_CHARGING)); csd.sensorType = CUSTOM_ON_CHARGING; csd.fData[0] = oncharging_status; @@ -830,7 +830,7 @@ void cywee_wearstatus_update(int wearstatus) csd.sensorType = CUSTOM_OFFBODY_DETECT; csd.fData[0] = wearstatus; CWM_CustomSensorInput(&csd); - CWM_OS_dbgPrintf("111wearstatus : %d\r\n",wearstatus); + // CWM_OS_dbgPrintf("111wearstatus : %d\r\n",wearstatus); #endif } @@ -869,7 +869,7 @@ void cywee_inactivity_mode_change(int mode) //久坐和有效站立 case INACTIVITY_MODE_SEDENTARY: - CWM_OS_dbgPrintf("INACTIVITY_MODE_SEDENTARY\r\n"); + // CWM_OS_dbgPrintf("INACTIVITY_MODE_SEDENTARY\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = 1; @@ -878,7 +878,7 @@ void cywee_inactivity_mode_change(int mode) //睡眠 case INACTIVITY_MODE_SLEEPING: - CWM_OS_dbgPrintf("INACTIVITY_MODE_SLEEPING\r\n"); + // CWM_OS_dbgPrintf("INACTIVITY_MODE_SLEEPING\r\n"); //设置睡眠 memset(&scl, 0, sizeof(scl)); @@ -899,7 +899,7 @@ void cywee_inactivity_mode_change(int mode) //久坐、有效站立和小睡 case INACTIVITY_MODE_SEDENTARY_AND_NAP: - CWM_OS_dbgPrintf("INACTIVITY_MODE_SEDENTARY_AND_NAP\r\n"); + // CWM_OS_dbgPrintf("INACTIVITY_MODE_SEDENTARY_AND_NAP\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = 3; @@ -910,7 +910,7 @@ void cywee_inactivity_mode_change(int mode) //小睡 case INACTIVITY_MODE_NAP: - CWM_OS_dbgPrintf("INACTIVITY_MODE_NAP\r\n"); + // CWM_OS_dbgPrintf("INACTIVITY_MODE_NAP\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = 4; @@ -928,7 +928,7 @@ void cywee_activity_mode_change(int mode) { //一般模式(生活模式) case SPORT_ACTIVE_MODE_NORMAL: - CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_NORMAL\r\n"); + // CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_NORMAL\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = SPORT_ACTIVE_MODE_NORMAL; @@ -937,7 +937,7 @@ void cywee_activity_mode_change(int mode) //跑步机 case SPORT_ACTIVE_MODE_TREADMILL: - CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_TREADMILL\r\n"); + // CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_TREADMILL\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = SPORT_ACTIVE_MODE_TREADMILL; @@ -946,7 +946,7 @@ void cywee_activity_mode_change(int mode) //户外跑步 case SPORT_ACTIVE_MODE_OUTDOOR_RUNNING: - CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_OUTDOOR_RUNNING\r\n"); + // CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_OUTDOOR_RUNNING\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = SPORT_ACTIVE_MODE_OUTDOOR_RUNNING; @@ -955,7 +955,7 @@ void cywee_activity_mode_change(int mode) //室内跑步 case SPORT_ACTIVE_MODE_INDOOR_RUNNING: - CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_INDOOR_RUNNING\r\n"); + // CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_INDOOR_RUNNING\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = SPORT_ACTIVE_MODE_INDOOR_RUNNING; @@ -972,7 +972,7 @@ void cywee_activity_mode_change(int mode) //自由运动 case SPORT_ACTIVE_MODE_FREE_TRAINING: - CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_FREE_TRAINING\r\n"); + // CWM_OS_dbgPrintf("SPORT_ACTIVE_MODE_FREE_TRAINING\r\n"); memset(&scl, 0, sizeof(scl)); scl.iData[0] = 1; scl.iData[1] = SPORT_ACTIVE_MODE_FREE_TRAINING; @@ -1099,21 +1099,21 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { CWM_OS_dbgPrintf("IDX_ALGO_SEDENTARY\n"); break; case IDX_ALGO_WATCH_HANDUP: - CWM_OS_dbgPrintf("HANDUP_DOWN MSG [%d]\n",(int)sensorEVT->fData[1]); + // CWM_OS_dbgPrintf("HANDUP_DOWN MSG [%d]\n",(int)sensorEVT->fData[1]); if ((int)sensorEVT->fData[1] == 2) { #if defined(SUPPORT_POWER_MANAGER) if(!uapi_dev_runtime_get_mmc_status_flag()) //非指南针界面 才开启翻腕灭屏 { - CWM_OS_dbgPrintf("[cwyee] turn_off_screen \n"); + // CWM_OS_dbgPrintf("[cwyee] turn_off_screen \n"); mmi_screen_on_off_by_flip_wrist(false); } #endif }else if ((int)sensorEVT->fData[1] == 1) { #if defined(SUPPORT_POWER_MANAGER) - CWM_OS_dbgPrintf("[cwyee] turn_on_screen \n"); + // CWM_OS_dbgPrintf("[cwyee] turn_on_screen \n"); mmi_screen_on_off_by_flip_wrist(true); #endif } @@ -1174,7 +1174,7 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { } cywee_func = cywee_get_send_msg_callback_func(); - CWM_OS_dbgPrintf("IDX_ALGO_INACTIVITY_OUTPUT\n"); + // CWM_OS_dbgPrintf("IDX_ALGO_INACTIVITY_OUTPUT\n"); if((int)sensorEVT->fData[0] == 20) { @@ -1221,7 +1221,7 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { // sleep_flag_t.stat = c_inactivity_result_t.status; // // uapi_save_sleep_flag(&sleep_flag_t,sizeof(SLEEP_FLAG_T)); // } - CWM_OS_dbgPrintf("c_inactivity_result_t.status : %d \n", c_inactivity_result_t.status); + // CWM_OS_dbgPrintf("c_inactivity_result_t.status : %d \n", c_inactivity_result_t.status); //0进入睡眠 1潜睡 2深睡 3清醒 4结束睡眠 6入睡 7出睡最后一笔输出 9未出睡最后一笔输出 12快速动眼 13取消入睡 if(c_inactivity_result_t.status >= 6 && c_inactivity_result_t.status <= 9) { @@ -1339,7 +1339,7 @@ void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { }else if((int)sensorEVT->fData[0] == 102) { uapi_get_timestampe_ss(&tm); - CWM_OS_dbgPrintf("ar alert type : %d tm :%d \n",(int)sensorEVT->fData[1],tm); + // CWM_OS_dbgPrintf("ar alert type : %d tm :%d \n",(int)sensorEVT->fData[1],tm); int ar_alert_type = (int)sensorEVT->fData[1]; CustomEventPublish(TOPIC_EVENT_AR_ALERT_TYPE_UPDATE,&ar_alert_type,sizeof(int)); diff --git a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c index 50ae4ae0c..1155c3332 100644 --- a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c +++ b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c @@ -315,7 +315,11 @@ static void custom_cmd_service_check_task(void const *arg) case CUSTOM_CMD_MSG_CAT1_AUDIO_STOP: cat1_audio_AudioRelease(); break; - + + case CUSTOM_CMD_MSG_TYPE_AGING_TEST: + HandleUpdatelcdMode(4);; + break; + default: PRINT("Unknown CUSTOM_CMD_MSG cmd 0x%02X \r\n", mail.cmd); break; diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.h b/code/sdk/drivers/peripheral/utils/custom_utils.h index 6926468af..3a0b9720b 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.h +++ b/code/sdk/drivers/peripheral/utils/custom_utils.h @@ -237,6 +237,8 @@ uint32_t uapi_calendar_store_date(void); #define CUSTOM_CMD_MSG_CAT1_AUDIO_START 0x13 #define CUSTOM_CMD_MSG_CAT1_AUDIO_STOP 0x14 + +#define CUSTOM_CMD_MSG_TYPE_AGING_TEST 0x15 typedef enum { BR_HFP_CONNECT=1, BR_HFP_DISCONNECT, -- 2.17.1