{
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;
}
}
{
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;
}
* @Author: penglei 1624952103@qq.com\r
* @Date: 2024-08-23 10:50:37\r
* @LastEditors: penglei 1624952103@qq.com\r
- * @LastEditTime: 2024-09-18 18:29:11\r
+ * @LastEditTime: 2024-11-05 14:34:43\r
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h\r
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\r
*/\r
DEEPSLEEP,\r
\r
shutdown,\r
+ RESET,\r
FACTORYRESE,\r
#ifdef SUPPORT_A5133_SERVICE\r
RF5133,\r
+/*
+ * @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
#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 <iostream>
-
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;
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
* @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:
*
}
break;
+ case 4:
+ if( testView::GetInstance())
+ {
+ testView::GetInstance()->ChangeView(TESTVIEW,OLDTEST);
+ factorytest_hide_test_lcd_button();
+ }
+ break;
+
default:
break;
}
\r
#include "audio_capture_wrapper.h"\r
#include "cywee_service.h"\r
+#include "factorytest_protocol.h"\r
+#include "custom_runtime.h"\r
+\r
namespace OHOS\r
{\r
\r
uapi_poweroff_device();\r
return true;\r
}\r
+ if(strcmp(view.GetViewId(),"reset") == 0)\r
+ {\r
+ uapi_reboot_device();\r
+ return true;\r
+ }\r
if(strcmp(view.GetViewId(),"deepsleep") == 0)\r
{\r
//TODO: close bt and cat1 , then deepsleep\r
}\r
if(strcmp(view.GetViewId(),"addvolume") == 0)\r
{ \r
-\r
testmicrohoneView::GetInstance()->addvolumebuttoncallback();\r
}\r
+ if(strcmp(view.GetViewId(),"start") == 0)\r
+ { \r
+ if(uapi_dev_runtime_get_cat1_powerstat())\r
+ uapi_set4GCapability(false);\r
+ factorytest_start_aging_test();\r
+ }\r
+ if(strcmp(view.GetViewId(),"stop") == 0)\r
+ { \r
+ factorytest_stop_aging_test();\r
+ }\r
#ifdef SUPPORT_A5133_SERVICE\r
if(strcmp(view.GetViewId(),"receive") == 0)\r
{ \r
{OLDTEST,"oldtestbutton","aging" ,"oldtestexit",&testView::ChangeoldTESTView,true},\r
{DEEPSLEEP,"deepsleep","DeepSleepCurrent","xxxxxxxxx" ,&testView::ChangeoldTESTView,true},\r
{shutdown,"shutdown","shutdown", "xxxxxxxxx",&testView::ChangeoldTESTView,true},\r
+ {RESET,"reset","reset", "xxxxxxxxx",&testView::ChangeoldTESTView,true},\r
{FACTORYRESE,"FactoryReset","FactoryReset","xxxxxxxxx", &testView::ChangeoldTESTView,true},\r
#ifdef SUPPORT_A5133_SERVICE\r
{RF5133,"RF5133","RF5133", "xxxxxxxxx",&testView::ChangeA5133TESTView,true},\r
#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<UIView::OnClickListener *>(testPresenter::GetInstance());
+ button->SetOnClickListener(touchListener);
+
+ // UIView::OnDragListener *drgListener = static_cast<UIView::OnDragListener *>(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)
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;
}
}
return testoldScrollView;
}
+
+
}
\ No newline at end of file
* @Author: penglei 1624952103@qq.com\r
* @Date: 2024-06-17 14:31:08\r
* @LastEditors: penglei 1624952103@qq.com\r
- * @LastEditTime: 2024-11-01 20:49:51\r
+ * @LastEditTime: 2024-11-05 16:43:04\r
* @FilePath: /FD230/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c\r
* @Description: \r
* \r
uint8_t testitem;\r
}factorytest_cmd_header_t;\r
\r
-typedef struct\r
-{\r
- uint32_t charge_error; //充电失败次数 \r
- uint32_t speaker_error; //spk失败次数 \r
- uint32_t mic_error; //mic失败次数 \r
- uint32_t motor_error; //马达失败次数 \r
- uint32_t mag_error; //磁力计失败次数 \r
- uint32_t ppg_error; //ppg失败次数\r
- uint32_t gsensor_error; //gsensor失败次数\r
- uint32_t crown_error; //表冠失败次数\r
- uint32_t tp_error; //tp失败次数\r
- uint32_t display_error; //LCD失败次数\r
- uint32_t fail_num; //总失败次数\r
- uint32_t executions_num;//执行次数 \r
- uint32_t left_time; //剩余时间\r
- uint32_t target_time; //目标时间\r
- uint32_t flag; //老化测试状态 (未开始 - 0, 已开始 - 1, 停止 - 2,完成 - 3)\r
-} ble_aging_t;\r
+\r
\r
#pragma pack()\r
\r
6);\r
}\r
\r
+static uint8_t aging_start_flag = 0;\r
+\r
+void factorytest_start_aging_test(void)\r
+{\r
+ if(aging_start_flag == 1)\r
+ return;\r
+ \r
+ aging_start_flag = 1;\r
+\r
+ if(aging_t.flag == 2)\r
+ {\r
+ aging_t.flag = 1;\r
+ }\r
+ else\r
+ {\r
+ memset(&aging_t, 0, sizeof(ble_aging_t));\r
+ aging_t.target_time = 6 * 60 * 60; //老化时间6小时\r
+ aging_time = aging_t.target_time;\r
+ aging_t.left_time = aging_time;\r
+ do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_AGING_DATA_SAVE, NULL, 0);\r
+ aging_test_init();\r
+ }\r
+\r
+}\r
+\r
+void factorytest_stop_aging_test(void)\r
+{\r
+ aging_t.flag = 2;\r
+ aging_start_flag = 0;\r
+}\r
+\r
+void factorytest_get_aging_data(ble_aging_t *data)\r
+{\r
+ memset_s(data,sizeof(ble_aging_t),0,sizeof(ble_aging_t));\r
+ memcpy_s(data,sizeof(ble_aging_t),&aging_t,sizeof(ble_aging_t));\r
+}\r
+\r
void factorytest_save_aging_data(void)\r
{\r
uapi_save_file_data("user/userdata/aging_test.bin",&aging_t,sizeof(ble_aging_t),"wb");\r
}\r
cmd = 5;\r
do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_LCD_COLOR_TEST,&cmd,sizeof(cmd));\r
+\r
+ do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_AGING_TEST,NULL,0);\r
+ \r
// /*********************TP 老化测试*****************************/\r
//读TP ID\r
uint16_t tp_id;\r
{\r
//进入老化命令\r
uint8_t send_data = 0x00;\r
- memset(&aging_t, 0, sizeof(ble_aging_t));\r
- aging_t.target_time = 6 * 60 * 60; //老化时间6小时\r
- aging_time = aging_t.target_time;\r
- aging_test_init();\r
+ factorytest_start_aging_test();\r
factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
BLE_TEST_CMD_SOFT_TEST_SUB_MODE_AGING_TEST,\r
0x01,\r
//停止老化\r
uint8_t send_data = 0x00;\r
\r
- aging_t.flag = 2;\r
+ factorytest_stop_aging_test();\r
\r
factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST,\r
BLE_TEST_CMD_SOFT_TEST_SUB_MODE_AGING_TEST,\r
//软件测试 子模式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
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);
+
/**
* @}
*/
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
}
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;
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:
}
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));
}
{
// 久坐
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);
// 小睡
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)
{
// 睡眠累计
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)
break;
case CYWEE_SERVICE_CMD_NORMAL_MODE:
- PRINT("普通运动模式\r\n");
+ // PRINT("普通运动模式\r\n");
cywee_activity_mode_change(SPORT_ACTIVE_MODE_NORMAL);
break;
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;
break;
case CYWEE_SERVICE_CMD_FREE_TRAINING_MODE:
- PRINT("自由训练模式\r\n");
+ // PRINT("自由训练模式\r\n");
cywee_activity_mode_change(SPORT_ACTIVE_MODE_FREE_TRAINING);
break;
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);
}
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);
}
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)
{
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;
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;
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);
}
{
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);
}
{
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);
}
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);
}
//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;
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);
}
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;
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;
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;
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
}
//久坐和有效站立
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;
//睡眠
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));
//久坐、有效站立和小睡
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;
//小睡
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;
{
//一般模式(生活模式)
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;
//跑步机
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;
//户外跑步
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;
//室内跑步
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;
//自由运动
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;
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
}
}
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)
{
// 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)
{
}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));
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;
#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,