Update Interactions, BTP, Session for Matter 1.3 (#969)
* Split up Validation errors
The specification does not handle all "Validation errors" the same and so it is a different if there is an "Tlv data parsing error" (invalid datatype or missing mandatory field) or if "just" the value is wrong or out of bounds.
To enhance the returned errors to be more like expected in Specs we split up the Validation Error cases and classes to differentiate between the relevant cases and return either an InvalidAction or a ConstraintError.
* Split up Validation errors
leftover
* Added missing export
* Add TODO for whenever FieldId is used
* Move Mei methods into namespace
* Add Note for TlvEnum
In fact we also could type the enum length according to specs but we always use UInt 32 for now. This works for all enums existing currently and for Tlv encoding only "UInt" is important, so ok for now. But add to remember that we trick a bit here. We could add PR to adjust that and also generate correct length types if wanted.
* Return InvalidAction on unexpected invalid exchange message
Old implementation would have returned "Failure", "InvalidAction" is required according to specs
* Ack last message when sending StandaloneAck
A refactoring some time ago about sending Acks for duplicates introduced a way to send a Standalone Acck and provide a special ack-number. With this we can now remove a special case and allow sending proper "normal" Standalone-Acks which acks the current pending ack-number.
And also use this for incoming DataReports with suppressresponse set to true.
* InteractionCöient missings and docs
* Interaction messages update to Matter 1.3
Validate and update all messages, add some docs and add also new fields and the WildcardPath Enum
* Enhance Attribute Expansion, add WildcardPath
This adds the handling for the WildcardPaths to attribute expansion logic. We use the Matter model for some attributes and also prepare some "static" datastructures for that to e.g. get all diagnostic clusters ony once and so optimize the filtering.
Also the cluster Model class got enhanced for this for convenient access.
* Restructure Interaction tests
... is not changing tests or adding
* Add tests for WildcardFilters
* Refactor Message size handling
In ordert to be more generic I decided to refactor the message size logic.
In fact the "Channel" (UDP, BLE, later TCP) best knows the message size limitation it has. So with substracting protocol overheads we can build messages of the ideal maximum size. This also removes the hard coded max Matter message size of 1024 bytes which was et from times before specs were published.
This new maxPayloadSize introduced in Channels and MessageExchange is now also used when chunking messages.
* Cleanup CASE/PASE
We also need to cleanup a bit the PASE and CASE handling. Main changes are some renamings of fields to match to spec and be better understandable.
Additionally i separated our session parameters and the incoming ones directly and remove that we send them back which is wrong. Additionally we internally use the correct fallback session parameters and introduce the new Matter 1.3 sessionParameters fields. The default Session parameters are placed into MatterDevice/Controller and used via context.
* Streamline interaction errors for invalid messages
* Streamline Invoke names with spec
* Implement Multi Invoke
We implement multi invoke and execute commands sequencially, but send out responses as soon as the message is full (chunked).
* Wire in Multi invoke limits from basic info
* Multi invoke ... missing change
* Interaction Server refactorings
* Subscription optimizations
... to make sure we never generate Max-Intervals longer then the Matter definition of 6 minutes.
* Adjust some tests
* Set attMtu in BTP handshake like chip
The specification was a bit unclear so I synced this now with chip and so also some warnings are gone where applications sent "too big" values
* Add BTP Idle Timeout
While going over specs I found a Idle Timeout which was only mentioned in the table but not in any description, so I implemented it like chip.
* Only use MRP when channel and session requires it
https://github.com/project-chip/connectedhomeip/pull/30124 broke the matter.js BLE commissioning because now MRP is not respected when required via a "reliable" channel. So we now add information if channel is reliable (UDP is not, BTP/later TCP is) and if the session requires MRP (Group sessions do not!) and use this like chip.
* Optimize BLE connection
... to work aroundNoble effects to maybe have a better chance to succeed with a connection
* Wifi cluster in 1.3 requires another attribute
* Ignore unexpected StandaloneAcks for subscription pushs
... instead of logging them
* Make linter happy
* try if python stumbles over undefined "moreChunkedMessages"
* Debug
* it might be "suppress response" on read?
... that fails python tests?
* Finalize and adjust to chip reality
* [execute-chiptests-long] Changelog
* Adjusted Read/Subscribe and SuppressResponse
to match specs as it needs to be after clarifications with spec and sdk devs.
Also streamlines some InteractionClient code for that topic.
* add 0.9.3 to changelog
* Address review feedback