Skip to content

Commit 8ad9905

Browse files
authored
Merge branch 'master' into add-dem-example-code-for-1-4
2 parents 38a065e + ba375be commit 8ad9905

File tree

10 files changed

+181
-236
lines changed

10 files changed

+181
-236
lines changed

.github/actions/bootstrap/action.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ runs:
2626
# because the bootstrapped Pigweed environment contains absolute paths.
2727
echo "Calculating bootstrap cache key for '$PWD'"
2828
FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}"
29-
OS_HASH="$(md5sum /etc/lsb-release | cut -d' ' -f1)"
30-
PYTHON_HASH="$(python --version | md5sum | cut -d' ' -f1)"
29+
case "$RUNNER_OS" in
30+
macOS) OS_HASH="$(sw_vers | shasum -a 256 | cut -d' ' -f1)";;
31+
*) OS_HASH="$(shasum -a 256 /etc/lsb-release | cut -d' ' -f1)";;
32+
esac
33+
PYTHON_HASH="$(python --version | shasum -a 256 | cut -d' ' -f1)"
3134
FINAL_HASH="$(echo "$PWD:$FILES_HASH:$OS_HASH:$PYTHON_HASH" | shasum -a 256 | cut -d' ' -f1)"
3235
echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT"
3336

.github/workflows/full-android.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
if: github.actor != 'restyled-io[bot]'
3939

4040
container:
41-
image: ghcr.io/project-chip/chip-build-android:54
41+
image: ghcr.io/project-chip/chip-build-android:65
4242
volumes:
4343
- "/tmp/log_output:/tmp/test_logs"
4444

.github/workflows/smoketest-android.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: github.actor != 'restyled-io[bot]'
3838

3939
container:
40-
image: ghcr.io/project-chip/chip-build-android:54
40+
image: ghcr.io/project-chip/chip-build-android:65
4141
volumes:
4242
- "/:/runner-root-volume"
4343
- "/tmp/log_output:/tmp/test_logs"

examples/window-app/nrfconnect/main/WindowCovering.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ void WindowCovering::DriveCurrentLiftPosition(intptr_t)
5959
NPercent100ths positionToSet{};
6060

6161
VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
62-
Protocols::InteractionModel::Status::Success);
62+
chip::Protocols::InteractionModel::Status::Success);
6363
VerifyOrReturn(Attributes::TargetPositionLiftPercent100ths::Get(Endpoint(), target) ==
64-
Protocols::InteractionModel::Status::Success);
64+
chip::Protocols::InteractionModel::Status::Success);
6565

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

8989
VerifyOrReturn(Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), current) ==
90-
Protocols::InteractionModel::Status::Success);
90+
chip::Protocols::InteractionModel::Status::Success);
9191

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

104104
chip::Percent100ths WindowCovering::CalculateNextPosition(MoveType aMoveType)
105105
{
106-
Protocols::InteractionModel::Status status{};
106+
chip::Protocols::InteractionModel::Status status{};
107107
chip::Percent100ths percent100ths{};
108108
NPercent100ths current{};
109109
OperationalState opState{};
@@ -119,7 +119,7 @@ chip::Percent100ths WindowCovering::CalculateNextPosition(MoveType aMoveType)
119119
opState = OperationalStateGet(Endpoint(), OperationalStatus::kTilt);
120120
}
121121

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

173173
VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
174-
Protocols::InteractionModel::Status::Success);
174+
chip::Protocols::InteractionModel::Status::Success);
175175
VerifyOrReturn(Attributes::TargetPositionTiltPercent100ths::Get(Endpoint(), target) ==
176-
Protocols::InteractionModel::Status::Success);
176+
chip::Protocols::InteractionModel::Status::Success);
177177

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

201201
VerifyOrReturn(Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), current) ==
202-
Protocols::InteractionModel::Status::Success);
202+
chip::Protocols::InteractionModel::Status::Success);
203203

204204
if (!TargetCompleted(MoveType::TILT, current, target))
205205
{
@@ -261,7 +261,7 @@ void WindowCovering::UpdateOperationalStatus(MoveType aMoveType, OperationalStat
261261

262262
void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percent100ths aPosition)
263263
{
264-
Protocols::InteractionModel::Status status{};
264+
chip::Protocols::InteractionModel::Status status{};
265265
if (Instance().mCurrentUIMoveType == MoveType::LIFT)
266266
{
267267
status = Attributes::TargetPositionLiftPercent100ths::Set(Endpoint(), aPosition);
@@ -271,29 +271,29 @@ void WindowCovering::SetTargetPosition(OperationalState aDirection, chip::Percen
271271
status = Attributes::TargetPositionTiltPercent100ths::Set(Endpoint(), aPosition);
272272
}
273273

274-
if (status != Protocols::InteractionModel::Status::Success)
274+
if (status != chip::Protocols::InteractionModel::Status::Success)
275275
{
276276
LOG_ERR("Cannot set the target position. Error: %d", static_cast<uint8_t>(status));
277277
}
278278
}
279279

280280
void WindowCovering::PositionLEDUpdate(MoveType aMoveType)
281281
{
282-
Protocols::InteractionModel::Status status{};
282+
chip::Protocols::InteractionModel::Status status{};
283283
NPercent100ths currentPosition{};
284284

285285
if (aMoveType == MoveType::LIFT)
286286
{
287287
status = Attributes::CurrentPositionLiftPercent100ths::Get(Endpoint(), currentPosition);
288-
if (Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
288+
if (chip::Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
289289
{
290290
Instance().SetBrightness(MoveType::LIFT, currentPosition.Value());
291291
}
292292
}
293293
else if (aMoveType == MoveType::TILT)
294294
{
295295
status = Attributes::CurrentPositionTiltPercent100ths::Get(Endpoint(), currentPosition);
296-
if (Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
296+
if (chip::Protocols::InteractionModel::Status::Success == status && !currentPosition.IsNull())
297297
{
298298
Instance().SetBrightness(MoveType::TILT, currentPosition.Value());
299299
}

0 commit comments

Comments
 (0)