Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and kkasperczyk-no committed Oct 31, 2023
1 parent acb6291 commit 356b626
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 45 deletions.
2 changes: 1 addition & 1 deletion examples/platform/nrfconnect/util/DFUOverSMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include <lib/support/logging/CHIPLogging.h>

#include <zephyr/dfu/mcuboot.h>
#include <zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h>
#include <zephyr/mgmt/mcumgr/mgmt/callbacks.h>
#include <zephyr/mgmt/mcumgr/mgmt/mgmt.h>
#include <zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h>

using namespace ::chip;
using namespace ::chip::DeviceLayer;
Expand Down
85 changes: 44 additions & 41 deletions examples/window-app/nrfconnect/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,52 +82,55 @@ void MatterWindowCoveringClusterServerAttributeChangedCallback(const app::Concre

void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint)
{
const auto logOnFailure = [](EmberAfStatus status, const char *attributeName) {
if (status != EMBER_ZCL_STATUS_SUCCESS) {
ChipLogError(Zcl, "Failed to set WindowCovering %s: %x", attributeName, status);
}
};
const auto logOnFailure = [](EmberAfStatus status, const char * attributeName) {
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogError(Zcl, "Failed to set WindowCovering %s: %x", attributeName, status);
}
};

app::DataModel::Nullable<chip::Percent100ths> currentPercent100ths;
app::DataModel::Nullable<chip::Percent100ths> targetPercent100ths;
app::DataModel::Nullable<chip::Percent> currentPercentage;
EmberAfStatus status;
app::DataModel::Nullable<chip::Percent100ths> currentPercent100ths;
app::DataModel::Nullable<chip::Percent100ths> targetPercent100ths;
app::DataModel::Nullable<chip::Percent> currentPercentage;
EmberAfStatus status;

status = Attributes::CurrentPositionLiftPercentage::Get(endpoint, currentPercentage);
if (currentPercentage.IsNull()) {
logOnFailure(Attributes::CurrentPositionLiftPercentage::Set(endpoint, 0),
"current position lift percentage");
}
status = Attributes::CurrentPositionLiftPercentage::Get(endpoint, currentPercentage);
if (currentPercentage.IsNull())
{
logOnFailure(Attributes::CurrentPositionLiftPercentage::Set(endpoint, 0), "current position lift percentage");
}

status = Attributes::CurrentPositionTiltPercentage::Get(endpoint, currentPercentage);
if (currentPercentage.IsNull()) {
logOnFailure(Attributes::CurrentPositionTiltPercentage::Set(endpoint, 0),
"current position tilt percentage");
}
status = Attributes::CurrentPositionTiltPercentage::Get(endpoint, currentPercentage);
if (currentPercentage.IsNull())
{
logOnFailure(Attributes::CurrentPositionTiltPercentage::Set(endpoint, 0), "current position tilt percentage");
}

status = Attributes::CurrentPositionLiftPercent100ths::Get(endpoint, currentPercent100ths);
if (currentPercent100ths.IsNull()) {
currentPercent100ths.SetNonNull(0);
logOnFailure(Attributes::CurrentPositionLiftPercent100ths::Set(endpoint, 0),
"current position lift percent 100ths");
}
status = Attributes::CurrentPositionLiftPercent100ths::Get(endpoint, currentPercent100ths);
if (currentPercent100ths.IsNull())
{
currentPercent100ths.SetNonNull(0);
logOnFailure(Attributes::CurrentPositionLiftPercent100ths::Set(endpoint, 0), "current position lift percent 100ths");
}

status = Attributes::TargetPositionLiftPercent100ths::Get(endpoint, targetPercent100ths);
if (targetPercent100ths.IsNull()) {
logOnFailure(Attributes::TargetPositionLiftPercent100ths::Set(endpoint, currentPercent100ths),
"target position lift percent 100ths");
}
status = Attributes::TargetPositionLiftPercent100ths::Get(endpoint, targetPercent100ths);
if (targetPercent100ths.IsNull())
{
logOnFailure(Attributes::TargetPositionLiftPercent100ths::Set(endpoint, currentPercent100ths),
"target position lift percent 100ths");
}

status = Attributes::CurrentPositionTiltPercent100ths::Get(endpoint, currentPercent100ths);
if (currentPercent100ths.IsNull()) {
currentPercent100ths.SetNonNull(0);
logOnFailure(Attributes::CurrentPositionTiltPercent100ths::Set(endpoint, 0),
"current position tilt percent 100ths");
}
status = Attributes::CurrentPositionTiltPercent100ths::Get(endpoint, currentPercent100ths);
if (currentPercent100ths.IsNull())
{
currentPercent100ths.SetNonNull(0);
logOnFailure(Attributes::CurrentPositionTiltPercent100ths::Set(endpoint, 0), "current position tilt percent 100ths");
}

status = Attributes::TargetPositionTiltPercent100ths::Get(endpoint, targetPercent100ths);
if (targetPercent100ths.IsNull()) {
logOnFailure(Attributes::TargetPositionTiltPercent100ths::Set(endpoint, currentPercent100ths),
"target position tilt percent 100ths");
}
status = Attributes::TargetPositionTiltPercent100ths::Get(endpoint, targetPercent100ths);
if (targetPercent100ths.IsNull())
{
logOnFailure(Attributes::TargetPositionTiltPercent100ths::Set(endpoint, currentPercent100ths),
"target position tilt percent 100ths");
}
}
2 changes: 1 addition & 1 deletion src/lib/shell/commands/Stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ CHIP_ERROR StatPeakHandler(int argc, char ** argv)
}

#if defined(CHIP_CRYPTO_MBEDTLS) && defined(MBEDTLS_MEMORY_DEBUG)
size_t maxUsed = 0;
size_t maxUsed = 0;
size_t maxBlocks = 0;

mbedtls_memory_buffer_alloc_max_get(&maxUsed, &maxBlocks);
Expand Down
3 changes: 1 addition & 2 deletions src/platform/nrfconnect/wifi/WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ class WiFiManager
};

constexpr static uint32_t kWifiManagementEvents = NET_EVENT_WIFI_SCAN_RESULT | NET_EVENT_WIFI_SCAN_DONE |
NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT |
NET_EVENT_WIFI_IFACE_STATUS;
NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT | NET_EVENT_WIFI_IFACE_STATUS;

// Event handling
static void WifiMgmtEventHandler(net_mgmt_event_callback * cb, uint32_t mgmtEvent, net_if * iface);
Expand Down

0 comments on commit 356b626

Please sign in to comment.