From 7bf49966f079d773f7fcb332335824735d18ae86 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Wed, 9 Oct 2024 09:44:19 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=90=AF=E8=BF=90?= =?utf8?q?=E5=8A=A8=E5=9B=9E=E5=A4=8D=E6=A8=A1=E5=BC=8F=EF=BC=8C=E6=94=B9?= =?utf8?q?=E7=94=B1UI=E6=9D=A5=E5=9B=9E=E5=A4=8D=E6=98=AF=E5=90=A6?= =?utf8?q?=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/bleservice/bleEvent.c | 23 +++++++++++++++---- .../service/ble_service/bleservice/bleEvent.h | 1 + 2 files changed, 20 insertions(+), 4 deletions(-) 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 1e28a15a5..9f2681ded 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -4190,6 +4190,19 @@ static void DeleteFileTypeCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *t } } //开启指定运动模式 +void reply_APP_OpenSportModeCmd(bool falg) +{ + + ble_data_type type_={0x01,0x06,1,1,1}; + char data[1]={0}; + if(falg) + data[0]=1; + else + data[0]=2; + send_big_data(type_,data,1); + +} + static void OpenSportModeCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldata,uint8_t crcvalue) { @@ -4210,10 +4223,12 @@ static void OpenSportModeCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *to training_ble_data.controlmd= START; printf("开启指定运动%d\r\n",data[0]); CustomEventPublish(TOPIC_EVENT_BLE_TRAINING,(uint8_t*)&training_ble_data,sizeof(training_ble)); - value[17] = 1; //1 操作成功 2 操作失败 - value[18] = Calculate_CRC(value,18); - sendBleData(value,19); - }else + + // value[17] = 1; //1 操作成功 2 操作失败 + // value[18] = Calculate_CRC(value,18); + // sendBleData(value,19); + } + else { value[17] = 0; value[18] = Calculate_CRC(value,18); diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h index a3c1900fb..926d6b029 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h @@ -835,6 +835,7 @@ void reply_APP_SportStopModeCmd(uint16_t time); void watch_clean_pairs(void); +void reply_APP_OpenSportModeCmd(bool falg); ///////////////////////////自定义文件传输协议///////////////////////////// -- 2.17.1