From: hcj <1224667075@qq.com> Date: Tue, 26 Mar 2024 08:40:00 +0000 (+0800) Subject: cat1升级 X-Git-Tag: release_V1.2.70_20241020_135402~1250^2~7^2~1 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=5394e262cd6764d3f75b77423cd96dd69907a673;p=mirrors%2FFD230.git cat1升级 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h index 8cde88931..b78101377 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h @@ -11,6 +11,14 @@ namespace OHOS { class ConfigModel { + struct cat1_msg_config + { + char * imei; + int sim; + char * oper; + //uint8_t signal; + }; + public: static ConfigModel *GetInstance(); cJSON *GetcJSON(void); @@ -35,8 +43,13 @@ namespace OHOS void SetDialId(uint8_t id); int GetDialId(); char * Getimei(); + char* GetpyVer(); + char* GetmoderVer(); void Setimei(char *str); - /* -------------------------------------------------------------------------- */ + void SetpyVer(char *str); + void SetmoderVer(char *str); + + // -------------------------------------------------------------------------- */ private: ConfigModel(); // 私有构造函数,确保无法在外部实例化 ConfigModel(const ConfigModel &) = delete; // 禁止拷贝构造 @@ -54,6 +67,10 @@ namespace OHOS int HeartRateOrBloodOxygenQuickAccessSwitch{0}; // 心率或血氧快速访问开关,默认快速访问血氧打开 int dialid; char * imei_str=NULL; + char * pyVer=NULL; + char * moderVer=NULL; + + cat1_msg_config cat1_msg_config_t; /* -------------------------------------------------------------------------- */ }; diff --git a/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp index 51690d413..e29244f11 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp @@ -147,7 +147,19 @@ namespace OHOS return imei_str; } - void ConfigModel::Setimei(char *str) + char* ConfigModel::GetpyVer() + { + + return pyVer; + } + char* ConfigModel::GetmoderVer() + { + + return moderVer; + } + + + void ConfigModel::Setimei(char *str) { if(imei_str==NULL || strcmp(imei_str,str)!=0) { @@ -158,11 +170,48 @@ namespace OHOS } else { + memset(imei_str,0,strlen(imei_str)); strcpy(imei_str,str); } } return ; } + + void ConfigModel::SetpyVer(char *str) + { + if(pyVer==NULL || strcmp(pyVer,str)!=0) + { + if(pyVer==NULL) + { + pyVer=(char*)malloc(strlen(str)); + strcpy(pyVer,str); + } + else + { + memset(pyVer,0,strlen(pyVer)); + strcpy(pyVer,str); + } + } + return ; + } + + void ConfigModel::SetmoderVer(char *str) + { + if(moderVer==NULL || strcmp(moderVer,str)!=0) + { + if(moderVer==NULL) + { + moderVer=(char*)malloc(strlen(str)); + strcpy(moderVer,str); + } + else + { + memset(moderVer,0,strlen(moderVer)); + strcpy(moderVer,str); + } + } + return ; + } /* ------------------------------ ImageAnimator ----------------------------- */ ImageAnimator::ImageAnimator() diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h index 1f8f77953..643d8a66a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h @@ -7,6 +7,7 @@ #include "components/ui_label.h" #include "components/ui_image_view.h" #include "producttest/include/testLCD.h" +#include "components/ui_label_button_ext.h" //#include "cmsis_os.h" #include namespace OHOS @@ -26,6 +27,7 @@ namespace OHOS bool testLCDScrollViewcrollViewinit(void); UIScrollView *testLCDScrollView{nullptr}; bool initViewStatus{false}; + UILabelButtonExt* labelButton_next = nullptr; }; } #endif \ No newline at end of file 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 e11ce9a4f..6f462af64 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h @@ -14,6 +14,7 @@ #include "producttest/include/testmakephone.h" #include "producttest/include/testcat1.h" #include "producttest/include/testhrsenson.h" +#include "components/ui_label_button_ext.h" #include "common/key_code.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h index f6d26d67a..befe67f33 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h @@ -9,6 +9,7 @@ #include "components/ui_image_view.h" #include "producttest/include/testTP.h" #include "producttest/include/testPresenter.h" +#include "components/ui_label_button_ext.h" //#include "cmsis_os.h" #include namespace OHOS @@ -38,6 +39,7 @@ namespace OHOS bool testTPScrollViewcrollViewinit(void); UIScrollView *testTPScrollView{nullptr}; bool initViewStatus{false}; + UILabelButtonExt* labelButton_next = nullptr; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h index 164ce47ae..f1ba437da 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h @@ -96,10 +96,6 @@ namespace OHOS testAboutView *test_about_view; UIScrollView *SystemScrollView[20]{nullptr}; UILabel *SystemLabel{nullptr}; // 标题 - UIButton *AboutTheWatchButton{nullptr}; - UIButton *SuperviseButton = {nullptr}; - UIButton *SystemLanguageButton = {nullptr}; - UIButton *FactoryResetButton{nullptr}; UILabelButtonExt *SystemUpgradeButtonExt{nullptr}; testLCDView *test_LCD_view{nullptr}; @@ -112,9 +108,9 @@ namespace OHOS testbuttonView *test_KEY_view{nullptr}; testMagicView *test_MG_view{nullptr}; testhrsenson1View *test_hr_view{nullptr}; - testmakephoneView *test_MP_view{nullptr}; - + + UILabelButtonExt *button[10]={NULL}; bool initViewStatus{false}; }; } // namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h index 868b248b8..135aceff2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h @@ -7,6 +7,7 @@ #include "components/ui_label.h" #include "components/ui_image_view.h" #include "producttest/include/testabout.h" +#include "components/ui_label_button_ext.h" #include namespace OHOS { @@ -31,6 +32,7 @@ namespace OHOS UIScrollView *SystemAbouTheWatchtInitIView(void); void ClearAll(void); UILabel *InitLabel(LabelConfig &labelConfig); + UILabelButtonExt* init_button_next(int x,int y,char *view_id); private: bool testAboutTheWatchScrollViewinit(void); @@ -48,6 +50,7 @@ namespace OHOS UILabel *LANAddress = nullptr; UILabel *FONTTitle = nullptr; UILabel *FONT = nullptr; + UILabelButtonExt* labelButton_next = nullptr; bool initViewStatus{false}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h index 84cca2e10..e92c4dfce 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h @@ -46,6 +46,8 @@ namespace OHOS UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); bool testBUTTONScrollViewcrollViewinit(void); UIScrollView *testBUTTONScrollView{nullptr}; + UILabelButtonExt* labelButton_next = nullptr; + UILabelButtonExt* button[2]{NULL}; bool initViewStatus{false}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h index e840bb11f..55da89952 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h @@ -86,9 +86,11 @@ namespace OHOS // UILabel *label_1_cat1msg_oper{nullptr}; // UILabel *label_1_cat1msg_sim{nullptr}; // UILabel *label_1_cat1msg_signal{nullptr}; - + UILabelButtonExt* labelButton_next = nullptr; UILabel *label_1_cat1vison{nullptr}; + UILabel *label_1_cat1vison_1{nullptr}; bool initViewStatus{false}; + UILabelButtonExt* button{NULL}; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h index 16c6d9864..66c80ed33 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h @@ -46,6 +46,7 @@ namespace OHOS bool testCHANINGScrollViewcrollViewinit(void); UIScrollView *testCHANINGScrollView{nullptr}; bool initViewStatus{false}; + UILabelButtonExt* labelButton_next = nullptr; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h index 0e7cb670f..ce8b5dc6b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h @@ -90,6 +90,7 @@ namespace OHOS UILabelButtonExt* button_2{NULL}; UILabel *label_hrsenson_value_vison{nullptr}; bool initViewStatus{false}; + UILabelButtonExt* labelButton_next = nullptr; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h index 554953a2b..7f1a9ec4f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h @@ -10,6 +10,7 @@ #include "producttest/include/testTP.h" #include "producttest/include/testPresenter.h" #include "components/ui_slider.h" +#include "components/ui_label_button_ext.h" //#include "cmsis_os.h" #include namespace OHOS @@ -33,6 +34,8 @@ namespace OHOS UIScrollView *testLUMScrollView{nullptr}; bool initViewStatus{false}; UISlider *BrightnessControlViewSlider = nullptr; + + UILabelButtonExt* labelButton_next = nullptr; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h index 7188c9350..18e8eaf16 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h @@ -8,6 +8,7 @@ #include "components/ui_image_view.h" #include "producttest/include/testmagnetic.h" #include "CompassModel.h" +#include "components/ui_label_button_ext.h" //#include "cmsis_os.h" #include @@ -46,6 +47,8 @@ namespace OHOS UILabel *x{nullptr}; // “手表名称” UILabel *y{nullptr}; UILabel *z{nullptr}; // "固件版本" + + UILabelButtonExt* labelButton_next = nullptr; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmakephone.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmakephone.h index 707385e3c..65294bf50 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmakephone.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmakephone.h @@ -47,6 +47,8 @@ namespace OHOS UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); bool testphoneScrollViewcrollViewinit(void); UIScrollView *testmakephoneScrollView{nullptr}; + UILabelButtonExt* labelButton_next = nullptr; + UILabelButtonExt* button{NULL}; bool initViewStatus{false}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h index f1699035a..ad1897919 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h @@ -9,6 +9,7 @@ #include "components/ui_image_view.h" #include "components/ui_label_button_ext.h" #include "producttest/include/testPresenter.h" +#include "components/ui_label_button_ext.h" //#include "cmsis_os.h" #include namespace OHOS @@ -46,6 +47,8 @@ namespace OHOS UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); bool testMOTORScrollViewcrollViewinit(void); UIScrollView *tesMOTORScrollView{nullptr}; + UILabelButtonExt* labelButton_next = nullptr; + UILabelButtonExt* button[2]{NULL}; bool initViewStatus{false}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h index e31decfbb..a53287877 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h @@ -45,8 +45,10 @@ namespace OHOS private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); bool tesSPEAKScrollViewcrollViewinit(void); - UIScrollView *testSOEAKScrollView{nullptr}; + UIScrollView *testSPEAKScrollView{nullptr}; bool initViewStatus{false}; + UILabelButtonExt* labelButton_next = nullptr; + UILabelButtonExt* button[2]{NULL}; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp index e4fe65fc7..51bbd1f5d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp @@ -28,17 +28,37 @@ namespace OHOS return g_pSystemAboutTheWatchView; } - + static osTimerId_t MG_TEST_timer=NULL; void testLCDView::ClearAll() { - if (initViewStatus == true) - { - } - } + if(testLCDScrollView) + { + + if(MG_TEST_timer!=NULL) + { + osTimerStop(MG_TEST_timer); + int ret= osTimerDelete(MG_TEST_timer); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "osTimerDelete %d",ret); + MG_TEST_timer = NULL; + + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + + delete testLCDScrollView; + testLCDScrollView=nullptr; + } + } + void colorTimerCallBack(int data) { - testLCDView::GetInstance()->set_LCD_color(); + testLCDView* t= testLCDView::GetInstance(); + if(t!=NULL) + t->set_LCD_color(); } uint8_t LCD_TEST_FALG=0; void testLCDView :: set_LCD_color(void) @@ -51,7 +71,7 @@ namespace OHOS case 1: testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full); break; - case 3: + case 2: testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Yellow().full); break; default: @@ -62,7 +82,7 @@ namespace OHOS } - static osTimerId_t MG_TEST_timer=NULL; + bool testLCDView::testLCDScrollViewcrollViewinit(void) { uint32_t tick; @@ -79,6 +99,10 @@ namespace OHOS testLCDScrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"TPButton_next"); + testLCDScrollView->Add(labelButton_next); + LCD_TEST_FALG=0; MG_TEST_timer = osTimerNew((osTimerFunc_t)colorTimerCallBack, osTimerPeriodic, NULL, NULL); @@ -104,7 +128,7 @@ namespace OHOS testLCDScrollView->SetTouchable(true); testLCDScrollView->SetDraggable(false); - + return true; } 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 c98ba2c93..f730e39b1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -28,6 +28,7 @@ namespace OHOS { const int16_t viewId; char *viewid_str; + char *viewid_str_next; bool enable_falg; }; @@ -35,18 +36,18 @@ namespace OHOS // 2.ViewMapper[] 是一个静态的视图映射数组,将视图ID与MainStopWatchView类中的特定成员函数指针进行了绑定。 static TEST_ext_p ViewMapper_t[] = { - {VISON,"AboutTheWatchButton",true}, - {LCD,"SuperviseButton",true}, - {TP,"SystemLanguageButton",true}, - {MAGETIC,"MAGETICButton",true}, - {LUMINANCE,"luminanceButton",true}, - {CHAR,"chargingButton",true}, - {SPEAK,"speakButton",true}, - {MOTOR,"motorButton",true}, - {CAT1,"cat1button",true}, - {BUTTON,"buttonbutton",true}, - {MAKEPHONE,"makephonebutton",true}, - {HRSENSON,"hrsensonbutton",true}, + {VISON,"AboutTheWatchButton", "LCDButton_next",true}, + {LCD,"LCDButton", "TPButton_next",true}, + {TP,"TPButton", "MAGETICButton_next",true}, + {MAGETIC,"MAGETICButton", "luminanceButton_next",true}, + {LUMINANCE,"luminanceButton", "chargingButton_next",true}, + {CHAR,"chargingButton", "speakButton_next",true}, + {SPEAK,"speakButton", "motorButton_next",true}, + {MOTOR,"motorButton", "cat1button_next",true}, + {CAT1,"cat1button", "buttonbutton_next",true}, + {BUTTON,"buttonbutton", "makephonebutton_next",true}, + {MAKEPHONE,"makephonebutton", "hrsensonbutton_next",true}, + {HRSENSON,"hrsensonbutton", "xxxxxxxxxx",true}, }; // {FACTORYRESETVIEW,"FactoryResetButton",true}, // {SYSTEMLUPGRADE,"systemupgread",true}, @@ -146,18 +147,18 @@ namespace OHOS { return true; } - if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) - { - for (int i = 1; i < MAX_TESTVIEWID; i++) - { - if (p_SystemView->GetSystemScrollView(i) != nullptr && p_SystemView->GetSystemScrollView(i)->IsVisible() == true) - { - p_SystemView->ChangeView(i, TESTVIEW); - break; - } - } - return true; - } + // if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) + // { + // for (int i = 1; i < MAX_TESTVIEWID; i++) + // { + // if (p_SystemView->GetSystemScrollView(i) != nullptr && p_SystemView->GetSystemScrollView(i)->IsVisible() == true) + // { + // p_SystemView->ChangeView(i, TESTVIEW); + // break; + // } + // } + // return true; + // } return false; } @@ -168,6 +169,7 @@ namespace OHOS int len=sizeof(ViewMapper_t)/sizeof(TEST_ext_p); //int len=5; // 根据控件id查找是哪个控件触发了点击回调 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick"); for(int i=0;iChangeView(TESTVIEW, ViewMapper_t[i].viewId); return true; } + if(strcmp(view.GetViewId(),ViewMapper_t[i].viewid_str_next) == 0) + { + if(ViewMapper_t[i+1].enable_falg==true) + testView::GetInstance()->ChangeView(ViewMapper_t[i].viewId, ViewMapper_t[i+1].viewId); + return true; + } + } if(strcmp(view.GetViewId(),"speak_play") == 0) diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp index 360eb6041..55183fedd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp @@ -28,11 +28,27 @@ namespace OHOS return g_pSystemAboutTheWatchView; } - + static UIButton* button[16]={NULL}; void testTPView::ClearAll() { - if (initViewStatus == true) + if(testTPScrollView) { + testTPScrollView->RemoveAll(); + for(int i=9;i<16;i++) + { + if(button[i]!=NULL) + { + delete button[i]; + button[i]=NULL; + } + } + + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=NULL; + } + } } @@ -62,7 +78,7 @@ namespace OHOS - static UIButton* button[16]={NULL}; + char* viewid_str[]= { "TP_1", "TP_2", "TP_3", "TP_4", @@ -137,6 +153,8 @@ namespace OHOS testTPScrollView->SetTouchable(true); testTPScrollView->SetDraggable(true); + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"MAGETICButton_next"); + testTPScrollView->Add(labelButton_next); return true; } 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 996d90720..b489a3208 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp @@ -14,14 +14,13 @@ namespace OHOS char *Labe_str; bool (testView::*func)(int16_t thisView); }; - static UILabelButtonExt *button[10]={NULL}; - + // 2.ViewMapper[] 是一个静态的视图映射数组,将视图ID与MainStopWatchView类中的特定成员函数指针进行了绑定。 static test_ext ViewMapper_t[] = { {VISON,"AboutTheWatchButton","Verison",&testView::ChangeSystemAboutView}, - {LCD,"SuperviseButton","LCD",&testView::ChangeLCDTESTView}, - {TP,"SystemLanguageButton","TP", &testView::ChangeTPTESTView}, + {LCD,"LCDButton","LCD",&testView::ChangeLCDTESTView}, + {TP,"TPButton","TP", &testView::ChangeTPTESTView}, {MAGETIC,"MAGETICButton","Magetic", &testView::ChangeMGTESTView}, {LUMINANCE,"luminanceButton","luminance", &testView::ChangLUMTESTView}, {CHAR,"chargingButton","charging", &testView::ChangchargingTESTView}, @@ -63,34 +62,52 @@ namespace OHOS { if (initViewStatus == true) { - // SystemScrollView[SYSTEMVIEW]->RemoveAll(); + SystemScrollView[TESTVIEW]->RemoveAll(); // UIView::OnDragListener *draglistener = SystemScrollView[SYSTEMVIEW]->GetOnDragListener(); // if (draglistener != nullptr) // { // delete draglistener; // draglistener = nullptr; // } - // delete p_SystemAboutTheWatchView; - // p_SystemAboutTheWatchView = nullptr; - // delete p_SystemSuperviseView; - // p_SystemSuperviseView = nullptr; - // delete p_SystemLanguageView; - // p_SystemLanguageView = nullptr; - // delete p_SystemFactoryResetView; - // p_SystemFactoryResetView = nullptr; - // delete SystemLabel; - // SystemLabel = nullptr; - // delete AboutTheWatchButton; - // AboutTheWatchButton = nullptr; - // delete SuperviseButton; - // SuperviseButton = nullptr; - // delete SystemLanguageButton; - // SystemLanguageButton = nullptr; - // delete FactoryResetButton; - // FactoryResetButton = nullptr; - - // delete SystemScrollView[SYSTEMVIEW]; - // SystemScrollView[SYSTEMVIEW] = nullptr; + + int funcSize = sizeof(ViewMapper_t) / sizeof(ViewMapper_t[TESTVIEW]); + for (int i = 0; i < funcSize; i++) + { + if(button[i]) + { + delete button[i]; + button[i]=NULL; + } + } + delete test_about_view; + test_about_view = nullptr; + delete test_LCD_view; + test_LCD_view = nullptr; + delete test_TP_view; + test_TP_view = nullptr; + delete test_lum_view; + test_lum_view = nullptr; + delete test_charging_view; + test_charging_view = nullptr; + delete test_speak_view; + test_speak_view = nullptr; + delete test_motor_view; + test_motor_view = nullptr; + delete test_cat1_view; + test_cat1_view = nullptr; + delete test_KEY_view; + test_KEY_view = nullptr; + delete test_MG_view; + test_MG_view = nullptr; + delete test_hr_view; + test_hr_view = nullptr; + delete test_MP_view; + test_MP_view = nullptr; + delete SystemLabel; + SystemLabel = nullptr; + + delete SystemScrollView[TESTVIEW]; + SystemScrollView[TESTVIEW] = nullptr; } } @@ -133,7 +150,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemLabel new fail!"); return false; } - SystemLabel->SetPosition(203, 52); + SystemLabel->SetPosition(180, 52); SystemLabel->SetStyle(STYLE_BACKGROUND_OPA, 0xff); SystemLabel->SetStyle(STYLE_TEXT_FONT, 30); SystemLabel->SetStyle(STYLE_LINE_HEIGHT, 35); @@ -476,6 +493,65 @@ namespace OHOS ClickFunc(showView); SystemScrollView[showView]->SetVisible(true); Draw(); + // if(hideView!=0) + // { + // switch (hideView) + // { + // case VISON: + // delete test_about_view; + // test_about_view = nullptr; + // break; + // case LCD: + // delete test_LCD_view; + // test_LCD_view = nullptr; + // break; + // case TP: + // delete test_TP_view; + // test_TP_view = nullptr; + // break; + // case MAGETIC: + // delete test_MG_view; + // test_MG_view = nullptr; + // break; + // case LUMINANCE: + // delete test_lum_view; + // test_lum_view = nullptr; + // break; + // case CHAR: + // delete test_charging_view; + // test_charging_view = nullptr; + // break; + + // case SPEAK: + // delete test_speak_view; + // test_speak_view = nullptr; + // break; + // case MOTOR: + // delete test_motor_view; + // test_motor_view = nullptr; + // break; + // case CAT1: + // delete test_cat1_view; + // test_cat1_view = nullptr; + // break; + // case BUTTON: + // delete test_KEY_view; + // test_KEY_view = nullptr; + // break; + // case MAKEPHONE: + // delete test_MP_view; + // test_MP_view = nullptr; + // break; + // case HRSENSON: + // delete test_hr_view; + // test_hr_view = nullptr; + // break; + // default: + // break; + // } + // } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "change>>>>>>>>>>>>>"); + } /* -------------------------------------------------------------------------- */ @@ -503,6 +579,7 @@ namespace OHOS { SystemScrollView[TESTVIEW]->Add(button[i]); } + // SystemScrollView[SYSTEMVIEW]->Add(SuperviseButton); // SystemScrollView[SYSTEMVIEW]->Add(SystemLanguageButton); // SystemScrollView[SYSTEMVIEW]->Add(FactoryResetButton); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp index 05438c178..b17c56ca5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp @@ -57,11 +57,38 @@ namespace OHOS FONTTitle = nullptr; delete FONT; FONT = nullptr; + delete labelButton_next; + labelButton_next=nullptr; delete testAboutTheWatchScrollView; testAboutTheWatchScrollView = nullptr; } } + + UILabelButtonExt *testAboutView:: init_button_next(int x,int y,char *view_id) + { + + UILabelButtonExt *label_button = new UILabelButtonExt(); + if (label_button == nullptr) + { + return nullptr; + } + label_button->SetPosition(x, y); // widget's left position and top position + label_button->Resize(135, 88); // widget's width and height + label_button->SetViewId(view_id);// Set style + + // Set additional property + label_button->SetText("next"); + label_button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 44); + label_button->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + UIView::OnClickListener *touchListener = static_cast(testPresenter::GetInstance()); + label_button->SetOnClickListener(touchListener); + // Add to rootView + label_button->SetVisible(true); + + return label_button; + + } UILabel *testAboutView::InitLabel(LabelConfig &labelConfig) { UILabel *label = new UILabel(); @@ -367,6 +394,10 @@ namespace OHOS LANAddress->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); testAboutTheWatchScrollView->Add(LANAddress); initViewStatus = true; + + labelButton_next =init_button_next(165, 960,"LCDButton_next"); + + testAboutTheWatchScrollView->Add(labelButton_next); return testAboutTheWatchScrollView; } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp index 855b055d0..2c4f55eda 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp @@ -31,9 +31,30 @@ namespace OHOS void testbuttonView::ClearAll() { - if (initViewStatus == true) + if(testBUTTONScrollView) { - } + testBUTTONScrollView->RemoveAll(); + + if(button[0]) + { + delete button[0]; + button[0]=nullptr; + } + if(button[1]) + { + delete button[1]; + button[1]=nullptr; + } + + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + + delete testBUTTONScrollView; + testBUTTONScrollView=nullptr; + } } UILabelButtonExt *testbuttonView::SetTheButton_ext(ButtonConfig_ext_t &buttonconfig) @@ -67,11 +88,11 @@ namespace OHOS } - static UILabelButtonExt* button[2]{NULL}; + void testbuttonView::Changbutton(int i,bool falg) { - if(button!=NULL) + if(button[0]!=NULL) { if(i==0) @@ -170,7 +191,8 @@ namespace OHOS // } // testcat1ScrollView->SetOnDragListener(draglistener); - + labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,"makephonebutton_next"); + testBUTTONScrollView->Add(labelButton_next); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp index cf0253a92..d9042775d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp @@ -33,9 +33,42 @@ namespace OHOS void testcat1View::ClearAll() { - if (initViewStatus == true) + if(testcat1ScrollView) { - } + testcat1ScrollView->RemoveAll(); + + if(button) + { + delete button; + button=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + if(label_1_cat1msg_1) + { + delete label_1_cat1msg_1; + label_1_cat1msg_1=nullptr; + } + + if(label_1_cat1vison) + { + delete label_1_cat1vison; + label_1_cat1vison=nullptr; + } + + if(label_1_cat1vison_1) + { + delete label_1_cat1vison_1; + label_1_cat1vison_1=nullptr; + } + + + delete testcat1ScrollView; + testcat1ScrollView=nullptr; + } } void testcat1View:: setcat1msg(cat1_msg t) { @@ -97,7 +130,7 @@ namespace OHOS static bool speakfalg=false; - static UILabelButtonExt* button{NULL}; + char *phone="112"; void testcat1View::dial_112(bool falg) @@ -170,12 +203,12 @@ namespace OHOS Config = { .left = 50, .top = 200, - .width = 60, + .width = 200, .height = 35, .fontSize = 30, .lineHeigh = 35, .text = "", - .lineBreakMode = UILabel::LINE_BREAK_ADAPT, + .lineBreakMode = UILabel::LINE_BREAK_WRAP, }; label_1_cat1vison= InitLabel(Config); if (label_1_cat1vison == nullptr) @@ -184,10 +217,9 @@ namespace OHOS return false; } testcat1ScrollView->Add(label_1_cat1vison); - Config = { .left = 50, - .top = 200, + .top = 250, .width = 60, .height = 35, .fontSize = 30, @@ -195,13 +227,13 @@ namespace OHOS .text = "", .lineBreakMode = UILabel::LINE_BREAK_ADAPT, }; - label_1_cat1vison= InitLabel(Config); - if (label_1_cat1vison == nullptr) + label_1_cat1vison_1= InitLabel(Config); + if (label_1_cat1vison_1 == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); return false; } - testcat1ScrollView->Add(label_1_cat1vison); + testcat1ScrollView->Add(label_1_cat1vison_1); @@ -248,6 +280,8 @@ namespace OHOS // } // testcat1ScrollView->SetOnDragListener(draglistener); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,"buttonbutton_next"); + testcat1ScrollView->Add(labelButton_next); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp index ba212f367..a71364d83 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp @@ -28,11 +28,26 @@ namespace OHOS return g_pSystemAboutTheWatchView; } - + static UILabelButtonExt* button{NULL}; void testCHANINGView::ClearAll() { - if (initViewStatus == true) + if(testCHANINGScrollView) { + testCHANINGScrollView->RemoveAll(); + + if(button) + { + delete button; + button=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + + delete testCHANINGScrollView; + testCHANINGScrollView=nullptr; } } @@ -67,7 +82,7 @@ namespace OHOS - static UILabelButtonExt* button{NULL}; + void testCHANINGView::ChangeViewcolor(bool falg) @@ -77,12 +92,12 @@ namespace OHOS if(falg==true) { button->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); - button->SetText("usb::0"); + button->SetText("usb::1"); } else { button->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full); - button->SetText("usb::1"); + button->SetText("usb::0"); } RootView::GetInstance()->Invalidate(); @@ -132,6 +147,8 @@ namespace OHOS testCHANINGScrollView->SetTouchable(true); testCHANINGScrollView->SetDraggable(false); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,378,"speakButton_next"); + testCHANINGScrollView->Add(labelButton_next); return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp index ddd63663f..f82777e87 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp @@ -34,9 +34,35 @@ namespace OHOS void testhrsenson1View::ClearAll() { - if (initViewStatus == true) - { - } + if(testhrsensonScrollView) + { + if(label_hrsenson_value_vison) + { + delete label_hrsenson_value_vison; + label_hrsenson_value_vison=nullptr; + } + if(button_1) + { + delete button_1; + button_1=nullptr; + } + if(button_2) + { + delete button_2; + button_2=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + + delete testhrsensonScrollView; + testhrsensonScrollView=nullptr; + + + } + } static bool button_falg=true; void testhrsenson1View:: setgrayvalue(int g,int r,int ir) diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp index 9b17e0c87..446b886d3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp @@ -31,8 +31,23 @@ namespace OHOS void testLUMView::ClearAll() { - if (initViewStatus == true) + if(testLUMScrollView) { + testLUMScrollView->RemoveAll(); + + if(BrightnessControlViewSlider) + { + delete BrightnessControlViewSlider; + BrightnessControlViewSlider=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + + delete testLUMScrollView; + testLUMScrollView=nullptr; } } @@ -90,6 +105,8 @@ namespace OHOS testLUMScrollView->SetTouchable(true); testLUMScrollView->SetDraggable(true); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,378,"chargingButton_next"); + testLUMScrollView->Add(labelButton_next); return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp index 55053e62d..50472e979 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp @@ -28,11 +28,36 @@ namespace OHOS return g_pSystemAboutTheWatchView; } - + osTimerId_t magneyic_TEST_timer=NULL; void testMagicView::ClearAll() { - if (initViewStatus == true) + if(testmagicScrollView) { + testmagicScrollView->RemoveAll(); + + if (magneyic_TEST_timer != NULL) { + osTimerDelete(magneyic_TEST_timer); + magneyic_TEST_timer = NULL; + return ; + } + + if(title!=NULL) + { + delete title; + title=nullptr; + } + if(x!=NULL) + { + delete x; + x=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + delete testmagicScrollView; + testmagicScrollView=nullptr; } } @@ -73,7 +98,7 @@ namespace OHOS } - osTimerId_t magneyic_TEST_timer=NULL; + bool testMagicView::testmagicScrollViewcrollViewinit(void) { uint32_t tick; @@ -91,7 +116,7 @@ namespace OHOS testmagicScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); testmagicScrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); - testmagicScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + testmagicScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); MG_TEST_FALG=0; magneyic_TEST_timer = osTimerNew((osTimerFunc_t)mgdataTimerCallBack, osTimerPeriodic, NULL, NULL); @@ -156,7 +181,8 @@ namespace OHOS testmagicScrollView->Add(x); /* -------------------------------------------------------------------------- */ - + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"luminanceButton_next"); + testmagicScrollView->Add(labelButton_next); testmagicScrollView->SetTouchable(true); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmakephone.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmakephone.cpp index 085bbf81d..cc10ea063 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmakephone.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmakephone.cpp @@ -31,8 +31,22 @@ namespace OHOS void testmakephoneView::ClearAll() { - if (initViewStatus == true) + if(testmakephoneScrollView) { + testmakephoneScrollView->RemoveAll(); + + if(button!=NULL) + { + delete button; + button=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + delete testmakephoneScrollView; + testmakephoneScrollView=nullptr; } } @@ -67,7 +81,7 @@ namespace OHOS } - static UILabelButtonExt* button{NULL}; + uint8_t makphone_falg=0; static char *Path= "/user/music/test_makephone.mp3"; void testmakephoneView::buttoncallback() @@ -166,7 +180,8 @@ namespace OHOS // } // testcat1ScrollView->SetOnDragListener(draglistener); - + labelButton_next= testAboutView::GetInstance()->init_button_next(50,278,"hrsensonbutton_next"); + testmakephoneScrollView->Add(labelButton_next); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp index 9a6612590..f8dbea956 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp @@ -33,8 +33,22 @@ namespace OHOS void testMOTORView::ClearAll() { - if (initViewStatus == true) + if(tesMOTORScrollView) { + tesMOTORScrollView->RemoveAll(); + + if(button[0]!=NULL) + { + delete button[0]; + button[0]=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + delete tesMOTORScrollView; + tesMOTORScrollView=nullptr; } } @@ -70,7 +84,7 @@ namespace OHOS - static UILabelButtonExt* button[2]{NULL}; + static bool motorfalg=false; void testMOTORView::Changstatr(bool falg) @@ -85,7 +99,7 @@ namespace OHOS VibratorFunc vibratorFunc = VibratorManager::GetInstance()->GetVibratorFunc(); if (vibratorFunc != nullptr) { - vibratorFunc(VibratorType::VIBRATOR_TYPE_TWO); + vibratorFunc(VibratorType::VIBRATOR_TYPE_THREE); //vibratorFunc(VibratorType::VIBRATOR_TYPE_THREE); //GRAPHIC_LOGI("UIList::MoveChildByOffset calls TYPE_THREE vibrator"); // } else { @@ -156,6 +170,9 @@ namespace OHOS tesMOTORScrollView->SetTouchable(true); tesMOTORScrollView->SetDraggable(false); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,"cat1button_next"); + tesMOTORScrollView->Add(labelButton_next); + return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp index ee62b0eb4..d7a1571dd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp @@ -31,8 +31,27 @@ namespace OHOS void testSPEAKView::ClearAll() { - if (initViewStatus == true) + if(testSPEAKScrollView) { + testSPEAKScrollView->RemoveAll(); + + if(button[0]) + { + delete button[0]; + button[0]=nullptr; + } + if(button[1]) + { + delete button[1]; + button[1]=nullptr; + } + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + delete testSPEAKScrollView; + testSPEAKScrollView=nullptr; } } @@ -76,7 +95,7 @@ namespace OHOS // } - static UILabelButtonExt* button[2]{NULL}; + void testSPEAKView::Changspeak(bool falg) @@ -132,17 +151,17 @@ namespace OHOS bool testSPEAKView::tesSPEAKScrollViewcrollViewinit(void) { - testSOEAKScrollView = new UIScrollView(); - if (testSOEAKScrollView == nullptr) + testSPEAKScrollView = new UIScrollView(); + if (testSPEAKScrollView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::testSOEAKScrollView new fail!"); return false; } - testSOEAKScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); - testSOEAKScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - testSOEAKScrollView->SetStyle(STYLE_BORDER_RADIUS, 0); - testSOEAKScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::White().full); - testSOEAKScrollView->SetStyle(STYLE_BORDER_COLOR, Color::Yellow().blue); + testSPEAKScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + testSPEAKScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + testSPEAKScrollView->SetStyle(STYLE_BORDER_RADIUS, 0); + testSPEAKScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + testSPEAKScrollView->SetStyle(STYLE_BORDER_COLOR, Color::Yellow().blue); @@ -159,7 +178,7 @@ namespace OHOS buttonconfig.str="play"; buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT; button[0]=SetTheButton_ext(buttonconfig); - testSOEAKScrollView->Add(button[0]); + testSPEAKScrollView->Add(button[0]); buttonconfig.x = 100; buttonconfig.y = 300; @@ -172,7 +191,7 @@ namespace OHOS buttonconfig.str="puase"; buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT; button[1]=SetTheButton_ext(buttonconfig); - testSOEAKScrollView->Add(button[1]); + testSPEAKScrollView->Add(button[1]); // UIView::OnDragListener *draglistener = static_cast(testPresenter::GetInstance()); // if (draglistener == nullptr) @@ -180,14 +199,16 @@ namespace OHOS // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!"); // return false; // } - // testSOEAKScrollView->SetOnDragListener(draglistener); + // testSPEAKScrollView->SetOnDragListener(draglistener); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,"motorButton_next"); + testSPEAKScrollView->Add(labelButton_next); - testSOEAKScrollView->SetTouchable(true); - testSOEAKScrollView->SetDraggable(false); + testSPEAKScrollView->SetTouchable(true); + testSPEAKScrollView->SetDraggable(false); return true; @@ -199,6 +220,6 @@ namespace OHOS { return nullptr; } - return testSOEAKScrollView; + return testSPEAKScrollView; } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h index bba3ef1ce..1d7c3fc4e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h @@ -24,6 +24,7 @@ namespace OHOS UIScrollView *SystemupgradeViewInit(void); void ClearAll(void); void set_string_value(char *str,bool); + void cat1_up_success(void); struct LabelConfig { int16_t left; @@ -49,6 +50,10 @@ namespace OHOS UILabel *FirmwareVersionTitle{nullptr}; // "固件版本" UILabel *FirmwareVersion{nullptr}; UILabel *new_label{nullptr}; + + UILabel *cat1Version{nullptr}; + UILabel *cat1label{nullptr}; + void init_fail(uint8_t); private: UIScrollView *scrollView{nullptr}; @@ -59,12 +64,14 @@ namespace OHOS UILabel *systemupgrade{nullptr}; // "固件版本" UILabel *label_updating{nullptr}; UILabel *label1_fail{nullptr}; + UIViewGroup *container_updating{nullptr}; UIViewGroup *container_fail{nullptr}; UILabelButtonExt *labelButton1_exit=NULL; void init_updating(); bool is_new_version=false; + bool is_new_cat1_version=false; bool is_fwpkg_ready=false; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp index e6f8295db..a6b0dd57f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp @@ -15,6 +15,7 @@ #include "thread_init.h" #include "lwip/apps/http_client.h" #include "tcxo.h" + #include "cat1_server.h" namespace OHOS { @@ -69,7 +70,7 @@ namespace OHOS //SystemupgradeView::GetInstance()->newVersion->SetText(OtaPackageVersion); cJSON_Delete(root); char buf[1024]={0}; - sprintf(buf,"%s\n\n%s",OtaPackageVersion,description); + sprintf(buf,"%s\n%s",OtaPackageVersion,description); #ifdef UP_TEST SystemupgradeView::GetInstance()->set_string_value(buf,true); #else @@ -87,6 +88,7 @@ namespace OHOS } fclose(fp); + } @@ -221,6 +223,13 @@ namespace OHOS { settings.result_fn=httpc_download_result_ui_packpage; } + FILE * fp= fopen((char *)Path,"rb"); + if(fp!=NULL) + { + fclose(fp); + int ret= remove((char *)Path); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "file remove!!!!!!!!!!!!! %d ",ret); + } settings.headers_done_fn=httpc_download_headers_done_ui; httpc_state_t* connection=NULL; @@ -356,6 +365,8 @@ namespace OHOS display_api->turn_on_screen(); } int t=ConfigModel::GetInstance()->GetScreenDurationRadioButtonSlectValue(); + if(t>2) + t=1; display_api->set_screen_set_keepon_timeout(5000+t*5000); // } } @@ -380,7 +391,17 @@ namespace OHOS } void SystemupgradeView::statr_down_fwpkg(void) { - if(is_new_version) + if(is_new_cat1_version) + { + char *imei_str= ConfigModel::GetInstance()->Getimei(); + char * version_buf=ConfigModel::GetInstance()->GetmoderVer(); + sprintf((char *)uri,"http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=%s&imei=%s",version_buf,imei_str); + cat1_ota_update((char *)"0"); + container_updating->SetVisible(true); + scrollView->SetTouchable(false); + scrollView->SetDraggable(false); + } + else if(is_new_version) { //下载差分包 //********** @@ -392,32 +413,94 @@ namespace OHOS } } - void SystemupgradeView::set_string_value(char *str,bool falg) + void SystemupgradeView::cat1_up_success(void) { - if(falg) + if(is_new_cat1_version) { - newVersion->SetText(str); - newVersionTitle->SetText("有最新固件版本"); - newVersion->SetVisible(true); - newVersionTitle->SetVisible(true); - new_label->SetVisible(true); - is_new_version=true; - + label_updating->SetText(" success"); + container_updating->SetVisible(true); + scrollView->SetTouchable(true); + scrollView->SetDraggable(true); + is_new_cat1_version=false; + statr_down_fwpkg(); } - else + + } + + + static uint8_t falg_dwon_json=0; + void SystemupgradeView::set_string_value(char *str,bool falg) + { + if(falg_dwon_json==0) { - newVersionTitle->SetText("已是最新固件版本"); - newVersionTitle->SetVisible(true); - is_new_version=false; - - } - UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); - if (draglistener == nullptr) + if(falg) + { + newVersion->SetText(str); + newVersionTitle->SetText("有最新固件版本"); + + newVersion->SetVisible(true); + newVersionTitle->SetVisible(true); + //new_label->SetVisible(true); + is_new_version=true; + + } + else + { + newVersionTitle->SetText("已是最新固件版本"); + newVersionTitle->SetVisible(true); + is_new_version=false; + + } + + char *imei_str= ConfigModel::GetInstance()->Getimei(); + char * version_buf=ConfigModel::GetInstance()->GetmoderVer(); + sprintf((char *)uri, + "http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=%s&imei=%s", + version_buf,imei_str); + custom_start_ota_download_ui_1(uri,(uint8_t*)Path,true); + falg_dwon_json++; + } + else if (falg_dwon_json==1) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!"); - return ; + if(falg) + { + const char *text= newVersion->GetText(); + char buf[256]={0}; + sprintf(buf,"%s\n%s",text,str); + newVersion->SetText(buf); + newVersionTitle->SetText("有最新固件版本"); + newVersion->SetVisible(true); + newVersionTitle->SetVisible(true); + is_new_cat1_version=true; + + } + else + { + if(is_new_version!=true) + { + newVersionTitle->SetText("已是最新固件版本"); + newVersionTitle->SetVisible(true); + is_new_version=false; + is_new_cat1_version=false; + + } + + + } + + UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); + if (draglistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!"); + return ; + } + scrollView->SetOnDragListener(draglistener); + falg_dwon_json++; } - scrollView->SetOnDragListener(draglistener); + + + + RootView::GetInstance()->Invalidate(); } @@ -636,9 +719,8 @@ namespace OHOS newVersionTitle->SetVisible(false); scrollView->Add(newVersionTitle); - char version_buf_1[128]={0}; - version_len=128; - uapi_get_buildversion((uint8_t*)version_buf_1,version_len); + + Config = { .left = 37, .top = 240, @@ -646,15 +728,10 @@ namespace OHOS .height = 30, .fontSize = 26, .lineHeigh = 30, - .text = (char*)version_buf_1, + .text = (char*)"", .lineBreakMode = UILabel::LINE_BREAK_WRAP, }; newVersion = InitLabel(Config); - if (FirmwareVersion == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersion new fail!"); - return nullptr; - } newVersion->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); newVersion->SetTouchable(true); newVersion->SetViewId("newVersion"); @@ -663,26 +740,26 @@ namespace OHOS newVersion->SetVisible(false); scrollView->Add(newVersion); - Config = { - .left = 367, - .top = 240, - .width = 45, - .height = 30, - .fontSize = 26, - .lineHeigh = 30, - .text = "新!", - .lineBreakMode = UILabel::LINE_BREAK_WRAP, - }; - new_label = InitLabel(Config); - if (FirmwareVersion == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersion new fail!"); - return nullptr; - } - new_label->SetTextColor(Color::GetColorFromRGBA(0xff, 0x00, 0x00, 0x87)); - new_label->SetVisible(false); - scrollView->Add(new_label); - + // Config = { + // .left = 367, + // .top = 240, + // .width = 45, + // .height = 30, + // .fontSize = 26, + // .lineHeigh = 30, + // .text = "新!", + // .lineBreakMode = UILabel::LINE_BREAK_WRAP, + // }; + // new_label = InitLabel(Config); + // if (FirmwareVersion == nullptr) + // { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersion new fail!"); + // return nullptr; + // } + // new_label->SetTextColor(Color::GetColorFromRGBA(0xff, 0x00, 0x00, 0x87)); + // new_label->SetVisible(false); + // scrollView->Add(new_label); + /* -------------------------------------------------------------------------- */ // UILabelButtonExt * SystemUpgradeButton = new UILabelButtonExt(); // if (SystemUpgradeButton == nullptr) // { @@ -725,16 +802,6 @@ namespace OHOS //SystemUpgradeButton->SetOnClickListener(clickListener); //char *Path= "/user/data/ota_start_1.json"; - - FILE * fp = fopen(Path,"rb"); - if(fp!=NULL) - { - fclose(fp); - int ret= remove(Path); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "file remove!!!!!!!!!!!!! %d ",ret); - } - - const power_display_svr_api_t *display_api = power_display_svr_get_api(); if (display_api->get_screen_state() != SCREEN_ON) { @@ -746,6 +813,7 @@ namespace OHOS sprintf((char *)uri,"http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=%s&imei=%s",version_buf,imei_str); custom_start_ota_download_ui_1(uri,(uint8_t*)Path,true); + falg_dwon_json=0; //uograde_service_service_init(); return scrollView; diff --git a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt index 89ac13c40..7a19d695a 100755 --- a/code/sdk/application/wearable/service/msg_center/CMakeLists.txt +++ b/code/sdk/application/wearable/service/msg_center/CMakeLists.txt @@ -12,6 +12,7 @@ set(PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/callerlog/include ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/phoneservice/include ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/producttest/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/system/include ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/config/include ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/main/include/dial ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/bloodoxygen/include @@ -104,6 +105,7 @@ set(PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/alarmclockmanage/include ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/alarmclocktimerconfig/include ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/alarm/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/system/include ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/producttest/include ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/config/include ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/callerlog/include diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h index 824a1db97..31c2a5ccf 100755 --- a/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/makephone_notification.h @@ -41,10 +41,7 @@ public: bool OnClick(OHOS::UIView& view, const OHOS::ClickEvent& event) override; bool OnDrag(UIView& view, const DragEvent& event) override; - virtual bool OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) override - { - return true; - } + bool OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) override; virtual bool OnPress(OHOS::UIView& view, const OHOS::PressEvent& event) override { return true; 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 1ff03410c..9f01d09e8 100755 --- 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 @@ -39,6 +39,7 @@ #include "testhrsenson.h" #include "ConfigModel.h" #include "power_display_service.h" +//#include "Systemupgrade.h" namespace OHOS { #ifdef __cplusplus @@ -558,11 +559,12 @@ void MsgCenterNotifyCat1SignalUpdateProc(const Topic topic, Request* req) tokbuf=strtok(NULL,","); cat1_ver_T.cat1appver=(char*)malloc(strlen(tokbuf)); strcpy( cat1_ver_T.cat1appver,tokbuf); - + ConfigModel::GetInstance()->SetpyVer(tokbuf); tokbuf=strtok(NULL,","); tokbuf=strtok(NULL,","); cat1_ver_T.modem_version=(char*)malloc(strlen(tokbuf)); strcpy( cat1_ver_T.modem_version,tokbuf); + ConfigModel::GetInstance()->SetmoderVer(tokbuf); testcat1View* t=testcat1View::GetInstance(); if(t!=NULL) @@ -571,6 +573,25 @@ void MsgCenterNotifyCat1SignalUpdateProc(const Topic topic, Request* req) free(cat1_ver_T.cat1appver); free(cat1_ver_T.modem_version); + } //"BOOTUP,pyVer,PY_SRV_V4,modemVer,EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312" + else if(strcmp(tokbuf,"BOOTUP")==0) + { + //testcat1View ::cat1_Ver cat1_ver_T; + tokbuf=strtok(NULL,","); + if(strcmp(tokbuf,"pyVer")==0) + { + tokbuf=strtok(NULL,","); + ConfigModel::GetInstance()->SetpyVer(tokbuf); + } + tokbuf=strtok(NULL,","); + if(strcmp(tokbuf,"modemVer")==0) + { + tokbuf=strtok(NULL,"\0"); + ConfigModel::GetInstance()->SetmoderVer(tokbuf); + } + // SystemupgradeView* t=SystemupgradeView::GetInstance(); + // if(t!=NULL) + // t->cat1_up_success(); } } diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp index d17afe7e9..642847df4 100755 --- a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp @@ -761,15 +761,23 @@ CallViewEventListener *CallViewEventListener::GetInstance(void) return &callViewEventListener; } -bool CallViewEventListener::OnDrag(UIView& view, const DragEvent& event) +bool CallViewEventListener::OnDragEnd(OHOS::UIView& view, const OHOS::DragEvent& event) { if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "xxxxxxxxxxxxxxx"); volumeSettingView->SetVisible(false); + volumeSetting->SetVisible(false); unsigned char volumeValue; volumeValue = (unsigned char) ((double) (volumeSetting->sounding * CALL_VOLUME_MAX) / (VOLUME_MAX - VOLUME_MIN)); // 音量转换 SetSpeakerVolume(volumeValue); + return true; } + +} +bool CallViewEventListener::OnDrag(UIView& view, const DragEvent& event) +{ + return true; } //#define SUPPORT_CAT1_SERVICE diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index df87b5110..70ab686f0 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -262,6 +262,7 @@ void test_call_incomming(void) strcpy(msg.buffer,"10086"); cat1_handle_call_incomming(&msg); } + char networkmsg[124]={0}; int cat1_handle_networ_msg(struct tcp_msg_t *msg) { @@ -270,13 +271,30 @@ int cat1_handle_networ_msg(struct tcp_msg_t *msg) if(msg->head[1]=='0') { networkmsg[5]=':'; - } + } //"pyVer:PY_OTA_V3,modemVer,EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312" WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 cat1_handle_networ_msg %s\n",networkmsg); cat1_msg_event_sendmsg_toUI(networkmsg); //显示UI 信号 return 1; } +static char BOOTUP_msg[124]={0}; +int cat1_handle_version_msg(struct tcp_msg_t *msg) +{ + memset(BOOTUP_msg,0,124); + strcpy(BOOTUP_msg,msg->buffer); + if(msg->head[1]=='F') + { + BOOTUP_msg[6]=':'; + } + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 cat1_handle_networ_msg %s\n",msg->buffer); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_MAIN_SERVICE,"cat1 cat1_handle_networ_msg %s\n",BOOTUP_msg); + cat1_msg_event_sendmsg_toUI(BOOTUP_msg); + //显示UI 信号 + return 1; +} + + int cat1_handle_sms(struct tcp_msg_t *msg) { @@ -416,9 +434,14 @@ static int udp_packet_parse(char *rx_buffer, int len) break; case UDP_MSG_REPLY: printf("UDP_MSG_REPLY reply %s\n",msg->buffer); - //BOOTUP,pyVer,PY_SRV_V4,modemVer,EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312 + //"BOOTUP,pyVer,PY_SRV_V4,modemVer,EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312" if(strstr(msg->buffer,"BOOTUP")!=NULL) - cat1_getsignal(); + { + cat1_getsignal(); + cat1_handle_version_msg(msg); + // restart_time_sync(); + } + break; case UDP_CMD_GET_CAT1VER: index = cat1_handle_networ_msg(msg); diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp index 3b5b4c973..7a441780f 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp @@ -84,32 +84,32 @@ static void CustomEventPublish(uint16_t topic, uint8_t *data , uint32_t size) static errcode_t calldial_event_notify(char* callno) { - CustomEventPublish(TOPIC_EVENT_CAT1_CALLDIAL,(uint8_t*)callno,strlen(callno)); + CustomEventPublish(TOPIC_EVENT_CAT1_CALLDIAL,(uint8_t*)callno,strlen(callno)+1); return 0; } static errcode_t incomingcall_event_notify(char* callno) { - CustomEventPublish(TOPIC_EVENT_CAT1_INCOMMING,(uint8_t*)callno,strlen(callno)); + CustomEventPublish(TOPIC_EVENT_CAT1_INCOMMING,(uint8_t*)callno,strlen(callno)+1); return 0; } static errcode_t incomed_call_event_notify(char* callno) { - CustomEventPublish(TOPIC_EVENT_CAT1_CALLCONNTED,(uint8_t*)callno,strlen(callno)); + CustomEventPublish(TOPIC_EVENT_CAT1_CALLCONNTED,(uint8_t*)callno,strlen(callno)+1); return 0; } static errcode_t callend_event_notify(char* callno) { - CustomEventPublish(TOPIC_EVENT_CAT1_CALLENDED,(uint8_t*)callno,strlen(callno)); + CustomEventPublish(TOPIC_EVENT_CAT1_CALLENDED,(uint8_t*)callno,strlen(callno)+1); return 0; } static errcode_t cat1msg_event_notify(char* callno) { - CustomEventPublish(TOPIC_EVENT_CAT1_SIGNAL_UPDATE,(uint8_t*)callno,strlen(callno)); + CustomEventPublish(TOPIC_EVENT_CAT1_SIGNAL_UPDATE,(uint8_t*)callno,strlen(callno)+1); return 0; } @@ -150,6 +150,9 @@ int cat1_msg_event_sendmsg_toUI(char* callno) return ERRCODE_SUCC; } + + + #ifdef __cplusplus }