-
Hey everyone, I'm finding the examples in ControllerNode.ts and DeviceNode.ts somewhat perplexing. Thanks for your assistance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please do not mix Device and Controller because these are different topics! So for each device you create one ServerNode instance using the ServerNode.create method, then you add your needed endpoints to it (Root endpoint is already included in ServerNode) and then you run() it or use bringOnline(). The Controller is encapsulated by the CommissionigController class which gets the used (or default) environment added as startup parameters. This is because the Device API is already renewed, the controller one not yet - that's why the work a bit differently. And a controller is just a client and connects to device nodes. So in fact Device and Controller are two completely different roles in the matter ecosystem, so what you need is about what you want to do:
So normally you do one of the two and not both ;-) But both examples should show how to use the relevant parts. And yes you can also have a controller and devices in the same NodeJs process. If you have questions please ask and we will try to support the best we can. I also convert this question into a discussion. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply; I now have a clearer understanding of the distinctions between ServerNode and ClientNode. |
Beta Was this translation helpful? Give feedback.
Please do not mix Device and Controller because these are different topics!
So for each device you create one ServerNode instance using the ServerNode.create method, then you add your needed endpoints to it (Root endpoint is already included in ServerNode) and then you run() it or use bringOnline().
The "Network" is included in the Environment initialized in the background and the node is automatically added there. you can also startup multiple ServerNodes by using different ports.
The Controller is encapsulated by the CommissionigController class which gets the used (or default) environment added as startup parameters. This is because the Device API is already renewed, the controller one…