更新运动状态协议发送条件 116/2 116/head
authorCaisking <3449750381@qq.com>
Mon, 29 Apr 2024 12:13:37 +0000 (20:13 +0800)
committerCaisking <3449750381@qq.com>
Mon, 29 Apr 2024 12:13:37 +0000 (20:13 +0800)
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp

index 6a396a4..2c20edd 100644 (file)
@@ -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};    // 运动是否开始
 
index f5fee7e..e47768f 100644 (file)
@@ -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<uint8_t>(state), sportdata->duration);
         }