Skip to content

Commit 97cc513

Browse files
restyled-commitslazarkov
authored andcommitted
Restyled by clang-format
1 parent 3f6d08a commit 97cc513

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

examples/tv-app/android/java/AppImpl.cpp

+24-18
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,10 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
364364
uint16_t productId;
365365
chip::NodeId nodeId;
366366

367-
CallbackContext(uint16_t vId, uint16_t pId, chip::NodeId nId)
368-
: vendorId(vId), productId(pId), nodeId(nId) {}
367+
CallbackContext(uint16_t vId, uint16_t pId, chip::NodeId nId) : vendorId(vId), productId(pId), nodeId(nId) {}
369368
};
370369
DevicePairedCommand(uint16_t vendorId, uint16_t productId, chip::NodeId nodeId) :
371-
mOnDeviceConnectedCallback(OnDeviceConnectedFn, this),
372-
mOnDeviceConnectionFailureCallback(OnDeviceConnectionFailureFn, this)
370+
mOnDeviceConnectedCallback(OnDeviceConnectedFn, this), mOnDeviceConnectionFailureCallback(OnDeviceConnectionFailureFn, this)
373371
{
374372
mContext = std::make_shared<CallbackContext>(vendorId, productId, nodeId);
375373
}
@@ -378,25 +376,29 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
378376
const chip::SessionHandle & sessionHandle)
379377
{
380378
auto * pairingCommand = static_cast<DevicePairedCommand *>(context);
381-
auto cbContext = pairingCommand->mContext;
379+
auto cbContext = pairingCommand->mContext;
382380

383381
if (pairingCommand)
384382
{
385-
ChipLogProgress(DeviceLayer, "OnDeviceConnectedFn - Updating ACL for node id: %llu and vendor id: %d and product id: %d", cbContext->nodeId, cbContext->vendorId, cbContext->productId);
383+
ChipLogProgress(DeviceLayer,
384+
"OnDeviceConnectedFn - Updating ACL for node id: %llu and vendor id: %d and product id: %d",
385+
cbContext->nodeId, cbContext->vendorId, cbContext->productId);
386386

387-
GetCommissionerDiscoveryController()->CommissioningSucceeded(cbContext->vendorId, cbContext->productId, cbContext->nodeId, exchangeMgr, sessionHandle);
387+
GetCommissionerDiscoveryController()->CommissioningSucceeded(cbContext->vendorId, cbContext->productId,
388+
cbContext->nodeId, exchangeMgr, sessionHandle);
388389
}
389390
}
390391

391-
392392
static void OnDeviceConnectionFailureFn(void * context, const ScopedNodeId & peerId, CHIP_ERROR error)
393393
{
394394
auto * pairingCommand = static_cast<DevicePairedCommand *>(context);
395-
auto cbContext = pairingCommand->mContext;
395+
auto cbContext = pairingCommand->mContext;
396396

397397
if (pairingCommand)
398398
{
399-
ChipLogProgress(DeviceLayer, "OnDeviceConnectionFailureFn - Not updating ACL for node id: %llu and vendor id: %d and product id: %d", cbContext->nodeId, cbContext->vendorId, cbContext->productId);
399+
ChipLogProgress(DeviceLayer,
400+
"OnDeviceConnectionFailureFn - Not updating ACL for node id: %llu and vendor id: %d and product id: %d",
401+
cbContext->nodeId, cbContext->vendorId, cbContext->productId);
400402
// TODO: Remove Node Id
401403
}
402404
}
@@ -406,8 +408,6 @@ class DevicePairedCommand : public Controller::DevicePairingDelegate
406408
std::shared_ptr<CallbackContext> mContext;
407409
};
408410

409-
410-
411411
EndpointId ContentAppFactoryImpl::AddContentApp(const char * szVendorName, uint16_t vendorId, const char * szApplicationName,
412412
uint16_t productId, const char * szApplicationVersion,
413413
std::vector<SupportedCluster> supportedClusters, jobject manager)
@@ -425,13 +425,16 @@ EndpointId ContentAppFactoryImpl::AddContentApp(const char * szVendorName, uint1
425425

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

428-
for (const auto& nodeId : nodeIds) {
428+
for (const auto & nodeId : nodeIds)
429+
{
429430

430-
ChipLogProgress(DeviceLayer, "Creating Pairing Command with node id: %llu and vendor id: %d and product id: %d", nodeId, vendorId, productId);
431+
ChipLogProgress(DeviceLayer, "Creating Pairing Command with node id: %llu and vendor id: %d and product id: %d", nodeId,
432+
vendorId, productId);
431433

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

434-
GetDeviceCommissioner()->GetConnectedDevice(nodeId, &pairingCommand->mOnDeviceConnectedCallback, &pairingCommand->mOnDeviceConnectionFailureCallback);
436+
GetDeviceCommissioner()->GetConnectedDevice(nodeId, &pairingCommand->mOnDeviceConnectedCallback,
437+
&pairingCommand->mOnDeviceConnectionFailureCallback);
435438
}
436439
return epId;
437440
}
@@ -454,13 +457,16 @@ EndpointId ContentAppFactoryImpl::AddContentApp(const char * szVendorName, uint1
454457

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

457-
for (const auto& nodeId : nodeIds) {
460+
for (const auto & nodeId : nodeIds)
461+
{
458462

459-
ChipLogProgress(DeviceLayer, "Creating Pairing Command with node id: %llu and vendor id: %d and product id: %d", nodeId, vendorId, productId);
463+
ChipLogProgress(DeviceLayer, "Creating Pairing Command with node id: %llu and vendor id: %d and product id: %d", nodeId,
464+
vendorId, productId);
460465

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

463-
GetDeviceCommissioner()->GetConnectedDevice(nodeId, &pairingCommand->mOnDeviceConnectedCallback, &pairingCommand->mOnDeviceConnectionFailureCallback);
468+
GetDeviceCommissioner()->GetConnectedDevice(nodeId, &pairingCommand->mOnDeviceConnectedCallback,
469+
&pairingCommand->mOnDeviceConnectionFailureCallback);
464470
}
465471

466472
return epId;

src/app/app-platform/ContentAppPlatform.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ ContentApp * ContentAppPlatform::GetContentApp(EndpointId id)
388388
}
389389

390390
// create a string key from vendorId and productId
391-
std::string createKey(uint16_t vendorId, uint16_t productId) {
391+
std::string createKey(uint16_t vendorId, uint16_t productId)
392+
{
392393
return std::to_string(vendorId) + ":" + std::to_string(productId);
393394
}
394395

@@ -408,7 +409,8 @@ std::set<NodeId> ContentAppPlatform::GetNodeIdsForContentApp(uint16_t vendorId,
408409
ChipLogProgress(DeviceLayer, "Retrieving node id for key: %s", key.c_str());
409410

410411
auto it = mConnectedContentAppNodeIds.find(key);
411-
if (it != mConnectedContentAppNodeIds.end()) {
412+
if (it != mConnectedContentAppNodeIds.end())
413+
{
412414
ChipLogProgress(DeviceLayer, "Found node id");
413415
return it->second;
414416
}

0 commit comments

Comments
 (0)