Sending events in C# UPnP renderer stack

Sending events in C# UPnP renderer stack

Hi,

We are trying to write an UPnP renderer using the C# renderer stack generatedfrom the Intel Device Builder. However we are unsure, what we have to do to send LastChange events.

Using the Intel Device Spy we can see that there is a single LastChange event send automatically (returning just the default "Sample String"), when subsribing to one of our UPnP sevices (AVTransport or RenderingControl).

Does anyone know, what we have to do to send any more of these events?

Thanks

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,

There is an API in the generated service classes in the form Evented_xxx, where xxx is the name of the evented state variable. This is a property. Simply setting this value, will cause an event to get sent out. The type of this property is the .net equivalent to the upnp type that the state variable is.

If you refer to SampleDevice.cs in the generated code, you can see where these properties are set at the end of the constructor.

Quoting - torstenh

Hi,

We are trying to write an UPnP renderer using the C# renderer stack generatedfrom the Intel Device Builder. However we are unsure, what we have to do to send LastChange events.

Using the Intel Device Spy we can see that there is a single LastChange event send automatically (returning just the default "Sample String"), when subsribing to one of our UPnP sevices (AVTransport or RenderingControl).

Does anyone know, what we have to do to send any more of these events?

Thanks

Hi there,

since I had some problems to find the solution myself, here it is.

For example if you want to send a state change of the player you can do this like here:

string avt = string.Empty;

avt += "n";
avt += "n";
avt += "n";
avt += "n";
avt += "";
AVTransport.Evented_LastChange = avt;

For examle if you want to send a change of the volume left / right you can do this like here:

string rcs = "n";
rcs += "n";
rcs += "n";
rcs += "n";
rcs += "n";
rcs += "";
RenderingControl.Evented_LastChange = rcs;

The event will be automaticly triggered by the stack. You can find all variables in the device spy or subscribe to the events to see what you need to do. Its quite equal on all services.

Btw thanks Intel fot this great framework. Never thought it can generate C# code.

Cheers
Media4all

Leave a Comment

Please sign in to add a comment. Not a member? Join today