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 lazarkov committed Jul 8, 2024
1 parent 5f9140f commit 1b33b69
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
14 changes: 9 additions & 5 deletions examples/tv-app/android/java/AppImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
if (pairingCommand)
{
ChipLogProgress(DeviceLayer,
"OnDeviceConnectedFn - Updating ACL for node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d",
"OnDeviceConnectedFn - Updating ACL for node id: " ChipLogFormatX64
" and vendor id: %d and product id: %d",
ChipLogValueX64(cbContext->nodeId), cbContext->vendorId, cbContext->productId);

GetCommissionerDiscoveryController()->CommissioningSucceeded(cbContext->vendorId, cbContext->productId,
Expand All @@ -397,7 +398,8 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
if (pairingCommand)
{
ChipLogProgress(DeviceLayer,
"OnDeviceConnectionFailureFn - Not updating ACL for node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d",
"OnDeviceConnectionFailureFn - Not updating ACL for node id: " ChipLogFormatX64
" and vendor id: %d and product id: %d",
ChipLogValueX64(cbContext->nodeId), cbContext->vendorId, cbContext->productId);
// TODO: Remove Node Id
}
Expand All @@ -408,7 +410,8 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
std::shared_ptr<CallbackContext> mContext;
};

void refreshConnectedClientsAcl(uint16_t vendorId, uint16_t productId, ContentAppImpl * app) {
void refreshConnectedClientsAcl(uint16_t vendorId, uint16_t productId, ContentAppImpl * app)
{

std::set<NodeId> nodeIds = ContentAppPlatform::GetInstance().GetNodeIdsForContentApp(vendorId, productId);

Expand All @@ -422,8 +425,9 @@ void refreshConnectedClientsAcl(uint16_t vendorId, uint16_t productId, ContentAp
for (const auto & nodeId : nodeIds)
{

ChipLogProgress(DeviceLayer, "Creating Pairing Command with node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d", ChipLogValueX64(nodeId),
vendorId, productId);
ChipLogProgress(DeviceLayer,
"Creating Pairing Command with node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d",
ChipLogValueX64(nodeId), vendorId, productId);

std::shared_ptr<DevicePairedCommand> pairingCommand = std::make_shared<DevicePairedCommand>(vendorId, productId, nodeId);

Expand Down
12 changes: 7 additions & 5 deletions examples/tv-app/tv-common/src/AppTv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
if (pairingCommand)
{
ChipLogProgress(DeviceLayer,
"OnDeviceConnectedFn - Updating ACL for node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d",
"OnDeviceConnectedFn - Updating ACL for node id: " ChipLogFormatX64
" and vendor id: %d and product id: %d",
ChipLogValueX64(cbContext->nodeId), cbContext->vendorId, cbContext->productId);

GetCommissionerDiscoveryController()->CommissioningSucceeded(cbContext->vendorId, cbContext->productId,
Expand All @@ -609,7 +610,8 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
if (pairingCommand)
{
ChipLogProgress(DeviceLayer,
"OnDeviceConnectionFailureFn - Not updating ACL for node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d",
"OnDeviceConnectionFailureFn - Not updating ACL for node id: " ChipLogFormatX64
" and vendor id: %d and product id: %d",
ChipLogValueX64(cbContext->nodeId), cbContext->vendorId, cbContext->productId);
// TODO: Remove Node Id
}
Expand Down Expand Up @@ -689,15 +691,15 @@ void ContentAppFactoryImpl::InstallContentApp(uint16_t vendorId, uint16_t produc
for (const auto & nodeId : nodeIds)
{

ChipLogProgress(DeviceLayer, "Creating Pairing Command with node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d", ChipLogValueX64(nodeId),
vendorId, productId);
ChipLogProgress(DeviceLayer,
"Creating Pairing Command with node id: " ChipLogFormatX64 " and vendor id: %d and product id: %d",
ChipLogValueX64(nodeId), vendorId, productId);

std::shared_ptr<DevicePairedCommand> pairingCommand = std::make_shared<DevicePairedCommand>(vendorId, productId, nodeId);

GetDeviceCommissioner()->GetConnectedDevice(nodeId, &pairingCommand->mOnDeviceConnectedCallback,
&pairingCommand->mOnDeviceConnectionFailureCallback);
}

}

bool ContentAppFactoryImpl::UninstallContentApp(uint16_t vendorId, uint16_t productId)
Expand Down
13 changes: 8 additions & 5 deletions src/app/app-platform/ContentAppPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,17 @@ std::set<NodeId> ContentAppPlatform::GetNodeIdsForContentApp(uint16_t vendorId,
return {};
}

std::set<NodeId> ContentAppPlatform::GetNodeIdsForAllowVendorId(uint16_t vendorId) {
std::set<NodeId> ContentAppPlatform::GetNodeIdsForAllowVendorId(uint16_t vendorId)
{
std::set<NodeId> result;
std::string vendorPrefix = std::to_string(vendorId) + ":";

for (const auto& pair : mConnectedContentAppNodeIds) {
const std::string& key = pair.first;
if (key.find(vendorPrefix) == 0) { // Check if the key starts with the vendor prefix
const std::set<NodeId>& nodeIds = pair.second;
for (const auto & pair : mConnectedContentAppNodeIds)
{
const std::string & key = pair.first;
if (key.find(vendorPrefix) == 0)
{ // Check if the key starts with the vendor prefix
const std::set<NodeId> & nodeIds = pair.second;
result.insert(nodeIds.begin(), nodeIds.end());
}
}
Expand Down

0 comments on commit 1b33b69

Please sign in to comment.