From 0effea3f91782018a78ab6ce9aa2d72b5c797fe3 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 10 May 2025 10:09:50 +0800 Subject: [PATCH] =?utf8?q?cat1=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= =?utf8?q?=E6=B7=BB=E5=8A=A0SUPPORT=5FCAT1=5FSERVICE=E5=AE=8F=E6=8E=A7?= =?utf8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/dsoftbus_deps/dsoftbus/socket.c | 3 +++ .../nativeui/callerlog/src/CallerLogModel.cpp | 6 ++++++ .../src/DisplayBrightnessPresent.cpp | 2 ++ .../main/src/dropdown/DropDownCardPage1.cpp | 4 ++++ .../nativeui/makephone/src/CallingView.cpp | 2 ++ .../makephone/src/MainCallingPresenter.cpp | 2 ++ .../nativeui/makephone/src/WaitingHintsView.cpp | 2 ++ .../src/NetworkAndCallPresenter.cpp | 6 ++++++ .../networkandcall/src/NetworkAndCallView.cpp | 6 ++++++ .../phone/src/DialingMethodPresenter.cpp | 4 +++- .../nativeui/phone/src/PhoneCallPresenter.cpp | 2 ++ .../nativeui/system/include/SystemPresenter.h | 4 +++- .../nativeui/system/include/Systemupgrade.h | 3 ++- .../nativeui/system/src/SystemModel.cpp | 7 +++++-- .../nativeui/system/src/Systemupgrade.cpp | 5 ++++- .../systemupdate/src/SystemUpdateModel.cpp | 8 +++++--- .../systemupdate/src/SystemUpdateView.cpp | 16 ++++++++++++---- .../sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c | 2 ++ code/sdk/zhihui/utils/custom_utils.c | 4 ++++ code/sdk/zhihui/utils/custom_utils_at_cmd.c | 2 ++ 20 files changed, 77 insertions(+), 13 deletions(-) diff --git a/code/sdk/application/wearable/dsoftbus_deps/dsoftbus/socket.c b/code/sdk/application/wearable/dsoftbus_deps/dsoftbus/socket.c index 4a70d735b..604f77b7a 100644 --- a/code/sdk/application/wearable/dsoftbus_deps/dsoftbus/socket.c +++ b/code/sdk/application/wearable/dsoftbus_deps/dsoftbus/socket.c @@ -9,6 +9,7 @@ #include #include +#ifndef SUPPORT_CAT1_SERVICE int socket(int domain, int type, int protocol) { return 0; @@ -91,3 +92,5 @@ uint32_t htonl(uint32_t n) union { int i; char c; } u = { 1 }; return u.c ? bswap_32(n) : n; } + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp index adcb138f5..511b5a3b8 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp @@ -27,8 +27,10 @@ #include "dial_sos_c.h" #endif +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" #include "cat1_server.h" +#endif #include "AlarmClockModel.h" #ifdef SUPPORT_PHONE_SERVICE @@ -160,7 +162,9 @@ void StatusReset(void) NotificationManager::GetInstance()->SetWatchCallStatus(false); DisshakeTimer(); + #ifdef SUPPORT_CAT1_SERVICE set_call_hungup_flag(0); + #endif #ifdef FD230_650 set_TransCallToMobilePhone_falg(0); @@ -270,6 +274,7 @@ static void CallTimerCallbackProc(int data) { + #ifdef SUPPORT_CAT1_SERVICE if(get_call_hungup_flag()>=2) { cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); @@ -278,6 +283,7 @@ static void CallTimerCallbackProc(int data) { set_call_hungup_flag(get_call_hungup_flag()+1); } + #endif } } diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp index 99a286d40..c971b7f57 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp @@ -13,7 +13,9 @@ #include "graphic_math.h" #include "string.h" #include "displaybrightness/include/DisplayBrightnessPresenter.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" +#endif #include "displaybrightness/include/DisplayBrightnessModel.h" #include "power_display_service.h" #include "common/key_code.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage1.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage1.cpp index 3b89ea1cc..83d0ef53c 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage1.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage1.cpp @@ -17,8 +17,12 @@ #include "ConfigModel.h" extern "C" { + #ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" bool cat1_api_is_cat1_enabled(void); + #else + bool cat1_api_is_cat1_enabled(void){return false;}; + #endif } #include "dnotdisturb/include/DnotDisturbModel.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/CallingView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/CallingView.cpp index 1414afec2..0af088094 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/CallingView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/CallingView.cpp @@ -9,8 +9,10 @@ #include "wearable_log.h" #include "UiConfig.h" #include "PhoneService.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_server.h" #include "cat1_server_hal.h" +#endif #include "custom_utils.h" #include "phone/include/phoneaddressmodel.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp index a6dd3d1dc..1f260fc22 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp @@ -16,8 +16,10 @@ #include "MainCallingView.h" #include "PhoneService.h" #include "WaitingHintsView.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_server.h" #include "cat1_server_hal.h" +#endif #include "custom_utils.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp index 580011a98..c2a617090 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp @@ -20,8 +20,10 @@ #include "wearable_log.h" #include "PhoneService.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_server.h" #include "cat1_server_hal.h" +#endif #include "phone/include/phoneaddressmodel.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp index 0f37f1ac2..4f7fbf484 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp @@ -18,8 +18,10 @@ #include "networkandcall/include/NetworkAndCallC.h" extern "C" { + #ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" bool cat1_api_is_cat1_enabled(void); + #endif } #include "NativeRegisterManager.h" @@ -100,7 +102,11 @@ namespace OHOS { uapi_set4GCapability(true); + #ifdef SUPPORT_CAT1_SERVICE ConfigModel::GetInstance()->SetCat1_4Gability(cat1_api_is_cat1_enabled()); + #else + ConfigModel::GetInstance()->SetCat1_4Gability(false); + #endif if(p_NetworkAndCallView->GetVoLTEToggleButton()) { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallView.cpp index 476904188..32a6b8e09 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallView.cpp @@ -5,8 +5,10 @@ #include "ConfigModel.h" extern "C" { + #ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" bool cat1_api_is_cat1_enabled(void); + #endif } #include "ui_resource_string.h" @@ -178,7 +180,11 @@ namespace OHOS MobileData_toggleButton->SetPosition(298, 145, 100, 50); } + #ifdef SUPPORT_CAT1_SERVICE MobileData_toggleButton->SetState(cat1_api_is_cat1_enabled()); + #else + MobileData_toggleButton->SetState(ConfigModel::GetInstance()->GetCat1_4Gability()); + #endif MobileData_toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); MobileData_toggleButton->SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp index 7e59586bf..9493d25d8 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp @@ -13,10 +13,12 @@ #include #include "phone/include/TelephonyInitInterface.h" #include "phone/include/phoneaddressmodel.h" -#include "cat1_server_hal.h" #include "PhoneService.h" #include "custom_runtime.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" +#include "cat1_server_hal.h" +#endif #include "NativeRegisterManager.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp index b96f9a066..c3a63dc88 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp @@ -5,7 +5,9 @@ #include "string" #include "phone/include/PhoneCallPresenter.h" #include +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_server_hal.h" +#endif #include "PhoneService.h" #include "phone/include/PhoneCallView.h" #include "phone/include/TelephonyInitInterface.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/SystemPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/SystemPresenter.h index e628ae34c..61fa32687 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/SystemPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/SystemPresenter.h @@ -14,7 +14,9 @@ #include "system/include/SystemModel.h" #include "components/ui_radio_button.h" #include "KeyInputListener.h" - #include "cat1_ctl.h" +#ifdef SUPPORT_CAT1_SERVICE +#include "cat1_ctl.h" +#endif namespace OHOS { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/Systemupgrade.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/Systemupgrade.h index b476a30d6..634c7a4ee 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/Systemupgrade.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/Systemupgrade.h @@ -1,7 +1,7 @@ #ifndef SYSTEM_UPGRADE_VIEW_H #define SYSTEM_UPGRADE_VIEW_H - +#ifndef XTS_SUPPORT #include "View.h" #include "components/ui_image_view.h" @@ -132,4 +132,5 @@ namespace OHOS bool initViewStatus{false}; }; } // namespace OHOS +#endif #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemModel.cpp index dd492488b..182237797 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemModel.cpp @@ -9,14 +9,17 @@ #include #include "cJSON.h" #include "ConfigModel.h" -#include "lwip/err.h" #include "power_display_service.h" #include "cmsis_os2.h" #include "los_memory.h" #include "thread_init.h" - #include "lwip/apps/http_client.h" + #include "tcxo.h" + #ifdef SUPPORT_CAT1_SERVICE #include "cat1_server.h" + #include "lwip/err.h" +#include "lwip/apps/http_client.h" + #endif #include "linux/delay.h" #define UPDATAREPORT_M UPDATAREPORT diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/Systemupgrade.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/Systemupgrade.cpp index 0d3afcc32..bc5531e7d 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/Systemupgrade.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/Systemupgrade.cpp @@ -1,3 +1,5 @@ +#ifndef XTS_SUPPORT + #include "system/include/Systemupgrade.h" #include "system/include/SystemPresenter.h" #include "wearable_log.h" @@ -949,4 +951,5 @@ namespace OHOS return scrollView; } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateModel.cpp index 678c2b149..566b3ce76 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateModel.cpp @@ -13,16 +13,18 @@ #include "stdio.h" #include "cJSON.h" #include "ConfigModel.h" -#include "lwip/err.h" #include "power_display_service.h" #include "cmsis_os2.h" #include "los_memory.h" #include "thread_init.h" -#include "lwip/apps/http_client.h" #include "tcxo.h" -#include "cat1_server.h" #include "linux/delay.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" +#include "cat1_server.h" +#include "lwip/apps/http_client.h" +#include "lwip/err.h" +#endif #include "AppViewIDs.h" #include "NativeAbility.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateView.cpp index bfecb0ac4..e83571189 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateView.cpp @@ -19,17 +19,19 @@ #include #include "cJSON.h" #include "ConfigModel.h" -#include "lwip/err.h" #include "power_display_service.h" #include "cmsis_os2.h" #include "los_memory.h" #include "thread_init.h" -#include "lwip/apps/http_client.h" #include "tcxo.h" -#include "cat1_server.h" #include "linux/delay.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" #include "cat1_server_hal.h" +#include "cat1_server.h" +#include "lwip/apps/http_client.h" +#include "lwip/err.h" +#endif #include "bts_le_gap.h" #include "custom_http_download.h" @@ -54,7 +56,8 @@ namespace OHOS static SystemUpdateView *g_pSystemUpdateView{nullptr}; - +#ifdef SUPPORT_CAT1_SERVICE + static osThreadId_t g_alipay_task_handle = NULL; //static char * imei_str="864430010001091"; // osThreadAttr_t g_alipay_attr = { @@ -288,6 +291,7 @@ namespace OHOS } } +#endif SystemUpdateView::SystemUpdateView() { @@ -383,12 +387,16 @@ namespace OHOS switch (falg_id) { case OTA_BUTTON_GET_VISON://开始获取升级 +#ifdef SUPPORT_CAT1_SERVICE start_get_updata_json(); +#endif SystemUpdateModel ::GetInstance().button_flag=OTA_BUTTON_GET_VISON_ING; break; case OTA_BUTTON_GET_ABLE_DOWNLOAD://开始下载升级包 +#ifdef SUPPORT_CAT1_SERVICE start_get_updata_fwpkg(); start_dwonload(); +#endif break; case OTA_BUTTON_GET_ABLE_UPDTAT: #if OTA_UPDATA_TEST diff --git a/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c b/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c index 7c0fd988c..9650480f9 100644 --- a/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c +++ b/code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c @@ -3,7 +3,9 @@ #include "platform_core.h" #include "stdint.h" #include "pinctrl.h" +#ifdef SUPPORT_CAT1_SERVICE #include "cat1_ctl.h" +#endif #include "gpio.h" #include "gpio_porting.h" #include "tcxo.h" diff --git a/code/sdk/zhihui/utils/custom_utils.c b/code/sdk/zhihui/utils/custom_utils.c index de7cad87b..df1eecdfe 100644 --- a/code/sdk/zhihui/utils/custom_utils.c +++ b/code/sdk/zhihui/utils/custom_utils.c @@ -1488,7 +1488,9 @@ void uapi_set4GCapability(bool isopen) void *tcp_thread_id = NULL; if(isopen) { + #ifdef SUPPORT_CAT1_SERVICE power_on_cat1(); + #endif // if(!uapi_dev_runtime_get_saveele_status()) { uapi_dev_runtime_set_cat1_powerstat(1); @@ -1507,7 +1509,9 @@ void uapi_set4GCapability(bool isopen) } else { + #ifdef SUPPORT_CAT1_SERVICE power_off_cat1(); + #endif // if(!uapi_dev_runtime_get_saveele_status()) { uapi_dev_runtime_set_cat1_powerstat(0); diff --git a/code/sdk/zhihui/utils/custom_utils_at_cmd.c b/code/sdk/zhihui/utils/custom_utils_at_cmd.c index 2e6dbaf13..f48ff0ba1 100644 --- a/code/sdk/zhihui/utils/custom_utils_at_cmd.c +++ b/code/sdk/zhihui/utils/custom_utils_at_cmd.c @@ -452,7 +452,9 @@ static uint32_t custom_utils_pdudec(uint8_t *para, uint32_t paraLen, char *strCo const char *inpdustr = (const char*)argv[0]; + #ifdef SUPPORT_CAT1_SERVICE pdu_decode_example(inpdustr,0,0,0); + #endif return ERRCODE_SUCC; } -- 2.17.1