From: luozheng <1732036298@qq.com> Date: Sat, 26 Oct 2024 12:03:26 +0000 (+0800) Subject: #1107,解决上传音乐过程打断,音乐还是会显示在本地bug X-Git-Tag: fd230_release_V1.3.102~176^2~7 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=cc042bcea8207521f19734abea12180f47234e93;p=mirrors%2FFD230.git #1107,解决上传音乐过程打断,音乐还是会显示在本地bug --- diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/CMakeLists.txt b/code/sdk/application/wearable/service/ble_service/blemoder/CMakeLists.txt index 88694480e..06fa4e476 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/CMakeLists.txt +++ b/code/sdk/application/wearable/service/ble_service/blemoder/CMakeLists.txt @@ -48,6 +48,7 @@ ${ROOT_DIR}/application/wearable/fd230app/nativeui/alipay/include #/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/fd230app/nativeui/player/include ) set(SOURCES diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index be1da0235..c0d0620dc 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -90,6 +90,7 @@ extern "C" { #include "alipay_feature.h" #include "transmitting.h" #include "AlipayC.h" +#include "PlayersModelC.h" uint8_t get_dial_num() @@ -2482,6 +2483,12 @@ void ble_mp3_list_update(void) #endif } +bool IS_free_save_Mp3(uint32_t size) +{ + printf("11111111111111111\n"); + return canSyncMusic(size); +} + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h index e4e41d34a..26d0c4ef5 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h @@ -329,6 +329,7 @@ char * dir_to_json_buf_malloc_(uint8_t type); void get_music_path(char *buf,uint8_t max_len); +bool IS_free_save_Mp3(uint32_t size); /////////////////设备绑定相关////////////// void ble_set_pair(uint8_t falg); 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 dd1787367..99cb65809 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -7142,14 +7142,29 @@ errcode_t decode_mp3_json(ble_read_data *buffer_handle) buffer_handle->file_recv_stat.file_name, buffer_handle->file_recv_stat.file_size ); - buffer_handle->file_recv_stat.received_size = 0; - buffer_handle->file_recv_stat.lrcvalue = 0; - buffer_handle->receive_file_flag = 1; - uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH); - TRANSMIT_DATA=TRANS_MP3_TRANSMITTING; - CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + // buffer_handle->file_recv_stat.received_size = 0; + // buffer_handle->file_recv_stat.lrcvalue = 0; + // buffer_handle->receive_file_flag = 1; + // uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH); + // TRANSMIT_DATA=TRANS_MP3_TRANSMITTING; + // CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + if(IS_free_save_Mp3(ota_size_json->valueint)==false) + { + TRANSMIT_DATA=TRANS_MP3_FAIL; + CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + return ERRCODE_FAIL; + } + else + { + buffer_handle->file_recv_stat.received_size = 0; + buffer_handle->file_recv_stat.lrcvalue = 0; + buffer_handle->receive_file_flag = 1; + uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH); + TRANSMIT_DATA=TRANS_MP3_TRANSMITTING; + CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); - return ERRCODE_SUCC; + return ERRCODE_SUCC; + } }else{ buffer_handle->receive_file_flag = 0; @@ -7738,8 +7753,10 @@ void type2AE0Data(ble_read_data *buffer_handle) { if (decode_mp3_json( buffer_handle) == ERRCODE_SUCC) { + printf("11111111112\n"); ble_reply_cmd(MP3_FILE_RECV_CMD,1); }else{ + printf("11111111113\n"); ble_reply_cmd(MP3_FILE_RECV_CMD,2); } } @@ -7969,6 +7986,20 @@ errcode_t cancel_recv_file(void) fclose(ble_read_timer_p->file_recv_stat.file); ble_read_timer_p->file_recv_stat.file = NULL; } + + if (ble_read_timer_p->file_recv_stat.file_type == 2) + { + char musicpath[64]={0}; + get_music_path(musicpath,64); + //"/user/userdata/music" + char filepath[256]={0}; + create_mp3_name(filepath,musicpath,ble_read_timer_p->file_recv_stat.file_name); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"filepath %s\r\n",filepath); + remove(filepath); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"filepath %s\r\n",filepath); + } + + if (ble_read_timer_p->file_recv_stat.file_name != NULL) { free(ble_read_timer_p->file_recv_stat.file_name);