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 amitnj committed Aug 29, 2022
1 parent 0568463 commit 41b2104
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/app/app-platform/ContentAppPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ namespace AppPlatform {

EndpointId ContentAppPlatform::AddContentApp(ContentApp * app, EmberAfEndpointType * ep,
const Span<DataVersion> & dataVersionStorage,
const Span<const EmberAfDeviceType> & deviceTypeList,
EndpointId desiredEndpointId)
const Span<const EmberAfDeviceType> & deviceTypeList, EndpointId desiredEndpointId)
{
CatalogVendorApp vendorApp = app->GetApplicationBasicDelegate()->GetCatalogVendorApp();

Expand All @@ -108,8 +107,9 @@ EndpointId ContentAppPlatform::AddContentApp(ContentApp * app, EmberAfEndpointTy
index++;
}


if (desiredEndpointId >= emberAfFixedEndpointCount() && emberAfGetDynamicIndexFromEndpoint(desiredEndpointId) != kEmberInvalidEndpointIndex) {
if (desiredEndpointId >= emberAfFixedEndpointCount() &&
emberAfGetDynamicIndexFromEndpoint(desiredEndpointId) != kEmberInvalidEndpointIndex)
{
// an endpoint already exists with the desiredEndpointId. return error.
ChipLogError(DeviceLayer, "Failed to add dynamic endpoint: desired endpointID already in use!");
return kNoCurrentEndpointId;
Expand All @@ -123,20 +123,21 @@ EndpointId ContentAppPlatform::AddContentApp(ContentApp * app, EmberAfEndpointTy
mContentApps[index] = app;
EmberAfStatus ret;

if (desiredEndpointId >= emberAfFixedEndpointCount()) {
ret = emberAfSetDynamicEndpoint(index, desiredEndpointId, ep, dataVersionStorage, deviceTypeList);
if (ret == EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogProgress(DeviceLayer, "Added ContentApp %s to dynamic endpoint %d (index=%d)", vendorApp.applicationId,
desiredEndpointId, index);
app->SetEndpointId(desiredEndpointId);
return app->GetEndpointId();
}
else
{
ChipLogError(DeviceLayer, "Adding ContentApp error=%d", ret);
return kNoCurrentEndpointId;
}
if (desiredEndpointId >= emberAfFixedEndpointCount())
{
ret = emberAfSetDynamicEndpoint(index, desiredEndpointId, ep, dataVersionStorage, deviceTypeList);
if (ret == EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogProgress(DeviceLayer, "Added ContentApp %s to dynamic endpoint %d (index=%d)", vendorApp.applicationId,
desiredEndpointId, index);
app->SetEndpointId(desiredEndpointId);
return app->GetEndpointId();
}
else
{
ChipLogError(DeviceLayer, "Adding ContentApp error=%d", ret);
return kNoCurrentEndpointId;
}
}
else
{
Expand All @@ -145,8 +146,8 @@ EndpointId ContentAppPlatform::AddContentApp(ContentApp * app, EmberAfEndpointTy
ret = emberAfSetDynamicEndpoint(index, mCurrentEndpointId, ep, dataVersionStorage, deviceTypeList);
if (ret == EMBER_ZCL_STATUS_SUCCESS)
{
ChipLogProgress(DeviceLayer, "Added ContentApp %s to dynamic endpoint %d (index=%d)", vendorApp.applicationId,
mCurrentEndpointId, index);
ChipLogProgress(DeviceLayer, "Added ContentApp %s to dynamic endpoint %d (index=%d)",
vendorApp.applicationId, mCurrentEndpointId, index);
app->SetEndpointId(mCurrentEndpointId);
return app->GetEndpointId();
}
Expand Down

0 comments on commit 41b2104

Please sign in to comment.