This PR collects some things that I could not split better. Ithink it might be easier to review the single Commits because they for themself are simpler.
In fact the PR does:
Cleanup in ChannelManager (especially centrallizing the Channelkey generation. It also adds "removeChannel" which is needed when InteractionCLient is reconnecting
Create and throw own typed error for Retransmission Reached case to allow more easy catching
Make timeout to discover a device configurable - during commissioning we usually wait 5s, for resuming a session (preparation for persistence!) we should allow to wait longer, so I made the timeout configurable
Add session-Reconnect logic to "withMessanger" for Interactionclient to renew session - If we have a running connection to a device in controller case and the device gets restarted then the current session becomes invalid. Apple/Google/Amazon are opening a new session when this happens so we simply do the same. The "withController" method which is used gets enhances by a method that also can handle a reconnect if the Retransmission-Reached Error is thrown for the send command.
The interactionClient gets an optional "reconnect" callback for this case to have the logic itself in MatterController where the rest of the connection login is owned. I think thisan elegant way to keep the topics selarated - if you have a better one just tell.
The InteractionClient now also gets a method to "resume" a session and because we do something like that also when doing CASE pairing I refactored to code that the "connect" method takes care of that. It will all be used later when persistence is there - then the code can know if we have are commissioned or not and depending on this enter commissioning or just do a session resume/reconnect. So this is here preparation
This PR collects some things that I could not split better. Ithink it might be easier to review the single Commits because they for themself are simpler.
In fact the PR does: