Skip to content

Commit e1d72de

Browse files
Fixing style issues
1 parent 2f039ed commit e1d72de

File tree

6 files changed

+35
-24
lines changed

6 files changed

+35
-24
lines changed

examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ JNI_METHOD(jobject, verifyOrEstablishConnection)
8383
CHIP_ERROR result = idOptions.addTargetAppInfo(targetAppInfo);
8484
if (result != CHIP_NO_ERROR)
8585
{
86-
ChipLogError(AppServer, "MatterCastingPlayer-JNI::verifyOrEstablishConnection() failed to add targetAppInfo: %" CHIP_ERROR_FORMAT, result.Format());
86+
ChipLogError(AppServer,
87+
"MatterCastingPlayer-JNI::verifyOrEstablishConnection() failed to add targetAppInfo: %" CHIP_ERROR_FORMAT,
88+
result.Format());
8789
}
8890
}
8991

examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MCCastingPlayer.mm

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ - (void)verifyOrEstablishConnectionWithCompletionBlock:(void (^_Nonnull)(NSError
6262
targetAppInfo.productId = desiredEndpointFilter.productId;
6363

6464
CHIP_ERROR result = idOptions.addTargetAppInfo(targetAppInfo);
65-
if (result != CHIP_NO_ERROR)
66-
{
65+
if (result != CHIP_NO_ERROR) {
6766
ChipLogError(AppServer, "MCCastingPlayer.verifyOrEstablishConnectionWithCompletionBlock failed to add targetAppInfo: %" CHIP_ERROR_FORMAT, result.Format());
6867
}
6968
}

examples/tv-casting-app/linux/simple-app-helper.cpp

+16-7
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,28 @@ CHIP_ERROR CommandHandler(int argc, char ** argv)
252252
{
253253
if (strcmp(argv[2], "cgp") == 0)
254254
{
255-
// Attempt Commissioner-Generated Passcode (cgp) commissioning flow only if the CastingPlayer indicates support for it.
255+
// Attempt Commissioner-Generated Passcode (cgp) commissioning flow only if the CastingPlayer indicates support for
256+
// it.
256257
if (targetCastingPlayer->GetSupportsCommissionerGeneratedPasscode())
257258
{
258-
ChipLogProgress(AppServer, "CommandHandler() request %lu cgp. Attempting the Commissioner-Generated Passcode commissioning flow", index);
259+
ChipLogProgress(
260+
AppServer,
261+
"CommandHandler() request %lu cgp. Attempting the Commissioner-Generated Passcode commissioning flow",
262+
index);
259263
idOptions.mCommissionerPasscode = true;
260-
} else
264+
}
265+
else
261266
{
262-
ChipLogError(AppServer, "CommandHandler() request %lu cgp. Selected CastingPLayer does not support the Commissioner-Generated Passcode commissioning flow", index);
267+
ChipLogError(AppServer,
268+
"CommandHandler() request %lu cgp. Selected CastingPLayer does not support the "
269+
"Commissioner-Generated Passcode commissioning flow",
270+
index);
263271
}
264272
}
265273
}
266274
chip::Protocols::UserDirectedCommissioning::TargetAppInfo targetAppInfo;
267275
targetAppInfo.vendorId = kDesiredEndpointVendorId;
268-
CHIP_ERROR result = idOptions.addTargetAppInfo(targetAppInfo);
276+
CHIP_ERROR result = idOptions.addTargetAppInfo(targetAppInfo);
269277
if (result != CHIP_NO_ERROR)
270278
{
271279
ChipLogError(AppServer, "CommandHandler() request, failed to add targetAppInfo: %" CHIP_ERROR_FORMAT, result.Format());
@@ -308,8 +316,9 @@ CHIP_ERROR PrintAllCommands()
308316
streamer_printf(sout, " stop-discovery Stop Discovery of Casting Players. Usage: cast stop-discovery\r\n");
309317
streamer_printf(
310318
sout, " request <index> Request connecting to discovered Casting Player with [index]. Usage: cast request 0\r\n");
311-
streamer_printf(
312-
sout, " request <index> cgp Request connecting to discovered Casting Player with [index] using the Commissioner-Generated Passcode commissioning flow. Usage: cast request 0 cgp\r\n");
319+
streamer_printf(sout,
320+
" request <index> cgp Request connecting to discovered Casting Player with [index] using the "
321+
"Commissioner-Generated Passcode commissioning flow. Usage: cast request 0 cgp\r\n");
313322
streamer_printf(sout, "\r\n");
314323

315324
return CHIP_NO_ERROR;

examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ void CastingPlayer::FindOrEstablishSession(void * clientContext, chip::OnDeviceC
254254
connectionContext->mOnConnectionFailureCallback);
255255
}
256256

257-
bool CastingPlayer::ContainsDesiredTargetApp(core::CastingPlayer * cachedCastingPlayer, std::vector<chip::Protocols::UserDirectedCommissioning::TargetAppInfo> desiredTargetApps)
257+
bool CastingPlayer::ContainsDesiredTargetApp(
258+
core::CastingPlayer * cachedCastingPlayer,
259+
std::vector<chip::Protocols::UserDirectedCommissioning::TargetAppInfo> desiredTargetApps)
258260
{
259261
std::vector<memory::Strong<Endpoint>> cachedEndpoints = cachedCastingPlayer->GetEndpoints();
260262
for (size_t i = 0; i < desiredTargetApps.size(); i++)

examples/tv-casting-app/tv-casting-common/core/CastingPlayer.h

+7-11
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,8 @@ using ConnectCallback = std::function<void(CHIP_ERROR, CastingPlayer *)>;
9595
class CastingPlayer : public std::enable_shared_from_this<CastingPlayer>
9696
{
9797
public:
98-
CastingPlayer(CastingPlayerAttributes playerAttributes)
99-
{
100-
mAttributes = playerAttributes;
101-
}
102-
~CastingPlayer()
103-
{
104-
delete mCommissionerDeclarationHandler;
105-
}
98+
CastingPlayer(CastingPlayerAttributes playerAttributes) { mAttributes = playerAttributes; }
99+
~CastingPlayer() { delete mCommissionerDeclarationHandler; }
106100

107101
/**
108102
* @brief Get the CastingPlayer object targeted currently (may not be connected)
@@ -217,7 +211,7 @@ class CastingPlayer : public std::enable_shared_from_this<CastingPlayer>
217211
* Flag to indicate whether or not the Commissionee has obtained the Commissioner Passcode from the user and is therefore ready
218212
* for commissioning.
219213
*/
220-
bool mUdcCommissionerPasscodeReady = false;
214+
bool mUdcCommissionerPasscodeReady = false;
221215
CommissionerDeclarationHandler * mCommissionerDeclarationHandler = new CommissionerDeclarationHandler();
222216
static CastingPlayer * mTargetCastingPlayer;
223217
unsigned long long int mCommissioningWindowTimeoutSec = kCommissioningWindowTimeoutSec;
@@ -245,9 +239,11 @@ class CastingPlayer : public std::enable_shared_from_this<CastingPlayer>
245239

246240
/**
247241
* @brief Checks if the cachedCastingPlayer contains at least one Endpoint/TargetApp described in the desiredTargetApps list.
248-
* @return true - cachedCastingPlayer contains at least one endpoints with matching (non-default) values for vendorID and productID as described in the desiredTargetApps list, false otherwise.
242+
* @return true - cachedCastingPlayer contains at least one endpoints with matching (non-default) values for vendorID and
243+
* productID as described in the desiredTargetApps list, false otherwise.
249244
*/
250-
bool ContainsDesiredTargetApp(core::CastingPlayer * cachedCastingPlayer, std::vector<chip::Protocols::UserDirectedCommissioning::TargetAppInfo> desiredTargetApps);
245+
bool ContainsDesiredTargetApp(core::CastingPlayer * cachedCastingPlayer,
246+
std::vector<chip::Protocols::UserDirectedCommissioning::TargetAppInfo> desiredTargetApps);
251247

252248
// ChipDeviceEventHandler handles chip::DeviceLayer::ChipDeviceEvent events and helps the CastingPlayer class commission with
253249
// and connect to a CastingPlayer

examples/tv-casting-app/tv-casting-common/core/IdentificationDeclarationOptions.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ class IdentificationDeclarationOptions
6161
*/
6262
bool mCancelPasscode = false;
6363

64-
CHIP_ERROR addTargetAppInfo(const chip::Protocols::UserDirectedCommissioning::TargetAppInfo& targetAppInfo) {
64+
CHIP_ERROR addTargetAppInfo(const chip::Protocols::UserDirectedCommissioning::TargetAppInfo & targetAppInfo)
65+
{
6566
if (mTargetAppInfos.size() >= kMaxTargetAppInfos)
6667
{
67-
ChipLogError(AppServer, "IdentificationDeclarationOptions::addTargetAppInfo() failed to add TargetAppInfo, max vector size is %zu", kMaxTargetAppInfos);
68+
ChipLogError(AppServer,
69+
"IdentificationDeclarationOptions::addTargetAppInfo() failed to add TargetAppInfo, max vector size is %zu",
70+
kMaxTargetAppInfos);
6871
return CHIP_ERROR_NO_MEMORY;
6972
}
7073

0 commit comments

Comments
 (0)