DviSubscription assertion failure
|
01-10-2012, 09:50 AM
Post: #1
|
|||
|
|||
DviSubscription assertion failure
I'm trying to create a simple C# media server with ohNet, but I receive an assertion failure from the framework; here's the portion of code that make the exception (both in Windows and Linux):
Code: private void button1_Click(object sender, EventArgs e) and here's the exception (from Linux): Code: Assertion failed. OpenHome/Net/Device/DviSubscription.cpp:192 I'm testing the code with "UPnP Tester"; actually it recognize the service, but after that my program crash. I've tried to use VLC too, and the behaviour is the same (recognition and crash). What I'm missing? Thanks in advance, Sergio |
|||
01-10-2012, 12:23 PM
Post: #2
|
|||
|
|||
RE: DviSubscription assertion failure
(01-10-2012 09:50 AM)Atropo Wrote: I'm trying to create a simple C# media server with ohNet, but I receive an assertion failure from the framework; Welcome to the forum Sergio. This assertion is signalling that one or more properties (aka evented state variables) in a service haven't been initialised. Each service has a provider base class generated for it; these classes have a SetProperty[EventedStateVariableName] function. You just need to call this for each property. You can initialise properties at any point before SetEnabled is called on their containing DvDevice. The normal place to do this is in the constructor for the relevant provider class. See ProviderTestBasic in OpenHome/Net/Bindings/Cs/Device/Tests/TestBasicDv.cs for an example. |
|||
01-10-2012, 01:39 PM
Post: #3
|
|||
|
|||
RE: DviSubscription assertion failure
(01-10-2012 12:23 PM)simonc Wrote: Welcome to the forum Sergio. ![]() ![]() (01-10-2012 12:23 PM)simonc Wrote: This assertion is signalling that one or more properties (aka evented state variables) in a service haven't been initialised. Each service has a provider base class generated for it; these classes have a SetProperty[EventedStateVariableName] function. You just need to call this for each property. Thank you so much; I thought that EnableProperty[EventedStateVaraibleName] function was sufficient to... enable it! However your solution absolutely works!!! ![]() Thanks again, Sergio |
|||
01-10-2012, 02:37 PM
Post: #4
|
|||
|
|||
RE: DviSubscription assertion failure
(01-10-2012 01:39 PM)Atropo Wrote: Thank you so much; I thought that EnableProperty[EventedStateVaraibleName] function was sufficient to... enable it! However your solution absolutely works!!! Glad you got it working. EnableProperty[EventedStateVaraibleName] just adds a property to the serviceStateTable in the service xml. (Which is needed because the media server spec defines some optional state variables.) You still need to choose an initial state for each of the properties after enabling them. One other potential gotcha in this area - its best practice to enable/initialise all properties before enabling any actions. (This becomes important when actions have arguments with related state variables...) |
|||
« Next Oldest | Next Newest »
|