Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Establish CASE on re-subscription #21310

Merged

Conversation

woody-apple
Copy link
Contributor

This adds support for re-establishing CASE on re-subscription if a CHIP_ERROR_TIMEOUT was encountered as a default policy implementation, with the application having the ability to over-ride that if needed.

Fixes #16202

This works out-of-the-box if you call SendAutoResubscribeRequest.

This deletes the function-callback approach in ReadPrepareParams::mResubscribePolicy and uses instead the re-named, ReadClient::Callback::OnResubscriptionNeeded callback to effect the right re-subscription policy.

That callback now pivots from being just an informational callback to one that places the onus on the application (if it over-rides the default impl) to schedule the ensuing re-subscription by calling back into ReadClient::ScheduleResubscription.

Helper methods are provided to help applications pick and select elements of the default re-sub implementation as they desire.

Other notables:

  • Fixes missing clean-up of timers on ReadClient destruction initiated by the application.
  • Fixes missing error-handling of calls made during re-subscription to ensure they trigger further re-subscription.

Testing

  1. Added a new TestSubscribeAttributeTimeout in TestRead.cpp that validates re-subscription sans CASE.
  2. Added a new TestResubscription in the Python test suite that validates re-subscription with CASE.

* Establish CASE on re-subscription

This adds support for re-establishing CASE on re-subscription as a
default policy implementation, with the application having the ability
to over-ride that if needed.

* Review feedback WIP

* Further fixes

* Added a Python test to validate re-subscription

* Updated comment style

* More minor cleanup

* More build fixes

* Update to master

* Review feedback

* Review
@woody-apple woody-apple merged commit c803dab into sve Jul 28, 2022
@woody-apple woody-apple deleted the cherry-pick-6cd46765379255362869e5acd33733bbd3998969 branch July 28, 2022 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants