futomi / node-echonet-lite

A Node.js module which allows you to communicate with home appliances supporting the ECHONET Lite protocol.
MIT License
54 stars 17 forks source link

When to stop device searching #2

Closed sowd closed 8 years ago

sowd commented 8 years ago

Hi,

I would like to search all connected ECHONET Lite devices. When is the right timing to call el.stopDiscovery() ?

futomi commented 8 years ago

Thanks for your comment.

Though it is encouraged to call stopDiscovery() in the document, you don't need to call the stopDiscovery() actually If you use 'lan' mode for the network layer. In fact, the stopDiscovery() does nothing in the 'lan' mode.

But if you use `wisunb' mode, be sure to call the stopDiscovery() immediately after a smart meter is discovered. If you don't call the method, the subsequent requests probably won't work well.

Cheers.

sowd commented 8 years ago

Thank you for the suggestion. I will follow the advice.