Skip to content

Commit d168883

Browse files
mkardous-silabsyunhanw-google
authored andcommitted
finish clean up
1 parent ba5f877 commit d168883

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

src/app/clusters/icd-management-server/icd-management-server.cpp

+1-14
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,7 @@ Status ICDManagementServer::RegisterClient(CommandHandler * commandObj, const Co
293293
// Save
294294
entry.checkInNodeID = nodeId;
295295
entry.monitoredSubject = monitoredSubject;
296-
297-
if (commandData.clientType.HasValue())
298-
{
299-
ChipLogError(NotSpecified, "-------------------------------- Received Value %d",
300-
static_cast<uint8_t>(commandData.clientType.Value()));
301-
302-
ChipLogError(NotSpecified, "-------------------------------- Set Value %d", static_cast<uint8_t>(clientType.Value()));
303-
}
304-
else
305-
{
306-
ChipLogError(NotSpecified, "-------------------------- WHAT THE FUCK");
307-
}
308-
309-
entry.clientType = static_cast<uint8_t>(clientType.ValueOr(ClientTypeEnum::kPermanent));
296+
entry.clientType = clientType.ValueOr(ClientTypeEnum::kPermanent);
310297

311298
if (entry.keyHandleValid)
312299
{

src/app/icd/server/ICDManager.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void ICDManager::SendCheckInMsgs()
192192
continue;
193193
}
194194

195-
if (entry.clientType == static_cast<uint8_t>(ClientTypeEnum::kEphemeral))
195+
if (entry.clientType == ClientTypeEnum::kEphemeral)
196196
{
197197
// If the registered client is ephemeral, do not send a Check-In message
198198
// continue to next entry
@@ -260,6 +260,12 @@ bool ICDManager::CheckInMessagesWouldBeSent(const std::function<ShouldCheckInMsg
260260
continue;
261261
}
262262

263+
if (entry.clientType == ClientTypeEnum::kEphemeral)
264+
{
265+
// If the registered client is ephemeral, no Check-In message would be sent to this client
266+
continue;
267+
}
268+
263269
// At least one registration would require a Check-In message
264270
VerifyOrReturnValue(!shouldCheckInMsgsBeSentFunction(entry.fabricIndex, entry.monitoredSubject), true);
265271
}

src/app/icd/server/tests/TestICDManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class TestAddressResolver : public AddressResolve::Resolver
134134
CHIP_ERROR LookupNode(const NodeLookupRequest & request, Impl::NodeLookupHandle & handle) override { return CHIP_NO_ERROR; };
135135
CHIP_ERROR TryNextResult(Impl::NodeLookupHandle & handle) override { return CHIP_NO_ERROR; };
136136
CHIP_ERROR CancelLookup(Impl::NodeLookupHandle & handle, FailureCallback cancel_method) override { return CHIP_NO_ERROR; };
137-
void Shutdown() override{};
137+
void Shutdown() override {};
138138
};
139139

140140
System::Clock::Internal::MockClock * pMockClock = nullptr;

0 commit comments

Comments
 (0)