About device creation and code generation

Dec 23, 2011 at 7:07 AM

I don't understand the real use of the creation of the devices (code generation). What is the purpose of creating a device class based of a specific device? And it would be great an example of the use. I don't know how to use it because in the constructor of the device it requires a device :S

Why you can't create a new empty device and then a Windows service based on it?

Like with this library and the Device Builder: http://opentools.homeip.net/dev-tools-for-upnp

I really request this part for the library, it's really useful!!!



Dec 25, 2011 at 1:27 AM


The class can be used in many ways, and it matters not what Service you base the code generation on, as long as it supports those state variables and actions, therefore, the way it is intended to be used is for you to use the generation to generate the class for a device which uses the same device architecture, you can then create an instance of the class for any device / service which uses this, for example, I own a Netgear Dg834G ADSL / MODEM router, if I generate the devices and services for that device, they can be used with any ADSL / MODEM which supports those service architectures, not just a Netgear DG834G. And pretty much any ADSL / MODEM router supports those same architectures.

All services and devices are created internally in the framework, you then pass these generic services or devices to the specific device / services class constructor (basically the generated class acts a wrapper), an example of how to discover services or devices can be found here:


If this is not clear enough, please download the documentation and have a read under the section called "How to..." - then the article called  "Discover Devices or Services", this article contains examples on how to discover services or devices and many different ways, asynchronous, synchronous, so forth.

Once you have an object of type Device or Service from the discovery explained above, simply create your specific code generated class by using the constructor and passing the Device / Service into it.

Please feel free to post more if you need more information.

Dec 25, 2011 at 4:54 PM

I know how to discover devices, it's really easy and clear to understand.

My problem is the other part, the device creation.

I want a way to create an empty device from scratch. If you download the tools I posted above, run "Device Builder" and generate an empty device and you will understand what I'm asking.

Thank you!

Dec 26, 2011 at 7:39 AM
Edited Jun 12, 2012 at 12:09 AM
Do you mean a UPnP device host? My framework does not include UPnP hosts, it only allows for the usage of UPnP devices, however your welcome to extend it if you wish, and i will upload the changes made. The generation is for generating classes to access a UPnP endpoint only. Is this what you meant?
Dec 29, 2011 at 9:39 AM

Yes, I mean a device host.

Ok, so it's not implemented. I could do it but I don't know how to start hehe

Thank you!

Dec 29, 2011 at 11:47 AM
Edited Jun 12, 2012 at 12:10 AM
It is planned for the future, but it is pretty low on my priority list out of all my personal projects :)