echonet-lite-rs
echonet-lite-rs copied to clipboard
SingleFunctionLighting Support
https://github.com/marcelocf/echonet-lite-rs/issues/1 was created to this in my fork where I am doing this work.
Story
As a developer, I want to be able to identify and configure SingleFunctionLighting devices.
Details
These lights usually support features such as brightness and operation status. The implementation is over when I am able to tell if a sobj is one of such lights or not. Actual control and property handling is out of the scope of this story.
You can use Self-node instance list
property (EPC is 0xD6) to discover lighting devices in the local area network and Identification number
property (EPC is 0x83) to identify the device.
Both of properties are defined in Node Profile Class.
So, discovery sequence should:
- send broadcast get to Node Profile Class (recommended EPCs are 0x80 and 0xD6)
- if Self-node instance list (0xD6) has lighting class, then send a unicast get to the lighting device's Node Profile Class to know the Identification number
- store the Identification number and IP address that you want to control
With DHCP, sometimes the IP address that the device has might be changed, so we should refresh the IP address by doting step 1 & 2.
Thank you @tomoyuki-nakabayashi . Do you think it would make sense to add discovery code to this library?
Yes, it makes sense. Now, I plan to restructure this repository to consists of some crates like;
- serde-echonet-lite
- echonet-lite-middleware
- a crate for creating application
- tools
The discovery code will be categorized to 3 or 4. But currently, I welcome to add the discovery code into echonet-lite crate.