Skip to content

Commit

Permalink
Merge branch 'master' into imdm/6-start-using-iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Jul 18, 2024
2 parents cb42ae6 + ba375be commit c3fa7d4
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-android:54
image: ghcr.io/project-chip/chip-build-android:65
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-android:54
image: ghcr.io/project-chip/chip-build-android:65
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
Expand Down
26 changes: 13 additions & 13 deletions examples/window-app/nrfconnect/main/WindowCovering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
NPercent100ths positionToSet{};

VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
Protocols::InteractionModel::Status::Success);
chip::Protocols::InteractionModel::Status::Success);
VerifyOrReturn(Attributes::TargetPositionLiftPercent100ths::Get(Endpoint(), target) ==
Protocols::InteractionModel::Status::Success);
chip::Protocols::InteractionModel::Status::Success);

OperationalState state = ComputeOperationalState(target, current);
UpdateOperationalStatus(MoveType::LIFT, state);
Expand All @@ -87,7 +87,7 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
Instance().mInLiftMove = false;

VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
Protocols::InteractionModel::Status::Success);
chip::Protocols::InteractionModel::Status::Success);

if (!TargetCompleted(MoveType::LIFT, current, target))
{
Expand All @@ -103,7 +103,7 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)

chip::Percent100ths WindowCovering::CalculateNextPosition(MoveType aMoveType)
{
Protocols::InteractionModel::Status status{};
chip::Protocols::InteractionModel::Status status{};
chip::Percent100ths percent100ths{};
NPercent100ths current{};
OperationalState opState{};
Expand All @@ -119,7 +119,7 @@ chip::Percent100ths WindowCovering::CalculateNextPosition(MoveType aMoveType)
opState = OperationalStateGet(Endpoint(), OperationalStatus::kTilt);
}

if ((status == Protocols::InteractionModel::Status::Success) && !current.IsNull())
if ((status == chip::Protocols::InteractionModel::Status::Success) && !current.IsNull())
{
static constexpr auto sPercentDelta{ WC_PERCENT100THS_MAX_CLOSED / 20 };
percent100ths = ComputePercent100thsStep(opState, current.Value(), sPercentDelta);
Expand Down Expand Up @@ -171,9 +171,9 @@ void WindowCovering::DriveCurrentTiltPosition(intptr_t)
NPercent100ths positionToSet{};

VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
Protocols::InteractionModel::Status::Success);
chip::Protocols::InteractionModel::Status::Success);
VerifyOrReturn(Attributes::TargetPositionTiltPercent100ths::Get(Endpoint(), target) ==
Protocols::InteractionModel::Status::Success);
chip::Protocols::InteractionModel::Status::Success);

OperationalState state = ComputeOperationalState(target, current);
UpdateOperationalStatus(MoveType::TILT, state);
Expand All @@ -199,7 +199,7 @@ void WindowCovering::DriveCurrentTiltPosition(intptr_t)
Instance().mInTiltMove = false;

VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
Protocols::InteractionModel::Status::Success);
chip::Protocols::InteractionModel::Status::Success);

if (!TargetCompleted(MoveType::TILT, current, target))
{
Expand Down Expand Up @@ -261,7 +261,7 @@ void WindowCovering::UpdateOperationalStatus(MoveType aMoveType, OperationalStat

void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percent100ths aPosition)
{
Protocols::InteractionModel::Status status{};
chip::Protocols::InteractionModel::Status status{};
if (Instance().mCurrentUIMoveType == MoveType::LIFT)
{
status = Attributes::TargetPositionLiftPercent100ths::Set(Endpoint(), aPosition);
Expand All @@ -271,29 +271,29 @@ void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percen
status = Attributes::TargetPositionTiltPercent100ths::Set(Endpoint(), aPosition);
}

if (status != Protocols::InteractionModel::Status::Success)
if (status != chip::Protocols::InteractionModel::Status::Success)
{
LOG_ERR("Cannot set the target position. Error: %d", static_cast<uint8_t>(status));
}
}

void WindowCovering::PositionLEDUpdate(MoveType aMoveType)
{
Protocols::InteractionModel::Status status{};
chip::Protocols::InteractionModel::Status status{};
NPercent100ths currentPosition{};

if (aMoveType == MoveType::LIFT)
{
status = Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), currentPosition);
if (Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
if (chip::Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
{
Instance().SetBrightness(MoveType::LIFT, currentPosition.Value());
}
}
else if (aMoveType == MoveType::TILT)
{
status = Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), currentPosition);
if (Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
if (chip::Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
{
Instance().SetBrightness(MoveType::TILT, currentPosition.Value());
}
Expand Down
Loading

0 comments on commit c3fa7d4

Please sign in to comment.