From c5858b7d806cd5df313702ce62d0b28f39e12f37 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 4 Jan 2025 16:04:53 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=96=87?= =?utf8?q?=E4=BB=B6=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/bluetooth/src/BluetoothModel.cpp | 8 +- .../nativeui/findphone/src/FindPhoneModel.cpp | 4 +- .../nativeui/findphone/src/FindPhoneView.cpp | 5 +- .../nativeui/makephone/src/CallingView.cpp | 4 +- .../makephone/src/MainCallingPresenter.cpp | 4 +- .../makephone/src/WaitingHintsView.cpp | 6 +- .../nativeui/message/include/MessageModel.h | 7 +- .../nativeui/traing/src/TraingModel.cpp | 6 +- .../include/TraingCardPresenter.h | 6 +- .../include/notify/goal_notification.h | 6 +- .../msg_center/include/notify/transmitting.h | 6 +- .../msg_center/src/msg_center_customer.cpp | 6 +- .../src/notify/makephone_notification.cpp | 6 +- .../config/target_config/brandy/config.py | 25 ++- .../profiles/src/ble_hid_take_photo_server.c | 6 +- code/sdk/zhihui/UI/producttest/CMakeLists.txt | 5 + .../UI/producttest/include/testPresenter.h | 2 +- .../zhihui/UI/producttest/include/testView.h | 6 +- .../UI/producttest/include/testgsenson.h | 2 +- .../UI/producttest/include/testhrsenson.h | 2 +- .../UI/producttest/include/testmagnetic.h | 2 + .../zhihui/UI/producttest/include/testold.h | 2 + .../UI/producttest/src/testPresenter.cpp | 35 ++- .../zhihui/UI/producttest/src/testView.cpp | 18 +- code/sdk/zhihui/UI/producttest/src/testbt.cpp | 12 +- .../UI/producttest/src/testhrsenson.cpp | 4 +- .../UI/producttest/src/testmagnetic.cpp | 4 + .../UI/producttest/src/testmicrophone.cpp | 11 +- .../sdk/zhihui/UI/producttest/src/testold.cpp | 18 +- .../slip/cat1Service/cat1_tcpServer.cpp | 6 +- .../ble_service/blemoder/CMakeLists.txt | 77 ++++--- .../blemoder/{bletest.cpp => bleInstruct.cpp} | 211 ++---------------- .../blemoder/{bletest.h => bleInstruct.h} | 27 +-- .../ble_service/bleservice/CMakeLists.txt | 12 +- .../services/ble_service/bleservice/bleANCS.c | 4 +- .../services/ble_service/bleservice/bleANCS.h | 16 ++ .../ble_service/bleservice/bleEvent.c | 5 +- .../ble_service/bleservice/bleEvent.h | 8 +- .../ble_service/bleservice/bleService.c | 9 +- .../factorytest_protocol.c | 22 +- .../factorytest_protocol.h | 1 + code/sdk/zhihui/utils/CMakeLists.txt | 3 +- code/sdk/zhihui/utils/custom_cmd_service.c | 11 +- .../zhihui/utils/custom_fileoperate_service.c | 18 +- code/sdk/zhihui/utils/custom_save_runtime.c | 4 +- code/sdk/zhihui/utils/custom_utils.c | 16 +- code/sdk/zhihui/utils/custom_utils_at_cmd.c | 4 +- code/sdk/zhihui/utils/pdu.c | 4 + 48 files changed, 361 insertions(+), 325 deletions(-) rename code/sdk/zhihui/services/ble_service/blemoder/{bletest.cpp => bleInstruct.cpp} (93%) rename code/sdk/zhihui/services/ble_service/blemoder/{bletest.h => bleInstruct.h} (93%) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp index 2d76de6fc..3e86d8f7c 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp @@ -47,7 +47,13 @@ #include "BluetoothWrapper.h" #endif #include "Bluetooyhpabpserver.h" -#include "bletest.h" + + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + + #include "ConfigModelC.h" #include "uiservice/include/ui_service.h" #include "vibrator_service.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneModel.cpp index f8a424eef..0befef354 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneModel.cpp @@ -7,7 +7,9 @@ */ #include "findphone/include/FindPhoneModel.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif #include #include "wearable_log.h" #include "bleEvent.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneView.cpp index 013a42f87..b48318ccd 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/findphone/src/FindPhoneView.cpp @@ -16,7 +16,10 @@ #include "wearable_log.h" #include "findphone/include/FindPhoneModel.h" #include "UiConfig.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "bleEvent.h" #include "ui_resource_string.h" #include "uicomponents/UIComponents.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 75c75b716..9fae51f40 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 @@ -15,7 +15,9 @@ #endif #include "custom_utils.h" #include "phoneaddressmodel.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif #include "ui_resource_string.h" #include "PhoneAGService.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 fb3680e8f..b4b239297 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 @@ -22,7 +22,9 @@ #endif #include "custom_utils.h" #include "phoneaddressmodel.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif #include "NativeAbility.h" #include "dial_sos_c.h" #include "soundandvibration/include/SoundAndVibrationVolumeSettingC.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 1f6f6670b..de1ea3b1e 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 @@ -9,7 +9,11 @@ #include "CallerLogModel.h" #include "MainCallingPresenter.h" #include "ui_resource_string.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif +#endif #include "custom_utils.h" #include "wearable_log.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/message/include/MessageModel.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/message/include/MessageModel.h index 7d4ea375a..5ed55590d 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/message/include/MessageModel.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/message/include/MessageModel.h @@ -2,12 +2,17 @@ #ifndef MESSAGE_MODEL_H #define MESSAGE_MODEL_H -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "message/include/MessagePresenter.h" #include #include #include +#include "bleANCS.h" + namespace OHOS { // 消息数据结构体 struct MessageData { diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp index f2472c31a..6ae47a223 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp @@ -23,7 +23,11 @@ #include "ConfigModel.h" #include "bleEvent.h" -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "broadcast_feature.h" #include "broadcast_service.h" #include "custom_runtime.h" diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_card/include/TraingCardPresenter.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_card/include/TraingCardPresenter.h index 586bf7e04..f30762735 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_card/include/TraingCardPresenter.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_card/include/TraingCardPresenter.h @@ -9,7 +9,11 @@ #include "traing/training_card/include/TrainingDataView.h" #include "traing/training_card/include/TrainingDetailView.h" -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "components/root_view.h" #include "components/ui_swipe_view.h" #include "components/ui_view.h" diff --git a/code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h b/code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h index 336a85017..04e7ca3c1 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h +++ b/code/sdk/application/wearable/fd230/service/msg_center/include/notify/goal_notification.h @@ -1,7 +1,11 @@ #ifndef GOAL_NOTIFICATION_H #define GOAL_NOTIFICATION_H // #include "components/ui_image_animator.h" -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "components/ui_view_group.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230/service/msg_center/include/notify/transmitting.h b/code/sdk/application/wearable/fd230/service/msg_center/include/notify/transmitting.h index d5371ae8c..7a6e872f6 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/include/notify/transmitting.h +++ b/code/sdk/application/wearable/fd230/service/msg_center/include/notify/transmitting.h @@ -1,7 +1,11 @@ #ifndef TRANSMITTING_H #define TRANSMITTING_H #include "components/ui_image_animator.h" -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "components/ui_view_group.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp index abc6a062e..726570944 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp @@ -44,7 +44,11 @@ #include "testhrsenson.h" #include "ConfigModel.h" #include "power_display_service.h" -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + //#include "TraingCardPresenter.h" #include "custom_runtime.h" #include "custom_utils.h" diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp index 895b881e7..1ce4cb7f7 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/notify/makephone_notification.cpp @@ -28,7 +28,11 @@ #include "custom_utils.h" #include "phoneaddressmodel.h" #include "components/ui_label_button.h" -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "NativeAbility.h" #include "dial_sos_c.h" #include diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index 70c8b9ee2..4bbfb15f2 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -362,7 +362,9 @@ target = { 'CONFIG_DFX_SUPPORT_DIAG_UP_MACHINE=1', 'TPTYPE_FT6X46', 'ROTARYENCODER_HX3507', - 'NANDFLASH_DS35X' + 'NANDFLASH_DS35X', + 'BLE_INSTRUCT', + 'FACTORYTEST_SERVICE', ], #添加自定义应用 'ram_component': [ @@ -472,7 +474,9 @@ target = { #'ROTARYENCODER_HX3507', 'ROTARYENCODER_U8', 'FUNC_KEY2', - 'NANDFLASH_DS35X' + 'NANDFLASH_DS35X', + 'BLE_INSTRUCT', + 'FACTORYTEST_SERVICE', ], 'ram_component': [ 'audio_at_service', @@ -676,7 +680,7 @@ target = { 'SUPPORT_HID_SERVICE', 'SUPPORT_BAIDU_MAP', 'CFG_FLASH_SIZE=8', - # 'SUPPORT_BLE_SERVICE', + 'SUPPORT_BLE_SERVICE', # 'FD230', #"MEM_CHECK", #'ENABLE_WEBSOCKET', @@ -690,7 +694,10 @@ target = { 'TEST_4G_UI', 'NANDFLASH_F35UQA', 'PPG_VC921X', - 'ROTARYENCODER_HX3509' + 'ROTARYENCODER_HX3509', + 'FACTORYTEST_SERVICE', + # 'BLE_INSTRUCT' + ], 'ram_component': [ #'baidumapsdk', @@ -715,12 +722,12 @@ target = { "gnss", "gnss_sample", # "acc_sensor", - "batterry_service", - # "bleservice", - # "ppgBleService", + "batterry_service", + "bleservice", + "ppgBleService", # "blemoder", - # "factorytest_service", - # "hid_service", + "factorytest_service", + "hid_service", "producttest", "cywee", "charge_ic", diff --git a/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/ble_hid_take_photo_server.c b/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/ble_hid_take_photo_server.c index c8d40a0c1..3e12ce08f 100644 --- a/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/ble_hid_take_photo_server.c +++ b/code/sdk/protocol/bt/host/bt/bts/bt_sample/ble_profile/profiles/src/ble_hid_take_photo_server.c @@ -9,7 +9,7 @@ #include "ble_gatts_callbacks.h" #include "bts_uuid.h" #include "ble_hid_take_photo_server.h" - +#ifndef SUPPORT_HID_SERVICE /* HID information flag remote wakeup */ #define BLE_HID_INFO_FLAG_REMOTE_WAKE_UP_MSK 0x01 /* HID information flag normally connectable */ @@ -318,4 +318,6 @@ void ble_hid_add_characters_input_report_cbk(uint16_t srvc_handle) return; } g_hid_input_report_att_hdl = srvc_handle + BLE_HID_CHARACTER_INPUT_REPORT_VALUE_HANDLE_OFFSET; -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/code/sdk/zhihui/UI/producttest/CMakeLists.txt b/code/sdk/zhihui/UI/producttest/CMakeLists.txt index 629e0b84e..6d6e50212 100644 --- a/code/sdk/zhihui/UI/producttest/CMakeLists.txt +++ b/code/sdk/zhihui/UI/producttest/CMakeLists.txt @@ -52,10 +52,13 @@ set(PRIVATE_HEADER ${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits + ${ROOT_DIR}/zhihui/services/factorytest_service # /home/hcj/615/FD230/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersPresenter.h # /home/hcj/615/FD230/code/sdk/middleware/services/gui/uikit/ui/frameworks/font/glyphs_manager.h # /home/hcj/615/FD230/code/sdk//UiServersMsg.h ) +# /home/hcj/615/FD230/code/sdk/ + if("FD230" IN_LIST DEFINES) set(PRIVATE_HEADER ${PRIVATE_HEADER} @@ -71,6 +74,7 @@ set(PRIVATE_HEADER ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarmclockmanage/include ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarmclocktimerconfig/include ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/player/include + ${ROOT_DIR}/zhihui/services/factorytest_service ) else() set(PRIVATE_HEADER @@ -85,6 +89,7 @@ set(PRIVATE_HEADER ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclockmanage/include ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alarmclocktimerconfig/include ${ROOT_DIR}/application/wearable/nativeapp/nativeui/player/include + ${ROOT_DIR}/zhihui/services/factorytest_service ) endif() diff --git a/code/sdk/zhihui/UI/producttest/include/testPresenter.h b/code/sdk/zhihui/UI/producttest/include/testPresenter.h index e7715dc33..f651e28fa 100644 --- a/code/sdk/zhihui/UI/producttest/include/testPresenter.h +++ b/code/sdk/zhihui/UI/producttest/include/testPresenter.h @@ -34,7 +34,7 @@ namespace OHOS TP, MAGETIC, LUMINANCE, - CHAR, + CHARG, SPEAK, MOTOR, #ifdef SUPPORT_CAT1_MODEM diff --git a/code/sdk/zhihui/UI/producttest/include/testView.h b/code/sdk/zhihui/UI/producttest/include/testView.h index 42fdae162..a24c08b22 100644 --- a/code/sdk/zhihui/UI/producttest/include/testView.h +++ b/code/sdk/zhihui/UI/producttest/include/testView.h @@ -126,9 +126,9 @@ namespace OHOS testCHANINGView *test_charging_view{nullptr}; testSPEAKView *test_speak_view{nullptr}; testMOTORView *test_motor_view{nullptr}; - #ifdef SUPPORT_CAT1_MODEM - testcat1View *test_cat1_view{nullptr}; - #endif + // #ifdef SUPPORT_CAT1_MODEM + testcat1View *test_cat1_view{nullptr}; + // #endif testbuttonView *test_KEY_view{nullptr}; testMagicView *test_MG_view{nullptr}; testhrsenson1View *test_hr_view{nullptr}; diff --git a/code/sdk/zhihui/UI/producttest/include/testgsenson.h b/code/sdk/zhihui/UI/producttest/include/testgsenson.h index c0017aeea..d4bc8f512 100644 --- a/code/sdk/zhihui/UI/producttest/include/testgsenson.h +++ b/code/sdk/zhihui/UI/producttest/include/testgsenson.h @@ -8,7 +8,7 @@ #include "components/ui_label_ext.h" #include "components/ui_image_view.h" #include "producttest/include/testmagnetic.h" -#include "CompassModel.h" +// #include "CompassModel.h" #include "components/ui_label_button_ext.h" //#include "cmsis_os.h" #include diff --git a/code/sdk/zhihui/UI/producttest/include/testhrsenson.h b/code/sdk/zhihui/UI/producttest/include/testhrsenson.h index 7acd8d1f2..4ba83b9a3 100644 --- a/code/sdk/zhihui/UI/producttest/include/testhrsenson.h +++ b/code/sdk/zhihui/UI/producttest/include/testhrsenson.h @@ -81,7 +81,7 @@ namespace OHOS private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); UILabel *InitLabel(LabelConfig &labelConfig); - bool tesScat1ScrollViewcrollViewinit(uint8_t); + bool testhrsensonScrollViewcrollViewinit(uint8_t); UIScrollView *testhrsensonScrollView{nullptr}; UILabel *label_1_cat1msg_1=NULL; // UILabel *label_1_cat1msg_oper{nullptr}; diff --git a/code/sdk/zhihui/UI/producttest/include/testmagnetic.h b/code/sdk/zhihui/UI/producttest/include/testmagnetic.h index 2b726a8cc..d0ef55b6a 100644 --- a/code/sdk/zhihui/UI/producttest/include/testmagnetic.h +++ b/code/sdk/zhihui/UI/producttest/include/testmagnetic.h @@ -8,7 +8,9 @@ #include "components/ui_label_ext.h" #include "components/ui_image_view.h" #include "producttest/include/testmagnetic.h" +#ifdef FD230 #include "CompassModel.h" +#endif #include "components/ui_label_button_ext.h" //#include "cmsis_os.h" #include diff --git a/code/sdk/zhihui/UI/producttest/include/testold.h b/code/sdk/zhihui/UI/producttest/include/testold.h index 2da87be52..c0dfed13f 100644 --- a/code/sdk/zhihui/UI/producttest/include/testold.h +++ b/code/sdk/zhihui/UI/producttest/include/testold.h @@ -19,6 +19,8 @@ #include "components/ui_label_button_ext.h" //#include "cmsis_os.h" + + #include namespace OHOS { diff --git a/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp b/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp index 9acd86b6b..179414053 100644 --- a/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp @@ -1,20 +1,31 @@ #include "AppViewIDs.h" #include "components/ui_label_ext.h" -#include"ui_resource_string.h" +#ifdef FD230 + #include"ui_resource_string.h" +#endif + #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" #include "producttest/include/testPresenter.h" #include "font/font_global_manager.h" #include "font/ui_font.h" -#include "languagecode/LanguageInit.h" +#ifdef FD230 + #include "languagecode/LanguageInit.h" +#endif #include "../../../../../../zhihui/utils/custom_utils.h" #include "power_display_service.h" #include "components/ui_slider.h" #include "audio_capture_wrapper.h" #include "cywee_service.h" -#include "factorytest_protocol.h" + +#ifdef FD230 + #include "factorytest_protocol.h" +#endif + + + #include "custom_runtime.h" #include "gnss_ctl.h" @@ -274,15 +285,27 @@ namespace OHOS { if(uapi_dev_runtime_get_cat1_powerstat()) uapi_set4GCapability(false); - factorytest_start_aging_test(); + #ifdef FD230 + factorytest_start_aging_test(); + #endif } if(strcmp(view.GetViewId(),"stop") == 0) { - factorytest_stop_aging_test(); + #ifdef FD230 + factorytest_stop_aging_test(); + #endif } if(strcmp(view.GetViewId(),"exit") == 0) { - NativeAbility::GetInstance().ChangeSlice(VIEW_TEST); + for (int i = 1; i < MAX_TESTVIEWID; i++) + { + if (p_SystemView->GetSystemScrollView(i)) + { + p_SystemView->ChangeView(i, TESTVIEW); + break; + } + } + return true; } if(strcmp(view.GetViewId(),"deep") == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testView.cpp b/code/sdk/zhihui/UI/producttest/src/testView.cpp index 6386552e7..2001efd98 100644 --- a/code/sdk/zhihui/UI/producttest/src/testView.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testView.cpp @@ -10,6 +10,12 @@ #include "custom_utils.h" #include "custom_runtime.h" + + +#ifdef FD230 + #include "factorytest_protocol.h" +#endif + namespace OHOS { @@ -23,7 +29,7 @@ namespace OHOS {TP,"TPButton","TP","TPButton_next", &testView::ChangeTPTESTView,true}, {MAGETIC,"MAGETICButton","Magetic","MAGETICButton_next", &testView::ChangeMGTESTView,true}, {LUMINANCE,"luminanceButton","luminance","luminanceButton_next", &testView::ChangLUMTESTView,true}, - {CHAR,"chargingButton","bat&charger","chargingButton_next",&testView::ChangchargingTESTView,true}, + {CHARG,"chargingButton","bat&charger","chargingButton_next",&testView::ChangchargingTESTView,true}, {SPEAK,"speakButton","speak","speakButton_next" ,&testView::ChangspeakTESTView,true}, {MOTOR,"motorButton","motor","motorButton_next" ,&testView::ChangmotorTESTView,true}, @@ -39,8 +45,9 @@ namespace OHOS {PingTest,"PingTestbutton","PingTest","PingTestbutton_next" ,&testView::ChangePingTESTView,true}, {GPSTEST,"GPSTestbutton","GPSTest","GPSTestbutton_next" ,&testView::ChangeGPSTESTView,true}, - + #ifdef AGINGTEST {OLDTEST,"oldtestbutton","aging" ,"oldtestexit",&testView::ChangeoldTESTView,true}, + #endif {DEEPSLEEP,"deepsleep","DeepSleepCurrent","xxxxxxxxx" ,&testView::ChangeoldTESTView,true}, {shutdown,"shutdown","shutdown", "xxxxxxxxx",&testView::ChangeoldTESTView,true}, {RESET,"reset","reset", "xxxxxxxxx",&testView::ChangeoldTESTView,true}, @@ -543,9 +550,11 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); } return true; } + bool testView::ChangeoldTESTView(int16_t thisView) { + #ifdef AGINGTEST if (SystemScrollView[thisView] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeoldTESTView"); @@ -558,8 +567,11 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); SystemScrollView[thisView] = test_old_view->testoldInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } + #endif return true; + } + bool testView::ChangeBTTESTView(int16_t thisView) { @@ -728,7 +740,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); test_lum_view = nullptr; SystemScrollView[hideView]=nullptr; break; - case CHAR: + case CHARG: RootView::GetInstance()->Remove(SystemScrollView[hideView]); delete test_charging_view; test_charging_view = nullptr; diff --git a/code/sdk/zhihui/UI/producttest/src/testbt.cpp b/code/sdk/zhihui/UI/producttest/src/testbt.cpp index d158e35bc..61fa663e7 100644 --- a/code/sdk/zhihui/UI/producttest/src/testbt.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testbt.cpp @@ -12,7 +12,9 @@ #include "custom_runtime.h" #include "bts_br_gap.h" #include "bts_le_gap.h" + #include "bleService.h" + #include "BluetoothModel.h" #include "producttest/include/testView.h" #ifdef __cplusplus @@ -96,8 +98,9 @@ namespace OHOS } bool ret = gap_br_cancel_discovery(); - - BluetoothModel::GetInstance()->set_test_bt_falg(false); + #ifdef FD230 + BluetoothModel::GetInstance()->set_test_bt_falg(false); + #endif uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); if (cnt == 1) { @@ -168,7 +171,10 @@ namespace OHOS bool ret = gap_br_start_discovery(); BluetoothModel::GetInstance()->SortScansCaseRssi(); - BluetoothModel::GetInstance()->set_test_bt_falg(true); + #ifdef FD230 + BluetoothModel::GetInstance()->set_test_bt_falg(true); + #endif + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"gap_br_start_discovery bool %d!\n",ret); #endif button->SetText("scaning"); diff --git a/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp b/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp index ec1619677..ac738ad25 100644 --- a/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp @@ -204,7 +204,7 @@ namespace OHOS - bool testhrsenson1View::tesScat1ScrollViewcrollViewinit(uint8_t id) + bool testhrsenson1View::testhrsensonScrollViewcrollViewinit(uint8_t id) { testhrsensonScrollView = new UIScrollView(); @@ -317,7 +317,7 @@ namespace OHOS UIScrollView *testhrsenson1View::testhrsensonInitIView(uint8_t id) { - if (!tesScat1ScrollViewcrollViewinit(id)) + if (!testhrsensonScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp b/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp index 64bb1ea84..6ab829127 100644 --- a/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp @@ -54,8 +54,10 @@ namespace OHOS if(testmagicScrollView) { testmagicScrollView->RemoveAll(); +#ifdef FD230 #ifndef TEST_BATTERY CompassModel::GetInstance()->CloseCompassSensor(); +#endif #endif if (magneyic_TEST_timer != NULL) { osTimerStop(magneyic_TEST_timer); @@ -151,8 +153,10 @@ namespace OHOS { uint32_t tick; osStatus_t retTimer; +#ifdef FD230 #ifndef TEST_BATTERY CompassModel::GetInstance()->OpenCompassSensor(); +#endif #endif testmagicScrollView = new UIScrollView(); if (testmagicScrollView == nullptr) diff --git a/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp b/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp index f084d39e9..bc0861f23 100644 --- a/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp @@ -6,7 +6,9 @@ #include "cmsis_os2.h" #include "audio_capture_wrapper.h" #include "producttest/include/testView.h" -#include "findwatch_notification.h" +#ifdef FD230 + #include "findwatch_notification.h" +#endif #ifdef __cplusplus #if __cplusplus extern "C" @@ -170,6 +172,7 @@ namespace OHOS else if(makphone_falg==1) { #ifndef AUDIO_ECHO_TEST +#ifdef FD230 int32_t argc = 1; uint8_t *argv = (uint8_t*)"stop"; AudioCaptureSample(argc, (const char **)&argv); @@ -182,6 +185,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ffffffffffffffffsssssss"); } fclose(file); +#endif #else uapi_stop_audio_test(); button[0]->SetText("start"); @@ -189,6 +193,7 @@ namespace OHOS #endif } #ifndef AUDIO_ECHO_TEST +#ifdef FD230 else if(makphone_falg==2) { button->SetText("stop play"); @@ -202,6 +207,7 @@ namespace OHOS FindWatchViewEventListener::GetInstance().PopInterCancelMusic(); makphone_falg = 0; } +#endif #endif } @@ -371,9 +377,11 @@ extern "C" void check_mic(bool isopen) { + #ifdef FD230 if(isopen) { // AlarmClockModel::GetInstance()->testPlayerStart("/user/userdata/microphone.mp3"); + FindWatchViewEventListener::GetInstance().setVolumeVal(100); FindWatchViewEventListener::GetInstance().PopInterPlayMusic_product("/user/userdata/microphone.mp3"); // AlarmClockModel::GetInstance()->AlarmPlayerStart(); @@ -384,6 +392,7 @@ extern "C" FindWatchViewEventListener::GetInstance().PopInterCancelMusic_product(); // AlarmClockModel::GetInstance()->AlarmPlayerStop(); } + #endif } diff --git a/code/sdk/zhihui/UI/producttest/src/testold.cpp b/code/sdk/zhihui/UI/producttest/src/testold.cpp index de28daaac..cef97cf4a 100644 --- a/code/sdk/zhihui/UI/producttest/src/testold.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testold.cpp @@ -5,13 +5,25 @@ #include "AlarmClockModel.h" #include "cmsis_os2.h" #include "producttest/include/testView.h" -#include "factorytest_protocol.h" + +#ifdef FD230 + #include "factorytest_protocol.h" +#endif + +#ifdef AGINGTEST + +// #ifdef AGINGTEST namespace OHOS { static testoldView *g_pSystemAboutTheWatchView{nullptr}; static osTimerId_t g_aging_timer=NULL; + + #ifdef FD230 static ble_aging_t aging_t; + #endif + + testoldView::testoldView() { @@ -599,4 +611,6 @@ namespace OHOS } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/code/sdk/zhihui/drivers/slip/cat1Service/cat1_tcpServer.cpp b/code/sdk/zhihui/drivers/slip/cat1Service/cat1_tcpServer.cpp index e85bcdab7..309718318 100644 --- a/code/sdk/zhihui/drivers/slip/cat1Service/cat1_tcpServer.cpp +++ b/code/sdk/zhihui/drivers/slip/cat1Service/cat1_tcpServer.cpp @@ -34,7 +34,11 @@ #include #ifdef SUPPORT_BLE_SERVICE -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "bleANCS.h" #endif #include "custom_utils.h" diff --git a/code/sdk/zhihui/services/ble_service/blemoder/CMakeLists.txt b/code/sdk/zhihui/services/ble_service/blemoder/CMakeLists.txt index e8005d787..a6baf8770 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/CMakeLists.txt +++ b/code/sdk/zhihui/services/ble_service/blemoder/CMakeLists.txt @@ -6,61 +6,60 @@ set(COMPONENT_NAME "blemoder") set(PUBLIC_HEADER -${CMAKE_CURRENT_SOURCE_DIR} -) + ${CMAKE_CURRENT_SOURCE_DIR} + ) set(PRIVATE_HEADER -${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits -${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits -${ROOT_DIR}/application/wearable/nativeapp/nativeui/heartrate/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/weather/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/heart_blood/health_service -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/sleep/include/ -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/phone/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/languagecode/ -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/language -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/traing/training_card/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/config/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/traing/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/uiservice/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/codedlock/include + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits + ${ROOT_DIR}/application/wearable/nativeapp/nativeui/heartrate/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/weather/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/heart_blood/health_service + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/sleep/include/ + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/phone/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/languagecode/ + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/language + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/traing/training_card/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/config/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/traing/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/uiservice/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/codedlock/include #${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarm/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarmclockmanage/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarmclocktimerconfig/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarmclockmanage/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarmclocktimerconfig/include #code/sdk/middleware/services/gui/uikit/proprietary/src/utils/innerkits/hals/gralloc_engines.h #/home/hcj/FD230/code/sdk/open_source/openharmony/drivers/peripheral/display/interfaces/include/display_gralloc.h -${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include -${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src -${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits -${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include -${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/common -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/set_dial/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/aivoice/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarm/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/musicplayer/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/schedule/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/bluetooth/include -${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits -${ROOT_DIR}/application/wearable/nativeapp/nativeui/alipay/include + ${ROOT_DIR}/open_source/openharmony/drivers/peripheral/display/interfaces/include + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include + ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/common + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/set_dial/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/aivoice/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alarm/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/musicplayer/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/schedule/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/bluetooth/include + ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits + ${ROOT_DIR}/application/wearable/nativeapp/nativeui/alipay/include # /home/hcj/FD230/code/sdk/middleware/services/gui/uikit/ui/interfaces/innerkits/engines/gfx/gfx_engine_manager.h -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alipay/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/alipay/include # /home/hcj/FD230/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayModel.h #/home/hcj/FD230/code/sdk/application/wearable/fd230/nativeapp/nativeui/alarm/include/AlarmClockModel.h #/home/hcj/FD230/code/sdk/middleware/services/media/foundation/player/interfaces/kits/player.h #/home/hcj/FD230/code/sdk/middleware/services/gui/uikit/surface/interfaces/kits/surface.h # ${ROOT_DIR}/middleware/services/media/foundation/player/interfaces/kits # ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/player/include -${ROOT_DIR}/application/wearable/fd230/nativeapp/nativelauncher/include -${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks -# ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/player/include + ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativelauncher/include + ${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks + # ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits # /home/hcj/FD230/code/sdk/middleware/services/gui/uikit/surface/interfaces/kits/ibuffer_consumer_listener.h # /home/hcj/FD230/code/sdk/middleware/services/gui/uikit/ui/frameworks/common/typed_text.h ) set(SOURCES -#${CMAKE_CURRENT_SOURCE_DIR}/bletest.cpp -${CMAKE_CURRENT_SOURCE_DIR}/bletest.cpp +${CMAKE_CURRENT_SOURCE_DIR}/bleInstruct.cpp ) set(COMPONENT_PUBLIC_CCFLAGS diff --git a/code/sdk/zhihui/services/ble_service/blemoder/bletest.cpp b/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.cpp similarity index 93% rename from code/sdk/zhihui/services/ble_service/blemoder/bletest.cpp rename to code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.cpp index 21315ae6d..1bb4e0456 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/bletest.cpp +++ b/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.cpp @@ -18,9 +18,9 @@ #include "samgr_lite.h" #include "thread_adapter.h" #include "graphic_service.h" -#include "health_service.h" -#include "phoneaddressmodel.h" -#include "LanguageInit.h" + + + #include "ConfigModel.h" #ifdef SUPPORT_CAT1_SERVICE #include "cat1_server.h" @@ -31,7 +31,6 @@ #include "../../../../../../zhihui/utils/custom_runtime.h" #ifdef FD230 - #include "uiservice/include/ui_service.h" #include "TraingModel.h" #include "WeatherModel.h" @@ -44,26 +43,27 @@ #include "font/ui_font.h" #include "font/base_font.h" #include "common/typed_text.h" - +#include "health_service.h" #include "AlipayC.h" #include "PlayersModelC.h" - - -#endif +#include "LanguageInit.h" +#include "phoneaddressmodel.h" #include "AlmmgrAlarmClockManage.h" #include "AlarmClockTimerConfig.h" #include "AlarmClockManage.h" - #include "SetDialModel.h" -//#include "AlarmClockModel.h" #include "AiVoiceModel.h" #include "SleepModel.h" #include "BluetoothModel.h" #include "MusicPlayerModel.h" #include "UiConfig.h" -// #include "AlarmClockModel.h" -//#include "AlarmClockModel.h" +#endif + + + + + #ifdef __cplusplus #if __cplusplus extern "C" { @@ -93,7 +93,10 @@ extern "C" { #include "custom_utils.h" #include "string.h" #include "bleService.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include #include @@ -2405,94 +2408,6 @@ void ble_UpdateMainWeatherData(void) { SendMsgToUIService(UI_UPDATE_WEATHER_DATA,0,nullptr,0); } -message_infor_t message_infor_s; -void read_message_data(void) -{ - if(!creatMessageDir())//创建失败 - { - return; - } - uint32_t data_len = 0; - FILE *jsfile = fopen(ANCS_DATA_CJSON_PATH, "r"); - cJSON *data_root; - if (jsfile != NULL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"succes opening file\n"); - fseek(jsfile, 0, SEEK_END); - long fileSize = ftell(jsfile); - fseek(jsfile, 0, SEEK_SET); - - char *jsonData = (char *)malloc(fileSize + 1); - fread(jsonData, 1, fileSize, jsfile); - jsonData[fileSize] = '\0'; - fclose(jsfile); - - // 解析JSON数据 - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"jsonData %s",jsonData); - data_len = strlen(jsonData); - data_root= cJSON_Parse(jsonData); - free(jsonData); - if(data_len > 0)//只有读出来的内容不为空就认为文件里面有数据 - { - cJSON *dataList = cJSON_GetObjectItem(data_root, "infor"); - if (dataList != NULL && cJSON_IsArray(dataList))//判断是否为NULL并且是否为数组类型的内容 - { - int count = cJSON_GetArraySize(dataList);//获取数组的大小 10//9 8 7 6 5 4 3 2 1 0 - memset(&message_infor_s,0,sizeof(message_infor_t)); - message_infor_s.num = count; - for (uint8_t i = 0; i < count; i++)//反序存储是反序 所以读出来显示也需要反序度 - { - cJSON *object = NULL; - cJSON *uid_t = NULL; - cJSON *appid_t = NULL; - cJSON *title_buf = NULL; - cJSON *msg_buf = NULL; - cJSON *time = NULL; - cJSON *hasCode = NULL; - cJSON *read_t = NULL; - object = cJSON_GetArrayItem(dataList,i);//1 0 - uid_t = cJSON_GetObjectItem(object, "uid"); - appid_t = cJSON_GetObjectItem(object, "appid_t"); - title_buf = cJSON_GetObjectItem(object, "title"); - msg_buf = cJSON_GetObjectItem(object, "msg"); - time = cJSON_GetObjectItem(object, "time"); - hasCode = cJSON_GetObjectItem(object, "hasCode"); - read_t = cJSON_GetObjectItem(object, "read"); - message_infor_s.message_t[i].uid = uid_t->valueint;// - message_infor_s.message_t[i].appid = appid_t->valueint; - if(strlen(title_buf->valuestring) != 0)//10 - { - memcpy(message_infor_s.message_t[i].title,title_buf->valuestring,strlen(title_buf->valuestring)); - }else{ - memset(message_infor_s.message_t[i].title,0,TITLE_BUF_LEN); - - } - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s.message_t[i].title:%s",message_infor_s.message_t[i].title); - - if(strlen(msg_buf->valuestring) != 0) - { - memcpy(message_infor_s.message_t[i].msg,msg_buf->valuestring,strlen(msg_buf->valuestring)); - }else{ - memset(message_infor_s.message_t[i].msg,0,MSG_BUF_LEN); - } - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s.message_t[count - 1- i].msg:%s",message_infor_s.message_t[i].msg); - message_infor_s.message_t[i].time = time->valueint; - message_infor_s.message_t[i].hasCode = hasCode->valueint; - message_infor_s.message_t[i].read = read_t->valueint; - } - } - } - cJSON_Delete(data_root); - } - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s.num%d\r\n",message_infor_s.num); //2 1 0 - // for(uint8_t i = message_infor_s.num-1;i > 0 ;i--) - // { - // // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s:title %s msg :%s\r\n",message_infor_s.message_t[i].title,message_infor_s.message_t[i].msg); - // } -} -message_infor_t *get_message_info(void) -{ - return &message_infor_s; -} void ble_add_message_index(uint32_t old_index) { @@ -3404,7 +3319,9 @@ void ble_set_sleep_remind(msg_get_sleep_param_info_t data) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP_REMIND,data.bedtime_alarm); //更新睡眠配置 - OHOS::SleepModel::GetInstance().set_sleep_goal(); + #ifdef FD230 + OHOS::SleepModel::GetInstance().set_sleep_goal(); + #endif } return; @@ -3708,7 +3625,10 @@ void set_languaage(uint32_t id) char *addressbook(void)//获取通讯录保存文件地址路径 { + #ifdef FD230 return ADDRESS_BOOK_PATH; + #endif + return NULL; } void addressbookToRead(char *buf)//转化用于·c文件 @@ -4105,94 +4025,7 @@ void ble_UpdateMainWeatherData(void) { } -message_infor_t message_infor_s; -void read_message_data(void) -{ - if(!creatMessageDir())//创建失败 - { - return; - } - uint32_t data_len = 0; - FILE *jsfile = fopen(ANCS_DATA_CJSON_PATH, "r"); - cJSON *data_root; - if (jsfile != NULL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"succes opening file\n"); - fseek(jsfile, 0, SEEK_END); - long fileSize = ftell(jsfile); - fseek(jsfile, 0, SEEK_SET); - - char *jsonData = (char *)malloc(fileSize + 1); - fread(jsonData, 1, fileSize, jsfile); - jsonData[fileSize] = '\0'; - fclose(jsfile); - - // 解析JSON数据 - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"jsonData %s",jsonData); - data_len = strlen(jsonData); - data_root= cJSON_Parse(jsonData); - free(jsonData); - if(data_len > 0)//只有读出来的内容不为空就认为文件里面有数据 - { - cJSON *dataList = cJSON_GetObjectItem(data_root, "infor"); - if (dataList != NULL && cJSON_IsArray(dataList))//判断是否为NULL并且是否为数组类型的内容 - { - int count = cJSON_GetArraySize(dataList);//获取数组的大小 10//9 8 7 6 5 4 3 2 1 0 - memset(&message_infor_s,0,sizeof(message_infor_t)); - message_infor_s.num = count; - for (uint8_t i = 0; i < count; i++)//反序存储是反序 所以读出来显示也需要反序度 - { - cJSON *object = NULL; - cJSON *uid_t = NULL; - cJSON *appid_t = NULL; - cJSON *title_buf = NULL; - cJSON *msg_buf = NULL; - cJSON *time = NULL; - cJSON *hasCode = NULL; - cJSON *read_t = NULL; - object = cJSON_GetArrayItem(dataList,i);//1 0 - uid_t = cJSON_GetObjectItem(object, "uid"); - appid_t = cJSON_GetObjectItem(object, "appid_t"); - title_buf = cJSON_GetObjectItem(object, "title"); - msg_buf = cJSON_GetObjectItem(object, "msg"); - time = cJSON_GetObjectItem(object, "time"); - hasCode = cJSON_GetObjectItem(object, "hasCode"); - read_t = cJSON_GetObjectItem(object, "read"); - message_infor_s.message_t[i].uid = uid_t->valueint;// - message_infor_s.message_t[i].appid = appid_t->valueint; - if(strlen(title_buf->valuestring) != 0)//10 - { - memcpy(message_infor_s.message_t[i].title,title_buf->valuestring,strlen(title_buf->valuestring)); - }else{ - memset(message_infor_s.message_t[i].title,0,TITLE_BUF_LEN); - - } - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s.message_t[i].title:%s",message_infor_s.message_t[i].title); - if(strlen(msg_buf->valuestring) != 0) - { - memcpy(message_infor_s.message_t[i].msg,msg_buf->valuestring,strlen(msg_buf->valuestring)); - }else{ - memset(message_infor_s.message_t[i].msg,0,MSG_BUF_LEN); - } - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s.message_t[count - 1- i].msg:%s",message_infor_s.message_t[i].msg); - message_infor_s.message_t[i].time = time->valueint; - message_infor_s.message_t[i].hasCode = hasCode->valueint; - message_infor_s.message_t[i].read = read_t->valueint; - } - } - } - cJSON_Delete(data_root); - } - // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s.num%d\r\n",message_infor_s.num); //2 1 0 - // for(uint8_t i = message_infor_s.num-1;i > 0 ;i--) - // { - // // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"message_infor_s:title %s msg :%s\r\n",message_infor_s.message_t[i].title,message_infor_s.message_t[i].msg); - // } -} -message_infor_t *get_message_info(void) -{ - return &message_infor_s; -} void ble_add_message_index(uint32_t old_index) { diff --git a/code/sdk/zhihui/services/ble_service/blemoder/bletest.h b/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.h similarity index 93% rename from code/sdk/zhihui/services/ble_service/blemoder/bletest.h rename to code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.h index afb704f2a..53b85dff0 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/bletest.h +++ b/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.h @@ -2,7 +2,6 @@ * @Date: 2024-04-18 17:25:04 * @LastEditors: Caisking 3449750381@qq.com * @LastEditTime: 2024-04-18 17:44:00 - * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h */ /** * Copyright (c) @CompanyNameMagicTag 2022-2022. All rights reserved. \n @@ -25,7 +24,9 @@ extern "C" #include "stdint.h" #include "errcode.h" + #include "bleEvent.h" + #include "cJSON.h" @@ -57,7 +58,7 @@ extern "C" } transmitting_type; - enum PAIRING +enum PAIRING { DEVICEBIND = 0, DEVICEUNBIND, // 设备解绑通知 @@ -90,27 +91,6 @@ extern "C" uint8_t controlmd; // 训练控制md } training_ble; -#define MAX_MESSAGE_NUM 10 -#define TITLE_BUF_LEN 256 -#define MSG_BUF_LEN 1024 -typedef struct ancs_data_info -{ - uint32_t time;//时间戳 - int uid;//uid 消息唯一编号 - int appid;//消息类型:1:微信 2:QQ 3:短信 4:其他 - char *title;//消息发送者 - char *msg;//消息内容 - int hasCode;//消息hash code - int read; //是否已读 0 未读 1 已读 - int titlelen; - int msglen; -}ancs_data_info_t; - -struct message_infor_t -{ - uint8_t num; - ancs_data_info_t message_t[MAX_MESSAGE_NUM]; -}; typedef struct { @@ -126,7 +106,6 @@ typedef struct void read_message_data(void);//读内存信息数据开机读一次 -struct message_infor_t *get_message_info(void); void set_weather_now_data(int humidity, char* windScale, char* textNight,int uvIndex,int temp,int iconNight); void set_weather_address_data(int lat, char* atm, char* city,char* subLocality,int lon); diff --git a/code/sdk/zhihui/services/ble_service/bleservice/CMakeLists.txt b/code/sdk/zhihui/services/ble_service/bleservice/CMakeLists.txt index 38d955413..29e689001 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/CMakeLists.txt +++ b/code/sdk/zhihui/services/ble_service/bleservice/CMakeLists.txt @@ -39,13 +39,23 @@ set(PRIVATE_HEADER ${ROOT_DIR}/application/wearable/nativeapp/nativeui/screennotify/include ) endif() +if("FD230" IN_LIST DEFINES) set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/bleService.c ${CMAKE_CURRENT_SOURCE_DIR}/bleEvent.c ${CMAKE_CURRENT_SOURCE_DIR}/bleANCS.c - + +) +else() +set(SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/bleService.c + # ${CMAKE_CURRENT_SOURCE_DIR}/bleEvent.c + ${CMAKE_CURRENT_SOURCE_DIR}/bleANCS.c + ) +endif() + set(COMPONENT_PUBLIC_CCFLAGS ) diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c b/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c index 6c5646bd6..876873f87 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.c @@ -36,7 +36,9 @@ #include "build_version.h" #include "custom_runtime.h" #include "custom_utils.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif #ifdef SUPPORT_AT_OHOSFWK #include "BluetoothWrapper.h" #endif diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.h b/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.h index 15f3e2ada..dd0cafa31 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.h +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleANCS.h @@ -26,6 +26,22 @@ typedef struct filtration_data_t char name[filtration_data_max_len]; }filtration_data; +#define MAX_MESSAGE_NUM 10 +#define TITLE_BUF_LEN 256 +#define MSG_BUF_LEN 1024 +typedef struct ancs_data_info +{ + uint32_t time;//时间戳 + int uid;//uid 消息唯一编号 + int appid;//消息类型:1:微信 2:QQ 3:短信 4:其他 + char *title;//消息发送者 + char *msg;//消息内容 + int hasCode;//消息hash code + int read; //是否已读 0 未读 1 已读 + int titlelen; + int msglen; +}ancs_data_info_t; + void gattc_reg_id(void); uint8_t ble_ancs_client_cmd_setup_and_subscribe(uint16_t conn_id); diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c index 92e18396c..aa12365de 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c @@ -39,7 +39,10 @@ extern "C" { #include "errcode.h" #include "sys/statfs.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "custom_utils.h" #include "custom_runtime.h" #include "bleANCS.h" diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.h b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.h index 63ec74783..bd095c624 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.h +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.h @@ -9,7 +9,11 @@ extern "C" { #include "stdbool.h" #include "errcode.h" #include "bts_def.h" -// #include "bletest.h" + +// #ifdef BLE_INSTRUCT +// // #include "bleInstruct.h" +// #endif + #define PHONE_WATCH_CONFIG_PATH "/user/userdata/phone_watch.json" #define ALARM_DATA_CONFIG_PATH "/user/userdata/alarm_test.json" @@ -689,7 +693,6 @@ typedef struct { uint8_t frequenc;//提醒频率 }msg_sedent_set_param_info_t; - #pragma pack() /****************************************** * @@ -765,7 +768,6 @@ typedef struct } file_recv_stat_t; - uint8_t get_OTA_recv_value(void); diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleService.c b/code/sdk/zhihui/services/ble_service/bleservice/bleService.c index 13eb931a4..1052df47d 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleService.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleService.c @@ -40,7 +40,12 @@ extern "C" { #include "build_version.h" #include "custom_runtime.h" #include "custom_utils.h" -#include "bletest.h" +#ifdef BLE_INSTRUCT +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif +#endif + #include "ConfigModelC.h" #ifdef SUPPORT_AT_CYWEE #include "cywee_ble_Service.h" @@ -2125,7 +2130,9 @@ static void blesrv_service_check_task(void const *arg) // } else{ + #ifdef BLE_INSTRUCT revBleOldData(p_msgbuf,msg_len,server_handle); + #endif } #endif if(mail.msg_data) diff --git a/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c b/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c index 37554b3e5..bef190ae5 100644 --- a/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c +++ b/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c @@ -39,7 +39,11 @@ #include "nandflash_config.h" #include "string.h" #include "custom_runtime.h" -#include "bletest.h" + +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "battery_service.h" #include "cywee_service.h" #include "broadcast_feature.h" @@ -47,8 +51,9 @@ #include "lwip/api_shell.h" #endif #include "input_app.h" +#ifdef FD230 #include "PhoneServiceC.h" - +#endif #pragma pack(1) typedef struct factorytest_cmd_header_t { @@ -514,9 +519,12 @@ void factorytest_protocol_common_decode(uint8_t submode,uint8_t testitem,uint8_t 0x01, &send_data, 1); + #ifdef FD230 uapi_hfp_connect_(); LOS_Msleep(500); uapi_a2dp_snk_connect_(); + #endif + } else if (testitem == 0x02) { @@ -1891,8 +1899,9 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint { //通讯录 uint8_t send_data = 0x00; - + #ifdef BLE_INSTRUCT add_addressbookToRead((char *)data); + #endif factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CONTACTS, @@ -1975,15 +1984,20 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint if (testitem == 0x06) { - uint8_t send_data = 0x00; + #ifdef FD230 + uapi_hfp_connect_(); LOS_Msleep(500); uapi_a2dp_snk_connect_(); + #endif + + uint8_t send_data = 0x00; factorytest_protocol_replymsg(BLE_TEST_CMD_MODE_SOFT_TEST, BLE_TEST_CMD_SOFT_TEST_SUB_MODE_SPEAKER, 0x03, &send_data, 1); + } break; diff --git a/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.h b/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.h index 4abd63521..f4eae3bbe 100644 --- a/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.h +++ b/code/sdk/zhihui/services/factorytest_service/factorytest_protocol.h @@ -98,6 +98,7 @@ extern "C" { //软件测试 子模式ID 支付宝 #define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ALIPAY 0x31 +#define AGINGTEST #pragma pack(1) typedef struct diff --git a/code/sdk/zhihui/utils/CMakeLists.txt b/code/sdk/zhihui/utils/CMakeLists.txt index 75c954344..d17c1474e 100644 --- a/code/sdk/zhihui/utils/CMakeLists.txt +++ b/code/sdk/zhihui/utils/CMakeLists.txt @@ -19,11 +19,9 @@ set(SOURCES set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR} - ) set(PRIVATE_HEADER - ${ROOT_DIR}/application/audio/thread/ ${ROOT_DIR}/application/audio ${ROOT_DIR}/drivers/drivers/driver/audio/source/include @@ -71,6 +69,7 @@ set(PRIVATE_HEADER ${ROOT_DIR}/application/wearable/nativeapp/nativeui/screennotify/include ) endif() + set(PRIVATE_DEFINES TARGET_NAME="${TARGET_COMMAND}" BUILD_TIME="${BUILD_TIME}" diff --git a/code/sdk/zhihui/utils/custom_cmd_service.c b/code/sdk/zhihui/utils/custom_cmd_service.c index 07b07f7c4..6db2a03ce 100644 --- a/code/sdk/zhihui/utils/custom_cmd_service.c +++ b/code/sdk/zhihui/utils/custom_cmd_service.c @@ -43,7 +43,7 @@ void HandleUpdatelcdMode(int f){} void set_ota_upgrade(void){} void custom_timer_callback(void){} -void Check_ble_adv_status(void){} +// void Check_ble_adv_status(void){} void check_dial_space(void){} int uapi_hfp_disconnect_(void){return 0;} @@ -60,7 +60,9 @@ void cat1_start_SCO_audio_(void){} #endif #ifdef SUPPORT_BLE_SERVICE -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif #endif typedef struct @@ -204,9 +206,12 @@ static void custom_cmd_service_check_task(void const *arg) case CUSTOM_CMD_MSG_TYPE_RESTORE_FACTORY_SETTING: { #ifdef SUPPORT_BLE_SERVICE +#ifdef BLE_INSTRUCT ble_Alipayunbind(); + // UnbindSucessCmd(1);//1确认解绑 watch_clean_pairs(); +#endif #endif uapi_restore_factory_setting(); } @@ -289,6 +294,7 @@ static void custom_cmd_service_check_task(void const *arg) case CUSTOM_CMD_MSG_BR_CONNECT: #ifdef SUPPORT_BLE_SERVICE +#ifdef FD230 switch (mail.data[0]) { //hfp connect @@ -318,6 +324,7 @@ static void custom_cmd_service_check_task(void const *arg) default: break; } +#endif #endif break; case CUSTOM_CMD_MSG_CHECK_RES: diff --git a/code/sdk/zhihui/utils/custom_fileoperate_service.c b/code/sdk/zhihui/utils/custom_fileoperate_service.c index 7e4536d50..47e98d635 100644 --- a/code/sdk/zhihui/utils/custom_fileoperate_service.c +++ b/code/sdk/zhihui/utils/custom_fileoperate_service.c @@ -63,11 +63,14 @@ void custom_sleep_model_updata(void){} void update_sleep_data(uint32_t sleep_timestamp,uint32_t wake_timestamp,uint32_t totaltime){} void update_nap_data(uint32_t sleep_timestamp,uint32_t wake_timestamp,uint32_t totaltime){} void custom_read_wear_data(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){} +#ifndef FACTORYTEST_SERVICE +// 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){} +#endif + void stopPlayingMusic(void){} void custom_setUpListCase(void){} bool canSyncMusic(uint32_t songSize){return true;} @@ -79,7 +82,10 @@ void CheckRecordingSpaceOutC(void){} #endif #ifdef SUPPORT_BLE_SERVICE -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif + #include "factorytest_protocol.h" #endif diff --git a/code/sdk/zhihui/utils/custom_save_runtime.c b/code/sdk/zhihui/utils/custom_save_runtime.c index c384cc4f4..603373e67 100644 --- a/code/sdk/zhihui/utils/custom_save_runtime.c +++ b/code/sdk/zhihui/utils/custom_save_runtime.c @@ -39,7 +39,9 @@ #include "alarmclocktimerconfig/include/AlarmClockTimerConfig.h" #endif #ifdef SUPPORT_BLE_SERVICE -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif #endif #include diff --git a/code/sdk/zhihui/utils/custom_utils.c b/code/sdk/zhihui/utils/custom_utils.c index 79145d996..9e12fc3d1 100644 --- a/code/sdk/zhihui/utils/custom_utils.c +++ b/code/sdk/zhihui/utils/custom_utils.c @@ -289,7 +289,9 @@ void shutdown_reboot_prejobs_task(void) { // printf(); #ifdef SUPPORT_BLE_SERVICE +#ifdef FD230 C_ScheduleDataWriteToFile(); //同步的时候进行保存 +#endif #endif // mmi_sleep_mode_switch_write();//不需要保存 @@ -425,16 +427,20 @@ bool enable_spp_service(bool _enable) uapi_dev_runtime_set_br_connect_stat(stat); return true; } +#ifdef SUPPORT_BLE_SERVICE + extern void bluetooth_close_all(void); + extern void bluetooth_enable_all(void); +#endif -extern void bluetooth_close_all(void); -extern void bluetooth_enable_all(void); bool start_custom_ble_service(void) { //加锁避免bt 初始化失败 // uint32_t irq_sts = osal_irq_lock(); #ifdef SUPPORT_BLE_SERVICE +#ifdef FD230 PRINT("start custom protocol classic bt ble service !\r\n"); bluetooth_enable_all(); +#endif #endif //if(!uapi_dev_runtime_get_saveele_status()) { @@ -448,7 +454,10 @@ bool stop_custom_ble_service(void) { #ifdef SUPPORT_BLE_SERVICE PRINT("stop custom protocol classic bt ble service !\r\n"); +#ifdef FD230 bluetooth_close_all(); +#endif + #endif //if(!uapi_dev_runtime_get_saveele_status()) { @@ -536,7 +545,10 @@ void startup_post_init_task(void) } #ifdef SUPPORT_BLE_SERVICE +#ifdef BLE_INSTRUCT addressbookToRead(NULL); +#endif + #endif ble_SOS_data_init(); diff --git a/code/sdk/zhihui/utils/custom_utils_at_cmd.c b/code/sdk/zhihui/utils/custom_utils_at_cmd.c index 7aa2d63b5..b4b1865c9 100644 --- a/code/sdk/zhihui/utils/custom_utils_at_cmd.c +++ b/code/sdk/zhihui/utils/custom_utils_at_cmd.c @@ -1111,7 +1111,9 @@ static uint32_t PBAP_LS(uint8_t *para, uint32_t paraLen, char *strCommonCmd) } #ifdef SUPPORT_BLE_SERVICE -#include "bletest.h" +#ifdef BLE_INSTRUCT +#include "bleInstruct.h" +#endif #endif #ifdef FD230 diff --git a/code/sdk/zhihui/utils/pdu.c b/code/sdk/zhihui/utils/pdu.c index 8670e5f76..312d36407 100644 --- a/code/sdk/zhihui/utils/pdu.c +++ b/code/sdk/zhihui/utils/pdu.c @@ -433,7 +433,9 @@ int pdu_decode_example(const char *inpdustr, uint32_t ref,uint16_t num, uint16_ if(pdu_data_t[pdu_flag].total_num==1) { #ifdef SUPPORT_BLE_SERVICE +#ifdef FD230 message_data(0,0,phone_number,text,0); +#endif #endif free(pdu_data_t[pdu_flag].phone_number); free(pdu_data_t[pdu_flag].text); @@ -491,7 +493,9 @@ int pdu_decode_example(const char *inpdustr, uint32_t ref,uint16_t num, uint16_ printf("pdu_data_t[%d].text %s\r\n",find_fist_seq,pdu_data_t[find_fist_seq].text); #ifdef SUPPORT_BLE_SERVICE +#ifdef FD230 message_data(0,0,pdu_data_t[find_fist_seq].phone_number,pdu_data_t[find_fist_seq].text,0); +#endif #endif free(pdu_data_t[find_fist_seq].phone_number); pdu_data_t[find_fist_seq].phone_number=NULL; -- 2.17.1