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

Define a IM/DM decoupling interface for interaction model engine to interact with the data model bits #32914

Merged
merged 61 commits into from
May 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5697b48
Start adding a interaction model decoupling
andy31415 Apr 9, 2024
2a59741
Restyle
andy31415 Apr 9, 2024
d23acfa
Also add invoke responder bits
andy31415 Apr 9, 2024
67c6d29
Add the first model definition, for each operation
andy31415 Apr 9, 2024
a582d72
Add all files into the build definition
andy31415 Apr 9, 2024
efa1afe
Start adding the side effect support classes to the interaction model…
andy31415 Apr 9, 2024
4eeb04f
Add actions and integrate them to the IM model
andy31415 Apr 9, 2024
f4c3b46
Add iteration methods
andy31415 Apr 9, 2024
4abcb5e
Restyle
andy31415 Apr 9, 2024
34b646c
Add all files to the build definition
andy31415 Apr 9, 2024
02bc810
Start defining a unit test to at least validate compilation. Will lat…
andy31415 Apr 9, 2024
05a085a
Fix a dependency
andy31415 Apr 9, 2024
dfab9de
Move EventLoggingDelegate to be part of "events" in app.
andy31415 Apr 9, 2024
43308e8
Prepare for testing ... does not compile however TODOs are starting t…
andy31415 Apr 9, 2024
fa4cfa8
Fix SFINAE logic on eventing
andy31415 Apr 9, 2024
7fb1a3c
test that something is actually emitted for events
andy31415 Apr 9, 2024
e97254b
Tests actually do something
andy31415 Apr 9, 2024
f855e93
Some tests actually pass
andy31415 Apr 9, 2024
0aa318a
Restyle
andy31415 Apr 9, 2024
7e95ee7
Merge branch 'master' into im_dm_decoupling
andy31415 Apr 9, 2024
6e532a6
Minor style updates
andy31415 Apr 9, 2024
4c3391a
Merge branch 'master' into im_dm_decoupling
andy31415 Apr 11, 2024
0a0b315
Rename EmitEvent to GenerateEvent
andy31415 Apr 11, 2024
eb58bc9
Add description for paths
andy31415 Apr 11, 2024
d88fb0f
Cleanup some example text ... we do not need an exhaustive usage list
andy31415 Apr 11, 2024
acc842c
Restyle
andy31415 Apr 11, 2024
6886d0c
Fix spelling
andy31415 Apr 11, 2024
6c805d1
Renames based on code review: use UpperCamelCase
andy31415 Apr 11, 2024
bc5f9f6
Updated proposal for retries and paths
andy31415 Apr 11, 2024
b9db782
Restyle
andy31415 Apr 11, 2024
24176e9
one more comment
andy31415 Apr 11, 2024
cff6de1
Restyled by clang-format
restyled-commits Apr 11, 2024
7310b65
Fix typo in parameter type
andy31415 Apr 12, 2024
7d99ad5
Some updates for code review
andreilitvin Apr 16, 2024
c363ddd
Merge branch 'master' into im_dm_decoupling
andreilitvin Apr 16, 2024
c925cb4
Undo submodule update
andreilitvin Apr 16, 2024
72ea3cc
Fix logic error in buffer-too-small check for buffer data
andreilitvin Apr 16, 2024
1da1c87
Fix return error code when send encounters an error
andreilitvin Apr 16, 2024
036782f
Fix logic for mCompleted handling in the auto-complete handling
andreilitvin Apr 16, 2024
ddbe6a6
More comments
andreilitvin Apr 16, 2024
f3673ba
Comments
andreilitvin Apr 16, 2024
b220cf3
Use AAI types for interaction model. I think they will need some spli…
andreilitvin Apr 16, 2024
c2d2935
Update some naming to not use the a... syntax since those are odd
andreilitvin Apr 16, 2024
af649e2
Merge branch 'master' into im_dm_decoupling
andy31415 Apr 25, 2024
0c9cd9e
Code review updates
andy31415 Apr 25, 2024
7856b2e
Added extra comment
andy31415 Apr 25, 2024
e9c0039
Enforce lifetime in invoke responses
andy31415 Apr 25, 2024
e6cdc3e
More comments
andy31415 Apr 25, 2024
7a12efd
More comments
andy31415 Apr 25, 2024
8c86e3d
Restyle
andy31415 Apr 25, 2024
e4b0010
Added comment on replyasync with nullptr
andy31415 Apr 25, 2024
533d542
Update src/app/interaction-model/InvokeResponder.h
andy31415 Apr 25, 2024
4be818f
Update src/app/interaction-model/InvokeResponder.h
andy31415 Apr 25, 2024
492b6f9
Update src/app/interaction-model/InvokeResponder.h
andy31415 Apr 25, 2024
5f76b9c
Update src/app/interaction-model/InvokeResponder.h
andy31415 Apr 25, 2024
7e18454
Some code review updates
andreilitvin Apr 26, 2024
5844827
Some code review updates
andreilitvin Apr 26, 2024
e5e97a8
Merge branch 'im_dm_decoupling' of github.com:andy31415/connectedhome…
andreilitvin Apr 26, 2024
89c5bcf
Make the subject descriptor optional
andreilitvin Apr 26, 2024
ceea7b8
use std::optional instead of chip optiona
andreilitvin Apr 26, 2024
d134fab
Restyle
andreilitvin Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tests actually do something
  • Loading branch information
