Sep 7, 2011 at 8:01 AM
Edited Sep 7, 2011 at 8:06 AM
UPnP does not have a set function to "receive data from a device", UPnP devices have services, and each service supports Actions and State Variables, so it would depend on what actions you need to call to get the information to stread the data. What im saying
is, that this framework only coverrs the UPnP side of things, ir does not cover the DLNA side of things which is where the streaming comes in.
If your current code can stream data, then this is a direct function of UPnP, its most likely that a particular UPnP action will return a URL which you then stream from, but it is NOT part of UPnP itself, it is part of DLNA, UPnP only encapsulates the discovery,
calling actions, invoking state variables, or receiving events when state variables change.
Look at the devices Actions and State Variables to determine what you need to call.
The code I posted above is all you need, simply put in the service ID of the service you wish to use on the UPnP device and thats it.
When you call an action simply use the InvokeAction method of the "Service" class returned by that code above, to give you any more information, i would need to know the exact specifications for the device class you want to connect to and what actions or
state variables you need to call or enquire on. Im not sure what extra information you need?
This line will discover the services for any device (use the sample program to get the service type ID):
string sServiceTypeID = "your type id here";
Services lsServices = Discovery.FindServices(sServiceTypeID);
Then the services returns an IEnumerable<Service> class which you can enumerate through or just use the first one, simply call InvokeAction on the service class for the action you want.
If you need more help i will need the logs from my program which is displayed when you select the device in question, If you want to plug in a third party UPnP framework you will need to know the basics of UPnP so that you know how to plug it in.