Skip to content

Commit

Permalink
Merge branch 'master' into fix-clang-tidy-bump-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jlatusek authored Jul 18, 2024
2 parents 7b38231 + c7659cb commit 15a1aeb
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 25 deletions.
7 changes: 6 additions & 1 deletion .github/actions/bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ runs:
# because the bootstrapped Pigweed environment contains absolute paths.
echo "Calculating bootstrap cache key for '$PWD'"
FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}"
FINAL_HASH="$(echo "$PWD:$FILES_HASH" | shasum -a 256 | cut -d' ' -f1)"
case "$RUNNER_OS" in
macOS) OS_HASH="$(sw_vers | shasum -a 256 | cut -d' ' -f1)";;
*) OS_HASH="$(shasum -a 256 /etc/lsb-release | cut -d' ' -f1)";;
esac
PYTHON_HASH="$(python --version | shasum -a 256 | cut -d' ' -f1)"
FINAL_HASH="$(echo "$PWD:$FILES_HASH:$OS_HASH:$PYTHON_HASH" | shasum -a 256 | cut -d' ' -f1)"
echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT"
# Split caches across backends
Expand Down
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
7 changes: 5 additions & 2 deletions src/lib/address_resolve/AddressResolve_DefaultImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ void NodeLookupHandle::LookupResult(const ResolveResult & result)
char addr_string[Transport::PeerAddress::kMaxToStringSize];
result.address.ToString(addr_string);

const PeerId peerId = GetRequest().GetPeerId();
if (success)
{
ChipLogProgress(Discovery, "%s: new best score: %u", addr_string, to_underlying(score));
ChipLogProgress(Discovery, "%s: new best score: %u (for " ChipLogFormatPeerId ")", addr_string, to_underlying(score),
ChipLogValuePeerId(peerId));
}
else
{
ChipLogProgress(Discovery, "%s: score has not improved: %u", addr_string, to_underlying(score));
ChipLogProgress(Discovery, "%s: score has not improved: %u (for " ChipLogFormatPeerId ")", addr_string,
to_underlying(score), ChipLogValuePeerId(peerId));
}
#endif
}
Expand Down
9 changes: 5 additions & 4 deletions src/platform/silabs/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ namespace DeviceLayer {
PlatformManagerImpl PlatformManagerImpl::sInstance;

#if defined(SL_MBEDTLS_USE_TINYCRYPT)
sys_mutex_t PlatformManagerImpl::rngMutexHandle = NULL;
osMutexId_t PlatformManagerImpl::rngMutexHandle = nullptr;

int PlatformManagerImpl::uECC_RNG_Function(uint8_t * dest, unsigned int size)
{
sys_mutex_lock(&rngMutexHandle);
osMutexAcquire(rngMutexHandle, osWaitForever);
int res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0;
sys_mutex_unlock(&rngMutexHandle);
osMutexRelease(rngMutexHandle);

return res;
}
Expand Down Expand Up @@ -97,7 +97,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16));
#endif // !SLI_SI91X_MCU_INTERFACE
/* Set RNG function for tinycrypt operations. */
VerifyOrExit(sys_mutex_new(&rngMutexHandle) == ERR_OK, err = CHIP_ERROR_NO_MEMORY);
rngMutexHandle = osMutexNew(nullptr);
VerifyOrExit((&rngMutexHandle != nullptr), err = CHIP_ERROR_NO_MEMORY);
uECC_set_rng(PlatformManagerImpl::uECC_RNG_Function);
#endif // SL_MBEDTLS_USE_TINYCRYPT

Expand Down
3 changes: 2 additions & 1 deletion src/platform/silabs/PlatformManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
#include "wfx_host_events.h"
#endif
#include <cmsis_os2.h>

namespace chip {
namespace DeviceLayer {
Expand All @@ -45,7 +46,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener
// Since the RNG callback will be called from multiple threads,
// use this mutex to lock/unlock the call to Matter RNG API, which
// uses some global variables.
static sys_mutex_t rngMutexHandle;
static osMutexId_t rngMutexHandle;

// Callback used by tinycrypt to generate random numbers.
// It must be set before calling any sign operations,
Expand Down
1 change: 0 additions & 1 deletion src/platform/silabs/SiWx917/wifi/wfx_host_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "wfx_msgs.h"

/* LwIP includes. */
#include "lwip/apps/httpd.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/netifapi.h"
Expand Down
1 change: 0 additions & 1 deletion src/platform/silabs/efr32/wifi/wfx_host_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s
#endif /* WF200 */

/* LwIP includes. */
#include "lwip/apps/httpd.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/netifapi.h"
Expand Down

0 comments on commit 15a1aeb

Please sign in to comment.