cansik / artnet4j

Art-Net DMX over IP library for Java and Processing
GNU General Public License v3.0
95 stars 21 forks source link

Art-Net 4 node discovery is not fully supported #18

Open alamaral opened 2 years ago

alamaral commented 2 years ago

In the Art-Net 4 protocol release v1.4 doc, in section Art-Net overview/Art-Net 4: is this paragraph:

Art-Net can address over 30,000 universes. Previously, each group of 4 DMX ports were limited to universes from a consecutive block of 16. Art-Net 4 allows this limit to be resolved as the developer can choose to identify each DMX port individually. This simply means encoding a single DMX port in each ArtPollReply. Using this mechanism, all DMX ports can be assigned a fully independent universe.

What this means is that a device which support ArtNet 4 can send multiple ArtPollReply's for a single node, which only contains the information for that specific port on that node. The BindIndex contains the index of the port that the information pertains to. Currently a device which sends this type of ArtPollReply will cause the ArtNetNode to be updated multiple times for every ArtPoll request, once for each Reply, with only a single port's worth of information (instead of containing all the ports for that node), and if listeners are setup it will constantly do multiple callbacks telling the listener that the node has disconnected and a new node has connected.

I believe that what should happen is that if there is already a Node with a matching IP address, then the node should use the information in the packet to either add a new port, based on the BinIndex, or to update an existing port, if the data is different. If a port is added or updated then listeners should be informed.