From 70f30bd9689378ef6d50b9e48a2f2cae9a078433 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E4=BC=A0=E5=86=9B?= <1224667075@qq.com> Date: Fri, 1 Nov 2024 12:29:43 +0000 Subject: [PATCH] Merge #1317 into sdk602patch0911 from refs/changes/1317/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 胡传军 * refs/changes/1317/head: (13 commits squashed) - 修改SOS 8s触发为3s触发 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 - 蓝牙上传tar文件位置修改 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 - A2DP断连修改 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 - 修改4G模块最大声音 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 - 优化A2DP及HFP回连效果 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 - 统一OTA升级路径 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 Signed-off-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: Caisking <3449750381@qq.com> Reviewed-by: 罗正 <1732036298@qq.com> Reviewed-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Reviewed-by: aliyun6865282430 <1624952103@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1317 --- .../nativeui/bluetooth/src/BluetoothModel.cpp | 20 +++++-- .../src/BluetoothServiceOptionsView.cpp | 32 ++++++++---- .../src/ClassicBlueToothPresenter.cpp | 14 +++-- .../phoneservice/include/PhoneService.h | 2 + .../phoneservice/src/PhoneService.cpp | 52 +++++++++++++++++-- .../nativeui/system/include/Systemupgrade.h | 10 ++-- .../nativeui/system/src/Systemupgrade.cpp | 36 +------------ .../systemupdate/include/SystemUpdateModel.h | 10 ++-- .../service/ble_service/bleservice/bleEvent.c | 22 ++++---- .../ble_service/bleservice/bleService.c | 21 ++++++-- .../msg_center/src/ota/msg_center_ota.cpp | 5 +- 11 files changed, 143 insertions(+), 81 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index 4fa4ea6e5..296584dcc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -1462,11 +1462,23 @@ static void BtA2dpSnkConnectStateChangedCb(bd_addr_t *bd_addr, int conn_state) } else if (conn_state==PROFILE_STATE_CONNECTING || conn_state==PROFILE_STATE_CONNECTED) { +#ifdef BR_DISCONNECT + if(!cm_get_A2DP_switch()) + { + uapi_a2dp_snk_disconnect(); + return; + } + + if(cm_get_HFP_switch() && uapi_hfp_connect_state()==0) + { + uapi_hfp_connect(); + } +#endif SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0); SendMsgToMsgCenterService(BT_CONNECTED_TO_MSGCENTER, 0, nullptr, 0); - if(pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTING || - pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTED) - uapi_pbap_cmd_start_client(); + // if(pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTING || + // pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTED) + // uapi_pbap_cmd_start_client(); // if(conn_state==PROFILE_STATE_CONNECTED) // { // if(pbap_pce_get_device_connect_state(bd_addr)==PROFILE_STATE_DISCONNECTED) @@ -1850,7 +1862,7 @@ int uapi_a2dp_snk_disconnect_() uapi_get_br_address(&bdaddr); int ret = a2dp_snk_disconnect(&bdaddr); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"state(int): %d\n", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"state(int): %X\n", ret); return ret; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp index b1fbfccc5..bbaff85f7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp @@ -9,7 +9,7 @@ #include "ui_resource_string.h" #include "cmsis_os2.h" #include "graphic_service.h" - +#include "ConfigModelC.h" namespace OHOS { static BluetoothServiceOptionsView *g_pBluetoothServiceOptionsView{nullptr}; @@ -94,7 +94,7 @@ namespace OHOS static osTimerId_t MG_TEST_timer=NULL; static uint8_t button_state=0; static uint8_t count_num=0; - + static uint8_t connect_state=0; bool BluetoothServiceOptionsView::get_connectview_Visible(void) { return connectingScrollView->IsVisible(); @@ -102,36 +102,48 @@ namespace OHOS static void connectTimerCallBackProc(int data) { - bool connect_state=false; + count_num++; switch (button_state) { case BluetoothServiceOptionsView::CONNECT_HFP: if(uapi_hfp_connect_state()) { - //BluetoothServiceOptionsView::GetInstance()->show_connecting_view(false); - connect_state=true; + if(cm_get_A2DP_switch()&&uapi_a2dp_snk_get_device_connect_state()) + { + connect_state++; + } + else if(!cm_get_A2DP_switch()) + { + connect_state++; + } + + } break; case BluetoothServiceOptionsView::DISCONNECT_HFP: if(!uapi_hfp_connect_state()) { //BluetoothServiceOptionsView::GetInstance()->show_connecting_view(false); - connect_state=true; + + { + connect_state++; + } + } break; case BluetoothServiceOptionsView::CONNECT_A2DP: if(uapi_a2dp_snk_get_device_connect_state()) { //BluetoothServiceOptionsView::GetInstance()->show_connecting_view(false); - connect_state=true; + connect_state++; } break; case BluetoothServiceOptionsView::DISCONNECT_A2DP: if(!uapi_a2dp_snk_get_device_connect_state()) { //BluetoothServiceOptionsView::GetInstance()->show_connecting_view(false); - connect_state=true; + connect_state++; } break; @@ -139,7 +151,7 @@ namespace OHOS break; } - if(count_num==9 || connect_state) + if(count_num==9 || connect_state>=2) { if( BluetoothServiceOptionsView::GetInstance()) BluetoothServiceOptionsView::GetInstance()->show_connecting_view(false); @@ -191,6 +203,8 @@ namespace OHOS } MG_TEST_timer = osTimerNew((osTimerFunc_t)connectTimerCallBack, osTimerPeriodic, NULL, NULL); tick =500; + connect_state=0; + retTimer = osTimerStart(MG_TEST_timer, tick); if (retTimer != osOK && MG_TEST_timer != NULL) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"StartCallTimer osTimerStart failed, ret = %lx!!", retTimer); diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp index 12cdc63ae..6d0cbaf55 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp @@ -18,6 +18,7 @@ #include "BluetoothModel.h" #include "custom_runtime.h" #include "ConfigModelC.h" +#include "PhoneService.h" namespace OHOS { // 当前Presenter属性实例化的内存指针 @@ -126,7 +127,7 @@ namespace OHOS uapi_get_br_address(&bdaddr); if( uapi_dev_runtime_get_bt_powerstat() && (cm_get_HFP_switch()||cm_get_A2DP_switch())) { - if (false==bt_is_acl_connected(&bdaddr) && !(bdaddr.addr[0]==0 && bdaddr.addr[1]==0 && bdaddr.addr[2]==0 && bdaddr.addr[3]==0 + if ( cm_get_HFP_switch()&& cm_get_A2DP_switch() && false==bt_is_acl_connected(&bdaddr) && !(bdaddr.addr[0]==0 && bdaddr.addr[1]==0 && bdaddr.addr[2]==0 && bdaddr.addr[3]==0 && bdaddr.addr[4]==0 && bdaddr.addr[5]==0)) { int ret = gap_reconnect_media_device(&bdaddr); @@ -135,8 +136,15 @@ namespace OHOS else { - if(cm_get_A2DP_switch() || cm_get_HFP_switch()) - uapi_a2dp_snk_connect(); + if(cm_get_A2DP_switch()) + { + uapi_a2dp_snk_connect(); + } + if(cm_get_HFP_switch()) + { + uapi_hfp_connect(); + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_a2dp_snk_connect!!! \r\n"); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h index 4cd62dbfb..c4c7919f1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h @@ -12,6 +12,8 @@ #include "ohos_types.h" #include "PhoneAudio.h" +#define BR_DISCONNECT + #ifdef __cplusplus extern "C" { #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index 1c9210e0a..1760f8829 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -37,7 +37,7 @@ #include "custom_runtime.h" #include "vibrator_service.h" #include "gfx_utils/mem_api.h" -#include "ConfigModel.h" +#include "ConfigModelC.h" #include "cat1_ctl.h" #ifdef __cplusplus extern "C" { @@ -649,10 +649,30 @@ static void ConnStateChanged(const bd_addr_t *bdAddr, profile_connect_state_t st switch (state) { case PROFILE_STATE_CONNECTING: // 蓝牙正在连接 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT connecting"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT connecting"); + #ifdef BR_DISCONNECT + if(!cm_get_HFP_switch()) + { + uapi_hfp_disconnect(); + return; + } + #endif break; case PROFILE_STATE_CONNECTED: // 蓝牙连接成功 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[ConnStateChanged] BT connected"); + #ifdef BR_DISCONNECT + if(!cm_get_HFP_switch()) + { + uapi_hfp_disconnect(); + return; + } + + if(cm_get_A2DP_switch() && OHOS::uapi_a2dp_snk_get_device_connect_state()==0) + { + OHOS::uapi_a2dp_snk_connect(); + } + + #endif BtConnectedPro(bdAddr); SendMsgToUIService(BT_CONNECTED_TO_UI, 0, nullptr, 0); uapi_pbap_cmd_start_client(); @@ -2166,6 +2186,8 @@ int TransCallToMobilePhone(void) } } +#include "los_base.h" + int uapi_hfp_disconnect_(void) { int ret; @@ -2181,6 +2203,10 @@ int uapi_hfp_disconnect_(void) int uapi_hfp_connect_(void) { + // if(uapi_hfp_connect_state()==1) + // { + // return; + // } int ret; bd_addr_t bdaddr={0}; OHOS:: uapi_get_br_address(&bdaddr); @@ -2197,10 +2223,28 @@ int uapi_hfp_connect_(void) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[bt_is_acl_connected is true"); ret = hfp_hf_connect(&bdaddr); - if(ret!=ERRCODE_SUCC) + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[uapi_hfp_connect] ret:%X", ret); + if(ret==0x8000600B) { - ret=gap_reconnect_media_device(&bdaddr); + gap_disconnect_remote_device(&bdaddr); + sleep(1); + //if(ret!=ERRCODE_SUCC) + { + ret=gap_reconnect_media_device(&bdaddr); + } + + + } + else + { + if(ret!=ERRCODE_SUCC) + { + ret=gap_reconnect_media_device(&bdaddr); + } } + + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[uapi_hfp_connect] ret:%X", ret); } 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 7caa5aa55..b6854155b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h @@ -11,7 +11,7 @@ #include "components/ui_label_ext.h" #include "components/ui_label_button_ext.h" #include "cat1_ctl.h" - +#include "upg_common_porting.h" #if USE_THISIOT #define HTTP_JSON_SERVER_NAME "test.iot.api.thisiot.com"//"test.app.api.thisiot.com"//获取升级服务器 @@ -25,9 +25,7 @@ * http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=V1.1_20240316_115535&imei=864430010001091 查看 返回的"UptoDate" == False,即可根据"url"地址下载,文件校验可以后面再加。 { "UptoDate": false , - "url" : "http://icfota.snicker.com.cn:8089/FD230/V1.1_20240316_115535/update.fwpkg", -"OtaPackageLength" : 177504, - "OtaPackageName" : "update.fwpkg", + "OtaPackageVersion" : "V1.1_20240316_130929", "SystemVersion" : "V1.1_20240316_115535", "description" : " update to checkota version 3 ", @@ -45,14 +43,14 @@ #define UPDATAJSONPATH "/user/update/ota_start_.json"//获取升级的得到的json #define UPDATAREPORT "/user/update/ota_start_reported_.json"//点升级后保存下来的json -#define UPDATAFWPKGPATH "/user/update/update.fwpkg" //升级包 +#define UPDATAFWPKGPATH UPG_FILE_NAME //升级包 #define UPDATAREPORT_ "/user/update/ota_report_.json"//上报升级得到的json #else #define UPDATAJSONPATH "/update/ota_start_.json"//获取升级的得到的json #define UPDATAREPORT "/update/ota_start_reported_.json"//点升级后保存下来的json -#define UPDATAFWPKGPATH "/update/update.fwpkg" //升级包 +#define UPDATAFWPKGPATH UPG_FILE_NAME //升级包 #define UPDATAREPORT_ "/update/ota_report_.json"//上报升级得到的json #endif 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 4dac40ee6..5182cda6d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp @@ -167,34 +167,7 @@ namespace OHOS char msg_buf[256]={0}; bool falg=false; - // if(code==IOT_CODE_SUCCESS) - // { - // falg=true; - // cJSON *data=cJSON_GetObjectItem(root, "data"); - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, ""); - - // report_jsonString = cJSON_PrintUnformatted(data); - // //cJSON_Delete(data); - - // if(data!=NULL) - // { - // cJSON *downloadFileVo=cJSON_GetObjectItem(data, "downloadFileVo"); - - // if(downloadFileVo!=NULL) - // { - - // //"http://r-oss.thisiot.com/device-ota/2024_04_22/1782329689464958978.fwpkg?Expires=1713780167&OSSAccessKeyId=LTAI5tJa2arDBmqSUsSTQJ1T&Signature=OlbdNsfnz9Zje6ypFgXINQPXVE0%3D" - // // char *uri = "http://icfota.snicker.com.cn:8089/FD230/V1.1/update.fwpkg"; - // char *uri = cJSON_GetObjectItem(downloadFileVo, "url")->valuestring; - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uri %s",uri); - // sprintf((char *)uri_ota_package,"%s",uri); - // } - // } - // } - // else - // { - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "code!=IOT_CODE_SUCCESS"); - // } + sprintf(msg_buf,"%s",msg); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",msg); @@ -667,13 +640,6 @@ namespace OHOS { if(is_fwpkg_ready) { - // char* Path="/user/data/update.fwpkg"; - // FILE * fp = fopen(Path,"rb"); - // if(fp!=NULL) - // { - // fclose(fp); - // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "file open succse fwpkg_is_ready"); - // } //开始升级 //********** statr_down_fwpkg(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/systemupdate/include/SystemUpdateModel.h b/code/sdk/application/wearable/fd230app/nativeui/systemupdate/include/SystemUpdateModel.h index 2e0675abd..2c19e8a41 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/systemupdate/include/SystemUpdateModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/systemupdate/include/SystemUpdateModel.h @@ -11,7 +11,7 @@ #include #include - +#include "upg_common_porting.h" #define USE_THISIOT 1 // http://iot.api.thisiot.com/ota/task/v2?deviceId=28110668A5D4&sourceVersion=1.1.41 #if USE_THISIOT @@ -26,9 +26,7 @@ * http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=V1.1_20240316_115535&imei=864430010001091 查看 返回的"UptoDate" == False,即可根据"url"地址下载,文件校验可以后面再加。 { "UptoDate": false , - "url" : "http://icfota.snicker.com.cn:8089/FD230/V1.1_20240316_115535/update.fwpkg", -"OtaPackageLength" : 177504, - "OtaPackageName" : "update.fwpkg", + "OtaPackageVersion" : "V1.1_20240316_130929", "SystemVersion" : "V1.1_20240316_115535", "description" : " update to checkota version 3 ", @@ -48,7 +46,7 @@ #define UPDATAREPORT "/user/update/ota_start_reported_.json"//点升级后保存下来的json -#define UPDATAFWPKGPATH "/user/update/update.fwpkg" //升级包 +#define UPDATAFWPKGPATH UPG_FILE_NAME //升级包 #define UPDATAREPORT_ "/user/update/ota_report_.json"//上报升级得到的json @@ -57,7 +55,7 @@ #define UPDATAREPORT "/update/ota_start_reported_.json"//点升级后保存下来的json -#define UPDATAFWPKGPATH "/update/update.fwpkg" //升级包 +#define UPDATAFWPKGPATH UPG_FILE_NAME//升级包 #define UPDATAREPORT_ "/update/ota_report_.json"//上报升级得到的json diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index e50e05978..c3573a8c2 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -55,6 +55,9 @@ extern "C" { #define MAX_BLE_EVENT_DIAL_NUM (10) //表盘最大数量 +#include "upg_common_porting.h" + + uint32_t packdataLen = 0; uint32_t totalDataLen = 0; uint8_t totalpack = 0; @@ -108,10 +111,10 @@ static uint32_t timer_flie_flag=0; ble_read_data* ble_read_timer_p=NULL; #ifdef SINGLE_USER_PARTITION -#define UP_DATE_FWPKG_PATH "/user/update/update.fwpkg" +#define UP_DATE_FWPKG_PATH UPG_FILE_NAME #else -#define UP_DATE_FWPKG_PATH "/update/update.fwpkg" +#define UP_DATE_FWPKG_PATH UPG_FILE_NAME #endif @@ -2885,18 +2888,19 @@ uint8_t parse_jsonCheck_weather(uint8_t *buf,uint8_t *check)//json 格式解析 uapi_get_br_address(&bdaddr); if( uapi_dev_runtime_get_bt_powerstat() && (cm_get_HFP_switch()||cm_get_A2DP_switch())) { - if (false==bt_is_acl_connected(&bdaddr) && !(bdaddr.addr[0]==0 && bdaddr.addr[1]==0 && bdaddr.addr[2]==0 && bdaddr.addr[3]==0 + + if(cm_get_A2DP_switch() && cm_get_A2DP_switch() && false==bt_is_acl_connected(&bdaddr) && !(bdaddr.addr[0]==0 && bdaddr.addr[1]==0 && bdaddr.addr[2]==0 && bdaddr.addr[3]==0 && bdaddr.addr[4]==0 && bdaddr.addr[5]==0)) { - int ret = gap_reconnect_media_device(&bdaddr); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " gap_reconnect_media_device ret = %u %02x %02x %02x ", ret,bdaddr.addr[5],bdaddr.addr[4],bdaddr.addr[3]); + gap_reconnect_media_device(&bdaddr); } - else + else if(cm_get_A2DP_switch()) { - - if(cm_get_A2DP_switch() || cm_get_HFP_switch()) uapi_a2dp_snk_connect(); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_a2dp_snk_connect!!! \r\n"); + } + else if(cm_get_HFP_switch()) + { + uapi_hfp_connect(); } } diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index 41b5a8266..1b9f4b36f 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -39,6 +39,7 @@ extern "C" { #include "custom_runtime.h" #include "custom_utils.h" #include "bletest.h" +#include "ConfigModelC.h" #ifdef SUPPORT_AT_CYWEE #include "cywee_ble_Service.h" #endif @@ -575,8 +576,20 @@ void svr_pair_result_cbt_cb(uint16_t conn_id, const bd_addr_t *addr, errcode_t s if(get_ble_pair()&&( cm_get_A2DP_switch() || cm_get_HFP_switch())) { - int ret=gap_reconnect_media_device(addr); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_reconnect_media_device!!! %X\r\n",ret); + if(cm_get_A2DP_switch() && cm_get_A2DP_switch()) + { + int ret=gap_reconnect_media_device(addr); + } + else if(cm_get_A2DP_switch()) + { + uapi_a2dp_snk_connect(); + } + else if(cm_get_HFP_switch()) + { + uapi_hfp_connect(); + } + + } else { @@ -603,7 +616,6 @@ void svr_pair_result_cbt_cb(uint16_t conn_id, const bd_addr_t *addr, errcode_t s } } hand_watch_first_time_Paired(); - svr_ble_adv_stop(); } } @@ -1605,6 +1617,9 @@ static void svr_ble_mtu_exchange(uint8_t server_id, uint16_t conn_id, uint16_t m /******************* gap_ble ************************************/ void svr_gap_ble_auth_complete_callback(uint16_t conn_id, const bd_addr_t *addr, errcode_t status,ble_auth_info_evt_t* evt) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "sendParieSuccess"); + + sendParieSuccess(1,addr); uapi_set_br_address(addr); } diff --git a/code/sdk/application/wearable/service/msg_center/src/ota/msg_center_ota.cpp b/code/sdk/application/wearable/service/msg_center/src/ota/msg_center_ota.cpp index ca43a62bc..12c458bda 100644 --- a/code/sdk/application/wearable/service/msg_center/src/ota/msg_center_ota.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/ota/msg_center_ota.cpp @@ -18,6 +18,7 @@ #include "msg_center_protocol.h" #include "wearable_log.h" #include "upg_porting.h" + #ifdef SUPPORT_AUTO_OTA #include "auto_ota_service.h" #endif @@ -38,9 +39,9 @@ extern uint8_t g_auto_ota_mac_tmp[]; /* 固定升级包文件长度, "/user/update/update.fwpkg"*/ #ifdef SINGLE_USER_PARTITION -#define UPGRADE_FILE_PATH "/user/update/update.fwpkg" +#define UPGRADE_FILE_PATH UPG_FILE_NAME #else -#define UPGRADE_FILE_PATH "/update/update.fwpkg" +#define UPGRADE_FILE_PATH UPG_FILE_NAME #endif #define UPGRADE_FILE_LEN strlen(UPGRADE_FILE_PATH) -- 2.17.1