Send NOTIFY on device startup

Dec 6, 2012 at 8:29 AM
Edited Dec 6, 2012 at 8:30 AM

Hi,

We're currently using another open source implementation for UPnP in our application, but got many issues with it due to a poor implementation. After a quick look at your libraries code and the posted comments, I get a good impression with this library. Thanks for the effort and making it available!!

Reading the documentation I couldn't figure out what has to be called in order to send an NOTIFY alive when our server (which is a UPnP device) wants to announce itself after it has started.

Is this functionality part of the library?

The raw message would be:
msg = new HTTPMessage(); msg.Directive = "NOTIFY";
msg.DirectiveObj = "*"; 
msg.AddTag("Host", Utils.GetMulticastAddrBraketPort(local)); 
msg.AddTag("NT", "upnp:rootdevice"); msg.AddTag("NTS", "ssdp:alive");
msg.AddTag("Location", BaseURL); 
msg.AddTag("USN", "uuid:" + UniqueDeviceName + "::upnp:rootdevice");
msg.AddTag("Server", "Windows NT/5.0, UPnP/1.0"); msg.AddTag("Cache-Control", "max-age=" + ExpirationTimeout.ToString());

Coordinator
Dec 6, 2012 at 9:58 AM

ph_waeber,

It sounds like you want to create a UPnP Device End-Point, this library only allows for connecting to End-Points (as a client) it does not allow for the creation of the UPnP Device End-Points (devices / services).

I was in the process of making this library have the ability to create UPnP Device End-Points, but I have little time of late so it has gone on hold.

If I have misunderstood your question, please let me know :)

Cheers,

TheToid

Dec 6, 2012 at 10:34 AM

Hi Toid,

You got it all right, that's what I was looking for. Checking the Windows UPnP API (http://msdn.microsoft.com/en-gb/library/windows/desktop/aa382303(v=vs.85).aspx), I understand that your wrapper implements the Control Point API but not the Device Host API. Is this right?

Thanks, Philippe

Coordinator
Dec 7, 2012 at 9:50 AM

That's exactly right Philippe, however some of the code in this library could be used to implement the Device Host API, for example the Device / Server object hierarchy could be used to specify device and service capabilities, unfortunately there are a few other things you have to do to implement a host using the Device Host API, like have your own HTTP server running.