-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add and Enable IM subscription support #9510
Add and Enable IM subscription support #9510
Conversation
Marked discussion required - this is one of the proposals for subscription support (based on read extension to support subscriptions) |
bc5c5fe
to
a2c5b8f
Compare
Per discussion today this is now SDK Approved, and we should proceed with this path forward. Closing the alternative proposal here: #9466 |
a2c5b8f
to
7e0f053
Compare
16e7e2d
to
987a2d3
Compare
--Extend IM ReadHandler with subscribe capability, and update the corresponding reporting engine, which can process multiple subscriber, process subscribe request and generate subscribe response. --Hook setDirty API to ember so that ember can generate the change set and send it out via IM report.
987a2d3
to
5319438
Compare
@vivien-apple @erjiaqing has updated the test, any further concern, thanks |
Here is how I think we should write the test:
I have changed a little bit the syntax for "waitForAttributeReport" as it can probably be done without having to resort to touching the "simulated" cluster bits and that would let the command inherited |
--Extends IM read client with subscribe capability and it can send subscribe request and process subscribe process and further maintain subscription with livess check. --Disable path filter for IM read/subscribe request. --Update templates to use interaction model APIs for sending subscribe requests. --Update DeviceControllerInteractionModelDelegate to handle report messages from subscription. --Update ChipCallback Mgr to bridge subscribe responses to existing callbacks, and handle TLV message just as read responses. --Update TestSuite for basic Subscription protocol tests, test routing looks like follows: Send subscribe request, wait for response. Wait for a few seconds, and execute "kick" commands. The test is expected to receive the same number of Reports as the number of kick commands. The test will fail when not receiving enough report data from server in global timeout. --Update python script test to (in cirque) include a similar test routine as test suite. --Add unit test for positive and negative subscribe test --Add integrated cirque test for subscribe
5319438
to
df4f5e9
Compare
Size increase report for "gn_qpg-example-build" from 92d3a28
Full report output
|
Size increase report for "nrfconnect-example-build" from 92d3a28
Full report output
|
Size increase report for "esp32-example-build" from 92d3a28
Full report output
|
bool IsAwaitingInitialReport() const { return mState == ClientState::AwaitingInitialReport; } | ||
bool IsAwaitingSubscribeResponse() const { return mState == ClientState::AwaitingSubscribeResponse; } | ||
|
||
CHIP_ERROR GenerateEventPathList(EventPathList::Builder & aEventPathListBuilder, EventPathParams * apEventPathParamsList, | ||
size_t aEventPathParamsListSize); | ||
CHIP_ERROR GenerateAttributePathList(AttributePathList::Builder & aAttributeathListBuilder, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SmartThings is very excited to start integrating Subscription Interactions, and this PR is an excellent path forward.
In fact, we have started already using the interactions, by using the Read Interaction, which is based on lib/connectedhomeip/src/app/tests. However, we run into a couple of issues with the ReadClient class:
Currently ReadClient.h has GenerateAttributePathList(), ProcessReportData() and the destructor (virtual ~ReadClient()) marked as private, making them inaccessible for use outside the class. To get past this hurdle, we have declared them as public so that our application can use the ReadClient class.
I suggest setting them up as public, so that the SDK consumer can use the ReadClient class, in a similar way the TestReadInteraction (as it is set as a friend class, but this would not be a path moving forward for custom code). Or if this is not preferable, we are open to alternatives that you can suggest so Read Interaction development can continue.
… remove some dead code introduced in project-chip#9510
… remove some dead code introduced in project-chip#9510
… remove some dead code introduced in project-chip#9510
Problem
Follow IM spec chapter 5 and IM encoding spec 7.3 and 7.4 to achieve
subscription functionality.
https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/data_model/Interaction-Model.adoc#5-subscribe-interaction
https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/data_model/Encoding-Specification.adoc#subscriberequestmessage
#7978 #7979
Change overview
requests.
messages from subscription.
callbacks, and handle TLV message just as read responses.
Testing
looks like follows:
Send subscribe request, wait for response.
Wait for a few seconds, and execute "kick" commands.
The test is expected to receive the same number of Reports as the
number of kick commands.
The test will fail when not receiving enough report data from server
in global timeout.
routine as test suite.