Skip to content

Commit de2eb88

Browse files
committed
Restore interface and move to other PR
1 parent d205a15 commit de2eb88

File tree

2 files changed

+4
-47
lines changed

2 files changed

+4
-47
lines changed

src/controller/python/chip/clusters/Attribute.py

-16
Original file line numberDiff line numberDiff line change
@@ -520,22 +520,6 @@ def GetReportingIntervalsSeconds(self) -> Tuple[int, int]:
520520

521521
return minIntervalSec.value, maxIntervalSec.value
522522

523-
def GetSubscriptionTimeoutMs(self) -> int:
524-
'''
525-
Returns the timeout(milliseconds) after which we consider the subscription to have
526-
dropped, if we have received no messages within that amount of time.
527-
528-
Returns 0 milliseconds if a subscription has not yet been established (and
529-
hence the MaxInterval is not yet known), or if the subscription session
530-
is gone and hence the relevant MRP parameters can no longer be determined.
531-
'''
532-
timeoutMs = ctypes.c_uint32(0)
533-
handle = chip.native.GetLibraryHandle()
534-
builtins.chipStack.Call(
535-
lambda: handle.pychip_ReadClient_GetSubscriptionTimeout(self._readTransaction._pReadClient, ctypes.pointer(timeoutMs))
536-
)
537-
return timeoutMs.value
538-
539523
def SetResubscriptionAttemptedCallback(self, callback: Callable[[SubscriptionTransaction, int, int], None], isAsync=False):
540524
'''
541525
Sets the callback function that gets invoked anytime a re-subscription is attempted. The callback is expected

src/controller/python/chip/clusters/attribute.cpp

+4-31
Original file line numberDiff line numberDiff line change
@@ -471,22 +471,6 @@ PyChipError pychip_ReadClient_GetReportingIntervals(ReadClient * pReadClient, ui
471471
return ToPyChipError(err);
472472
}
473473

474-
void pychip_ReadClient_GetSubscriptionTimeout(ReadClient * pReadClient, uint32_t * milliSec)
475-
{
476-
VerifyOrDie(pReadClient != nullptr);
477-
478-
Optional<System::Clock::Timeout> duration = pReadClient->GetSubscriptionTimeout();
479-
480-
// The return value of GetSubscriptionTimeout cannot be 0
481-
// so milliSec=0 can be considered as the subscription has been abnormal.
482-
*milliSec = 0;
483-
if (duration.HasValue())
484-
{
485-
System::Clock::Milliseconds32 msec = std::chrono::duration_cast<System::Clock::Milliseconds32>(duration.Value());
486-
*milliSec = msec.count();
487-
}
488-
}
489-
490474
PyChipError pychip_ReadClient_Read(void * appContext, ReadClient ** pReadClient, ReadClientCallback ** pCallback,
491475
DeviceProxy * device, uint8_t * readParamsBuf, void ** attributePathsFromPython,
492476
size_t numAttributePaths, void ** dataversionFiltersFromPython, size_t numDataversionFilters,
@@ -576,22 +560,11 @@ PyChipError pychip_ReadClient_Read(void * appContext, ReadClient ** pReadClient,
576560
params.mKeepSubscriptions = pyParams.keepSubscriptions;
577561
callback->SetAutoResubscribe(pyParams.autoResubscribe);
578562

579-
#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
580-
if (!pyParams.autoResubscribe)
581-
{
582-
// We want to allow certain kinds of spec-invalid subscriptions so we
583-
// can test how the server reacts to them.
584-
err = readClient->SendSubscribeRequestWithoutValidation(params);
585-
}
586-
else
587-
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
588-
{
589-
dataVersionFilters.release();
590-
attributePaths.release();
591-
eventPaths.release();
563+
dataVersionFilters.release();
564+
attributePaths.release();
565+
eventPaths.release();
592566

593-
err = readClient->SendAutoResubscribeRequest(std::move(params));
594-
}
567+
err = readClient->SendAutoResubscribeRequest(std::move(params));
595568
SuccessOrExit(err);
596569
}
597570
else

0 commit comments

Comments
 (0)