- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am evaluating the UPnP API and have written a small console app to test it. I am using the UPnPSmartControlPoint object and have added a device handler to receive acknowlegements from the network devices. My handler subroutine fires as expected for each device it finds but the device is not added to the control points device collection. What am I doing wrong? The following is my code. Thanks for any responses.
Imports
Intel.UPNPModule
Module1 Dim cp As New UPnPSmartControlPoint Sub Main() AddHandler cp.OnAddedDevice, AddressOf doitcp.Rescan()
System.Threading.Thread.Sleep(5000)
End Sub Sub doit(ByVal sender As Intel.UPNP.UPnPSmartControlPoint, ByVal device As Intel.UPNP.UPnPDevice) End SubEnd
ModuleLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I noticed that the other overloads of the constructor for the UPnPSmartControlPoint object, uses the "DevicePartialMatchFilter" parameter. I also just noticed that the overload that only takes the OnAdded delegate calls the constructor that takes a delegate, and the DevicePartialMatchFilter, and passes in "upnp:rootdevice".
You can rectify the problem, by using that contructor instead of the default constructor. I can have this fixed in the next release of the tools.
As a side note, you should be using the contructor that takes in delegates as parameters, because otherwise you will miss callbacks between the time you construct the object, and when you set the callbacks later. I see you worked around that by calling rescan(), but that is just making the callbacks take longer then they need to.
If you do choose to use those contructors, then you can use "upnp:rootdevice" as the filter, if you are interested in all devices.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page