Skip to content
Open
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
67f7371
[Create Test] Creating IDM_3_2 python3 test module
j-ororke Sep 20, 2025
8f46e31
Update src/python_testing/TC_IDM_3_2.py
j-ororke Sep 20, 2025
42e50eb
Update src/python_testing/TC_IDM_3_2.py
j-ororke Sep 20, 2025
4c4a4b5
Restyled by autopep8
restyled-commits Sep 20, 2025
6c3d0aa
Removing unneeded imports
j-ororke Sep 20, 2025
669a2a7
Resolving linting errors
j-ororke Sep 20, 2025
d072b90
Restyled by autopep8
restyled-commits Sep 20, 2025
3ddd434
Resolving linting errors part 2
j-ororke Sep 20, 2025
605c6cc
Updating docstrings to be more logical and understandable
j-ororke Sep 20, 2025
dcd0548
Updating docstrings further for clarity
j-ororke Sep 20, 2025
be9e579
Adding plumbing for TIMED_REQUEST_MISMATCH validation, changed to nod…
j-ororke Sep 23, 2025
b3d8e2d
Restyled by whitespace
restyled-commits Sep 23, 2025
bc1626f
Restyled by clang-format
restyled-commits Sep 23, 2025
8439c8a
Restyled by autopep8
restyled-commits Sep 23, 2025
7210fae
Update TC_IDM_3_2.py
j-ororke Sep 23, 2025
55716ed
Resolving linting errors and added some additional comments to test s…
j-ororke Sep 23, 2025
282ebdb
Resolving code dups in ChipDeviceCtrl.py, Attribute.py, and attribute…
j-ororke Sep 23, 2025
f688582
Restyled by whitespace
restyled-commits Sep 23, 2025
9a7ca6f
Restyled by clang-format
restyled-commits Sep 23, 2025
d1f78ea
Restyled by autopep8
restyled-commits Sep 23, 2025
d095563
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Sep 24, 2025
cb26e88
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Sep 25, 2025
b4e13fb
Refactored timed request logic and improve attribute discovery
j-ororke Sep 26, 2025
c292e5c
Restyled by autopep8
restyled-commits Sep 26, 2025
474e423
Implement SuppressResponse functionality and fix WriteHandler bug per…
j-ororke Sep 29, 2025
30de357
Restyled by whitespace
restyled-commits Sep 29, 2025
6786a1b
Restyled by clang-format
restyled-commits Sep 29, 2025
ec8efb6
Restyled by autopep8
restyled-commits Sep 29, 2025
1de2422
Restyled by isort
restyled-commits Sep 29, 2025
92278a2
Update WriteHandler.cpp
j-ororke Oct 2, 2025
d0d7e7b
Update TC_IDM_3_2.py
j-ororke Oct 2, 2025
f3bc13c
Update TC_IDM_3_2.py
j-ororke Oct 2, 2025
1dcc960
Update TC_IDM_3_2.py
j-ororke Oct 2, 2025
2a482dc
Applying autopep8
j-ororke Oct 2, 2025
8c63503
Recovering lost variable
j-ororke Oct 2, 2025
1c4bf3a
Restyled by autopep8
restyled-commits Oct 2, 2025
0dbbb1f
resolving lint error
j-ororke Oct 2, 2025
702e0fd
Restyled by autopep8
restyled-commits Oct 2, 2025
a9fa14c
Update src/controller/python/matter/ChipDeviceCtrl.py
j-ororke Oct 7, 2025
d80c2c5
Address PR feedback from Cecille: improve type safety and simplify at…
j-ororke Oct 8, 2025
80c4bf4
Restyled by autopep8
restyled-commits Oct 8, 2025
f4416a2
Resolving linting error and removing some unneeded comments
j-ororke Oct 8, 2025
4a14bc9
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Oct 9, 2025
6189f8a
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Oct 9, 2025
ad4c031
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Oct 10, 2025
6a364bc
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Oct 16, 2025
d264c6e
Apply suggestions from code review by Cecille
j-ororke Oct 17, 2025
b6eb409
Improve TC_IDM_3_2 and add type hint to Attribute.py's _prepare_write…
j-ororke Oct 18, 2025
6eba285
Restyled by autopep8
restyled-commits Oct 18, 2025
bde6d01
Improve timed write documentation and add missing edge case test scen…
j-ororke Oct 22, 2025
13ea73f
Restyled by whitespace
restyled-commits Oct 22, 2025
3ae33ff
Restyled by clang-format
restyled-commits Oct 22, 2025
79fc25b
Restyled by autopep8
restyled-commits Oct 22, 2025
4b20b2e
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Oct 23, 2025
4c5ecf3
Apply suggestions for timed request field value name change from Boris
j-ororke Oct 23, 2025
3c0d450
Rename mForceTimedRequestFlag to mTimedRequestFieldValue and improve …
j-ororke Oct 23, 2025
e4292a7
Removed SuppressResponse enablement from current python framework cha…
j-ororke Oct 23, 2025
7ea0969
Correcting test step 4 comment to provide issue link and more context
j-ororke Oct 23, 2025
d9b4f30
Restyled by whitespace
restyled-commits Oct 23, 2025
a9356fc
Restyled by clang-format
restyled-commits Oct 23, 2025
49c1782
Restyled by autopep8
restyled-commits Oct 23, 2025
b896bb9
Remove leftover SuppressResponse reference and revert unintended file…
j-ororke Oct 23, 2025
610043b
Consolidate redundant test-only Timed Request code per Boris's feedback:
j-ororke Oct 23, 2025
48b1ff7
Restyled by clang-format
restyled-commits Oct 23, 2025
b9463af
Restyled by autopep8
restyled-commits Oct 23, 2025
7eeb60c
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Oct 24, 2025
200bd11
Merge branch 'master' into create_TC_IDM_3_2_python3_test
j-ororke Nov 6, 2025
be4547d
Refactor attribute write helpers per code review from Cecille:
j-ororke Nov 6, 2025
1210325
Resolving minor noticed change aftter merging master
j-ororke Nov 6, 2025
431a12d
Restyled by clang-format
restyled-commits Nov 6, 2025
2c38877
Restyled by autopep8
restyled-commits Nov 6, 2025
f3f405e
Resolving linting errors
j-ororke Nov 6, 2025
c13545d
Restyled by autopep8
restyled-commits Nov 6, 2025
dc88770
Resolving mypy issues
j-ororke Nov 6, 2025
d10727e
Restyled by autopep8
restyled-commits Nov 6, 2025
7d3f430
Resolving further mypy issues in ChipDeviceCtrl python3 module
j-ororke Nov 7, 2025
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
4 changes: 2 additions & 2 deletions src/app/WriteClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ CHIP_ERROR WriteClient::StartNewMessage()
ReturnErrorOnFailure(FinalizeMessage(true));
}