andy31415 committed Apr 9, 2024
commit e97254b746a3226646507dcc3d4f47503fd6a502
19 changes: 13 additions & 6 deletions src/app/interaction-model/tests/TestEventEmitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ using namespace chip;
using namespace chip::app;
using namespace chip::app::InteractionModel;

using StartUpEventType = chip::app::Clusters::BasicInformation::Events::StartUp::Type;

constexpr uint32_t kFakeSoftwareVersion = 0x1234abcd;

class LogOnlyEvents : public Events
Expand All @@ -35,32 +37,37 @@ class LogOnlyEvents : public Events
virtual CHIP_ERROR EmitEvent(EventLoggingDelegate * eventContentWriter, const EventOptions & options,
EventNumber & generatedEventNumber)
{

mLastOptions = options;
generatedEventNumber = ++mCurrentEventNumber;

return CHIP_NO_ERROR;
}

EventNumber CurrentEventNumber() const { return mCurrentEventNumber; }
const EventOptions & LastOptions() const { return mLastOptions; }

private:
EventNumber mCurrentEventNumber = 0;
EventOptions mLastOptions;
};

} // namespace

TEST(TestInteractionModelEventEmitting, TodoTest)
TEST(TestInteractionModelEventEmitting, TestBasicType)
{
LogOnlyEvents logOnlyEvents;
Events * events = &logOnlyEvents;

chip::app::Clusters::BasicInformation::Events::StartUp::Type event{ kFakeSoftwareVersion };
StartUpEventType event{ kFakeSoftwareVersion };

EventNumber n1 = events->EmitEvent(event, 0);
EventNumber n1 = events->EmitEvent(event, 0 /* EndpointId */);
ASSERT_EQ(n1, logOnlyEvents.CurrentEventNumber());

ASSERT_EQ(logOnlyEvents.LastOptions().mPath,
ConcreteEventPath(0 /* endpointId */, StartUpEventType::GetClusterId(), StartUpEventType::GetEventId()));

EventNumber n2 = events->EmitEvent(event, 1);
ASSERT_EQ(n2, logOnlyEvents.CurrentEventNumber());
ASSERT_NE(n1, logOnlyEvents.CurrentEventNumber());

ASSERT_EQ(logOnlyEvents.LastOptions().mPath,
ConcreteEventPath(1 /* endpointId */, StartUpEventType::GetClusterId(), StartUpEventType::GetEventId()));
}