About device creation and code generation

Dec 23, 2011 at 8: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!!!

 

Thanks!!!

Coordinator
Dec 25, 2011 at 2:27 AM

bdominguez,

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:

http://managedupnp.codeplex.com/discussions/259253

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 5: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!

Coordinator
Dec 26, 2011 at 8:39 AM
Edited Jun 12, 2012 at 1: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 10: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!

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