SerialBus API

hello,

A question that I want to ask when using .net Api :

  • is it be better to open the Bus when I am launching my appli (new SerialBus().open()) and close it when I am closing my appli OR do an open and close of the bus at each time that I launch a request?

  • Can I let the bus open indefinitely and interrogate it with regular frequencies? example to use it like alarm system : every second I check if a relay was not switch on?

  • If I open a SerialBus in a Thread and checking the relay status everysecond, is that possible to also use this Bus to send other packets ( to do a specific action on a component)?

thsk

Valery

Without a doubt: open it once and close it once. There is no benefit whatsoever in opening and closing it for each request; on the contrary, you will not be able to receive any incoming packets properly.

There is no problem staying connected to the Velbus

Always be careful with multithreading, you need to know what you are doing. The SerialBus component is an event-driven component, which uses asynchronous I/O. So there is no problem sending and receiving.

You do not need to check the status of a relay yourself (polling), since you will receive a packet when the status of a relay changes (receive event).