Greetings Satoshi -
One feature I have found a handy addition to CLink is a
'DeviceChangeListener' interface. A ControlPoint
application that supports this interface is notified
via callbacks when a device is added or removed by the
ControlPoint base class. Here's the interface:
package org.cybergarage.upnp.device;
import org.cybergarage.upnp.Device;
public interface DeviceChangeListener
{
public void deviceAdded( Device dev );
public void deviceRemoved( Device dev );
}
The modification consists of a few extra lines of code in
ControlPoint.java, and the new 'DeviceChangeListener' class
in cybergararge/upnp/device. Attached is a zip file with
the files (started with CLink1.5 version of
ControlPoint.java)
-Oliver
P.S. Feel free to pick another name besides
'DeviceChangeListener' if you decide to include the
feature and have a better name - it was the first thing
that popped into my head!
Also, I noticed that the CLink source has a mixture of
Windows/Unix line endings - some lines end with <CR><LF>,
and some with just a <LF>. Not a problem - just noticed
it since my emacs editor under UNIX displays the <CR>
symbols at the end of only some of the lines.
Patches that implement DeviceChangeListener feature
Logged In: YES
user_id=901512
Originator: NO
Maybe we can create a decorator for the default ControlPoint in order to provider more or less eventing depending on the developer needs.
What do you think?