-
Hi, I'm wondering what would be needed to support dynamic endpoints to implement a Matter bridge. Currently, endpoint and cluster initialization seems to be const and I didn't see an easy way to change those at runtime. As I'm still trying to understand how everything works (this includes the Rust language) I might have missed something tough. Any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Also something I've missed as I do t get notifications for the q&a section... sorry! Dynamic support is completely supported and baked-in! In fact, that's what I use in my own project. You just need to implement the The catch a bit is that you cannot really change your dynamic Node layout while you are serving requests with your async handler. You have to wrap it with an async rw lock or mutex and then only change it when you are able to lock it - I.e. between two requests. |
Beta Was this translation helpful? Give feedback.
Also something I've missed as I do t get notifications for the q&a section... sorry!
Dynamic support is completely supported and baked-in! In fact, that's what I use in my own project.
You just need to implement the
Node
trait on top of some Vec, like either heapless::Vec or - if you are OK with allocations - on top of alloc:vec::Vec and then serve with it a bunch ofEndpoint<'static>
instances.The catch a bit is that you cannot really change your dynamic Node layout while you are serving requests with your async handler. You have to wrap it with an async rw lock or mutex and then only change it when you are able to lock it - I.e. between two requests.