From: Caisking <3449750381@qq.com> Date: Mon, 29 Apr 2024 12:13:37 +0000 (+0800) Subject: 更新运动状态协议发送条件 X-Git-Tag: release_V1.2.70_20241020_135402~1025^2~44 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=8bfeb05f8a5b0d0b5c5661bded2ba49b96b7a109;p=mirrors%2FFD230.git 更新运动状态协议发送条件 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h index 6a396a41b..2c20edd33 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h @@ -287,7 +287,7 @@ namespace OHOS bool Gettagstuats{false}; // 训练达标标志位 bool Startstate{false}; // 开始训练标志位 bool Endstate{false}; // 结束训练标志位 - bool Openingway{false}; // 运动开启方式 + bool Openingway{false}; // 运动开启方式 [0 手表 1 app] bool MomentumFlag{false}; // 训练量达标标志位 bool Openstate{false}; // 运动是否开始 diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp index f5fee7eb3..e47768f14 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp @@ -247,7 +247,8 @@ namespace OHOS /*设置运动状态*/ void TraingModel::SetSportState(ExerciseState state) { - if (state != ExerciseState::General) + /*运动开始并且是app发起的运动*/ + if (state != ExerciseState::General && Openingway == true) { sendtraningstatedata(static_cast(state), sportdata->duration); }