// Do not allow timed request with chunks.
// Per Matter specification: a Write Request that is part of a Timed Write Interaction SHALL NOT be chunked.
VerifyOrReturnError(!(mTimedWriteTimeoutMs.HasValue() && !mChunks.IsNull()), CHIP_ERROR_NO_MEMORY);

System::PacketBufferHandle packet = System::PacketBufferHandle::New(kMaxSecureSduLengthBytes);
Expand Down Expand Up @@ -201,7 +201,7 @@ CHIP_ERROR WriteClient::StartNewMessage()

ReturnErrorOnFailure(mWriteRequestBuilder.Init(&mMessageWriter));
mWriteRequestBuilder.SuppressResponse(mSuppressResponse);
mWriteRequestBuilder.TimedRequest(mTimedWriteTimeoutMs.HasValue());
mWriteRequestBuilder.TimedRequest(mTimedRequestFieldValue);
ReturnErrorOnFailure(mWriteRequestBuilder.GetError());
mWriteRequestBuilder.CreateWriteRequests();
ReturnErrorOnFailure(mWriteRequestBuilder.GetError());
Expand Down
76 changes: 74 additions & 2 deletions src/app/WriteClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class WriteClient : public Messaging::ExchangeDelegate
bool aSuppressResponse = false) :
mpExchangeMgr(apExchangeMgr),
mExchangeCtx(*this), mpCallback(apCallback), mTimedWriteTimeoutMs(aTimedWriteTimeoutMs),
mSuppressResponse(aSuppressResponse)
mSuppressResponse(aSuppressResponse), mTimedRequestFieldValue(aTimedWriteTimeoutMs.HasValue())
{
assertChipStackLockedByCurrentThread();
}
Expand All @@ -138,7 +138,70 @@ class WriteClient : public Messaging::ExchangeDelegate
WriteClient(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, const Optional<uint16_t> & aTimedWriteTimeoutMs,
uint16_t aReservedSize) :
mpExchangeMgr(apExchangeMgr),
mExchangeCtx(*this), mpCallback(apCallback), mTimedWriteTimeoutMs(aTimedWriteTimeoutMs), mReservedSize(aReservedSize)
mExchangeCtx(*this), mpCallback(apCallback), mTimedWriteTimeoutMs(aTimedWriteTimeoutMs), mReservedSize(aReservedSize),
mTimedRequestFieldValue(aTimedWriteTimeoutMs.HasValue())
{
assertChipStackLockedByCurrentThread();
}

