Skip to content

Commit

Permalink
fixed target watt bug
Browse files Browse the repository at this point in the history
  • Loading branch information
benv12 committed Nov 12, 2024
1 parent 20d64c4 commit 5cfb9a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/BLE_Fitness_Machine_Service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ void BLE_Fitness_Machine_Service::processFTMSWrite() {
switch ((uint8_t)rxValue[0]) {
case FitnessMachineControlPointProcedure::RequestControl:
returnValue[2] = FitnessMachineControlPointResultCode::Success; // 0x01;
rtConfig->watts.setTarget(0);
rtConfig->setSimTargetWatts(false);
logBufLength += snprintf(logBuf + logBufLength, kLogBufCapacity - logBufLength, "-> Control Request");
ftmsTrainingStatus[1] = FitnessMachineTrainingStatus::Idle; // 0x01;
fitnessMachineTrainingStatus->setValue(ftmsTrainingStatus, 2);
ftmsStatus = {FitnessMachineStatus::StartedOrResumedByUser};
pCharacteristic->setValue(returnValue, 3);
rtConfig->watts.setTarget(0);
rtConfig->setSimTargetWatts(false);
break;

case FitnessMachineControlPointProcedure::Reset: {
Expand All @@ -147,6 +147,8 @@ void BLE_Fitness_Machine_Service::processFTMSWrite() {
ftmsStatus = {FitnessMachineStatus::Reset};
fitnessMachineTrainingStatus->setValue(ftmsTrainingStatus, 2);
pCharacteristic->setValue(returnValue, 3);
rtConfig->watts.setTarget(0);
rtConfig->setSimTargetWatts(false);
} break;

case FitnessMachineControlPointProcedure::SetTargetInclination: {
Expand Down Expand Up @@ -233,6 +235,8 @@ void BLE_Fitness_Machine_Service::processFTMSWrite() {
ftmsStatus = {FitnessMachineStatus::StoppedOrPausedByUser};
ftmsTrainingStatus[1] = FitnessMachineTrainingStatus::Other; // 0x00;
fitnessMachineTrainingStatus->setValue(ftmsTrainingStatus, 2);
rtConfig->watts.setTarget(0);
rtConfig->setSimTargetWatts(false);

} break;

Expand Down

0 comments on commit 5cfb9a3

Please sign in to comment.