From: hcj <1224667075@qq.com> Date: Tue, 12 Nov 2024 07:15:44 +0000 (+0800) Subject: 自动ota场景优化,表盘下载后断连增加优化 X-Git-Tag: fd230_release_V1.3.102~93 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=66839ec886458d9afa608e679c001e1e9e11924a;p=mirrors%2FFD230.git 自动ota场景优化,表盘下载后断连增加优化 --- 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 feb123781..38743aaed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -176,7 +176,11 @@ static int bluetooth_init_all(void) if(uapi_dev_runtime_get_safemode_flag()) { + + gap_remove_all_pairs(); + uapi_dev_runtime_atuoota_status_status(1); + BtInitSpp(); } 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 d0edf1230..c2c4c6f92 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -148,7 +148,7 @@ static errcode_t create_mp3_name(char* path,char*dir_path ,char* file_name) } else { - sprintf_s(path,256,"%s/%s",dir_path,file_name); + sprintf_s(path,256,"%s/%s.mp3",dir_path,file_name); } return ERRCODE_FAIL; @@ -1161,20 +1161,22 @@ void sendBindInfor(uint8_t *data) #else devnamelen = 0; getPhoneNameLen(data,&devnamelen,&phone_type);//获取手机下发的手机设备名称长度 - if(devnamelen > 0 ) + + if(phone_type==0) { - if(phone_type==0) + unsigned int paired_devices_num=0; + bool gap_get_paired =gap_get_paired_devices_num(&paired_devices_num); + if(gap_get_paired!=true ||paired_devices_num!=0 ) { - unsigned int paired_devices_num=0; - bool gap_get_paired =gap_get_paired_devices_num(&paired_devices_num); - if(gap_get_paired!=true ||paired_devices_num!=0 ) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"sendBindInfor!!!!!!!!!:gap_remove_all_pairs \r\n"); - gap_remove_all_pairs(); - } + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"sendBindInfor!!!!!!!!!:gap_remove_all_pairs \r\n"); + gap_remove_all_pairs(); } + } + if(devnamelen > 0 ) + { + devname = getPhoneName(data); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"devname!!!!!!!!!:%s devnamelen:%d",devname,devnamelen); if (devname != NULL){ @@ -7006,9 +7008,9 @@ errcode_t decode_ota_data(ble_read_data *buffer_handle,uint8_t *data,uint16_t da osTimerDelete(BR_TRANSFER_timer); BR_TRANSFER_timer = NULL; } - + ble_read_timer_p=NULL; ble_reply_cmd(OTA_FILE_SUCC_CMD,1);//接收成功 - } + } } else if (last_package_id==package_id) @@ -8067,9 +8069,15 @@ errcode_t cancel_recv_file(uint8_t flag) ble_read_timer_p->file_recv_stat.file_name=NULL; } ble_read_timer_p->file_recv_stat.recv_file_stat = -1; - ble_read_timer_p=NULL; + //ble_read_timer_p=NULL; + CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); } - CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + // else + // { + // CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + // } + ble_read_timer_p=NULL; + } @@ -8259,7 +8267,7 @@ errcode_t handle_recv_file(ble_read_data *buffer_handle,uint8_t *data, uint16_t osTimerDelete(BR_TRANSFER_timer); BR_TRANSFER_timer = NULL; } - + ble_read_timer_p=NULL; ble_reply_cmd(FILE_RECV_REPLY_STAT_CMD,1);//接收成功 }