Yortw / RSSDP

Really Simple Service Discovery Protocol - a 100% .Net implementation of the SSDP protocol for publishing custom/basic devices, and discovering all device types on a network.

Home Page:http://yortw.github.io/RSSDP/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How create Location file and share

fryette opened this issue · comments

How create location file and share it on the UWP(Windows 10)
I don't know how right share file throw network.
Unfortunately I cannot find it in the description

The answer is run your own web server in app
e.x. with using this library https://github.com/sensaura-public/iotweb

Hi,

I'm sorry, I appreciate there seems to be a language barrier here, but I'm not sure what you're asking in your original question. You seem to have found an answer anyway, which is good, but just for further clarification;

RSSDP can generate the xml (device description document) that represents the details of an SSDP device. Create an SsdpRootDevice instance and set properties on it to control the content of the XML. You can also add embedded devices/services to thsi instance. There is a validator class you can pass the device instance to in order to ensure the properties are set correctly/all required properties have values. When done you can call the ToDescriptionDocument to obtain the xml.

RSSDP is not, and does not contain, a web server. In order to provide the HTTP end point that servers the XML you'll need to either use a framework & server such as WCF, WebAPI with IIS/Cassini/NancyFx etc, write your own server using HttpListener if your platform supports it, or use one of the many existing http server projects such as https://github.com/sensaura-public/iotweb which you have already found.

Good luck!

Thank you @Yortw for you answer.
Sorry for language.
Also I noticed, that when I run search(I copy and test code on UWP) I had a lot of exceptions like ```
System.Runtime.InteropServices.COMException: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host. at Windows.Networking.Sockets.DatagramSocketMessageReceivedEventArgs.GetDataReader() at Rssdp.UwaUdpSocket._Socket_MessageReceived(DatagramSocket sender, DatagramSocketMessageReceivedEventArgs args)
I used following code

    foreach (var foundDevice in foundDevices)
    {
    	// Device data returned only contains basic device details and location ]
    	// of full device description.
    	Console.WriteLine("Found " + foundDevice.Usn + " at " + foundDevice.DescriptionLocation.ToString());
        
    	// Can retrieve the full device description easily though.
    	var fullDevice = await foundDevice.GetDeviceInfo();
    	Console.WriteLine(fullDevice.FriendlyName);
    	Console.WriteLine();
    }

No problem about the language, just trying to make sure we understand each other.

Are you getting that error on the line

var fullDevice = await foundDevice.GetDeviceInfo();

? Someone else had a similar sounding issue, and the problem was that one/some of their devices were reporting an incorrect address (or were restarting etc. and therefore not available). The GetDeviceInfo call should be in an try/catch in production code, because networking issues do happen.

@Yortw
I retested application
I commented this line, but I still receive this exception
Also I tried to be in try/catch, and it doesn't help me, I still receive unhandled exception.
It not a big issue, I can live with it, but when you debug code, sometimes it difficult, because you have 10 or more exception one by one.
I want to mansion, that it happens in UWP, maybe on other platforms all is good.

Maybe you have break on all exceptions turned on in the VS? Trying turning that off, or using the 'rese't button on the toolbar of the Exceptions tool window.

@Yortw Oh, sure!
I'll check it soon and will answer you
Right now I don't have my laptop at hand

Unfortunately it didn't work for me.
I turned off all errors breaks, and still receive this exception