This ensures that cluster listener is always registered in the 'listen' call. Without this, you must always subscribe first and for devices that periodically send (ie battery devices) this may not be possible.
I also changed the listener 'list' from an array to a HashSet to avoid duplicates (and this is also consistent with other listener implementations.
I also tidied up some more code and added some more javadoc...
This ensures that cluster listener is always registered in the 'listen' call. Without this, you must always subscribe first and for devices that periodically send (ie battery devices) this may not be possible.
I also changed the listener 'list' from an array to a HashSet to avoid duplicates (and this is also consistent with other listener implementations.
I also tidied up some more code and added some more javadoc...