/**
* TestOnly constructor that allows setting the TimedRequest field in the WriteRequest without performing
* a Timed Request action (i.e., without actually sending a TimedRequest message first).
*
* IMPORTANT: Understanding the distinction between two concepts:
* 1. TIMED REQUEST ACTION: A preceding TimedRequest protocol message sent before the actual Write Request.
* This establishes a time window during which the server will accept the write.
* This is controlled by the mTimedWriteTimeoutMs field.
*
* 2. TIMEDREQUEST FIELD: A boolean field in the WriteRequest message itself that indicates whether
* the write was preceded by a Timed Request action.
* This is controlled by the mTimedRequestFieldValue field.
*
* Normal behavior: When you provide a timeout value to the standard constructor, both happen together:
* - A Timed Request action is sent (controlled by mTimedWriteTimeoutMs)
* - The TimedRequest field in WriteRequest is set to true (mTimedRequestFieldValue = true)
*
* This test constructor allows you to decouple these for testing edge cases:
* - aTimedRequestFieldValue = false: No Timed Request action AND TimedRequest field is false (normal non-timed write)
* - aTimedRequestFieldValue = true: No Timed Request action BUT TimedRequest field is true
* (This is invalid behavior that should be rejected by the server, used for negative testing)
*
* @param[in] aTimedRequestFieldValue If true, sets the TimedRequest field in WriteRequest to true without actually
* performing a Timed Request action. This creates a mismatch that should be rejected
* by a compliant server.
*/
WriteClient(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, bool aTimedRequestFieldValue) :
mpExchangeMgr(apExchangeMgr), mExchangeCtx(*this), mpCallback(apCallback), mTimedRequestFieldValue(aTimedRequestFieldValue)
{
assertChipStackLockedByCurrentThread();
}

// Tag type to distinguish the test constructor from the normal constructor
struct TestOnlyOverrideTimedRequestFieldTag
{
};

/**
* TestOnly constructor that allows performing a Timed Request action while setting the TimedRequest field
* in the WriteRequest to false (i.e., sending a TimedRequest message first, but then lying about it in the WriteRequest).
*
* This tests the third edge case: Timed Request action IS performed, but the TimedRequest field is set to false.
*
* Test scenarios enabled by WriteClient constructors:
* 1. Normal write (both false): Action = No, Field = False [Standard constructor with no timeout]
* 2. Normal timed write (both true): Action = Yes, Field = True [Standard constructor with timeout]
* 3. Field true, no action (invalid): Action = No, Field = True [Test constructor taking bool
* aTimedRequestFieldValue]
* 4. Action present, field false (invalid): Action = Yes, Field = False [THIS constructor]
*
* @param[in] aTimedWriteTimeoutMs The timeout for the Timed Request action (WILL be sent)
* @param[in] aTimedRequestFieldValue If false, the TimedRequest field in WriteRequest will be false despite the action
*/
WriteClient(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, const Optional<uint16_t> & aTimedWriteTimeoutMs,
bool aTimedRequestFieldValue, TestOnlyOverrideTimedRequestFieldTag) :
mpExchangeMgr(apExchangeMgr),
mExchangeCtx(*this), mpCallback(apCallback), mTimedWriteTimeoutMs(aTimedWriteTimeoutMs),
mTimedRequestFieldValue(aTimedRequestFieldValue)
{
assertChipStackLockedByCurrentThread();
}
Expand Down Expand Up @@ -525,6 +588,15 @@ class WriteClient : public Messaging::ExchangeDelegate
uint16_t mReservedSize = 0;
// #endif

/**
* The value of the TimedRequest field in the WriteRequest message.
*
* This tells the server whether this write was preceded by a Timed Request action.
* Normally this matches whether mTimedWriteTimeoutMs has a value, but test constructors
* can decouple these to test protocol mismatch scenarios.
*/
bool mTimedRequestFieldValue = false;

/**
* Below we define several const variables for encoding overheads.
* WriteRequestMessage =
Expand Down
Loading
Loading