#6 'DeviceChangeListener' Interface?

open
None
3
2007-12-29
2004-09-12
No

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.

Discussion

  • Oliver Newell
    Oliver Newell
    2004-09-12

    Patches that implement DeviceChangeListener feature

     
  • Stefano Lenzi
    Stefano Lenzi
    2007-12-29

    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?

     
  • Stefano Lenzi
    Stefano Lenzi
    2007-12-29

    • priority: 5 --> 3
    • assigned_to: nobody --> kismet-sl